Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 710 vs 711 for /trunk/Source Code/GUI/Headers/GUI.h

Diff revisions: vs.
  @@ -69,7 +69,7 @@
69 69 /// Graphical User Interface
70 70
71 71 DEFINE_SINGLETON_EXT1(GUI, Input::InputAggregatorInterface)
72 - typedef hashMapImpl<ULL, GUIElement*> GUIMap;
72 + typedef hashMapImpl<ULL, std::pair<GUIElement*, bool/*last state*/>> GUIMap;
73 73 typedef hashMapImpl<I64, GUIMap> GUIMapPerScene;
74 74
75 75 typedef DELEGATE_CBK_PARAM<I64> ButtonCallback;
  @@ -79,6 +79,7 @@
79 79 bool init(const vec2<U16>& renderResolution);
80 80 void onChangeResolution(U16 w, U16 h);
81 81 void onChangeScene(I64 newSceneGUID);
82 + void onUnloadScene(I64 sceneGUID);
82 83 I64 activeSceneGUID() const;
83 84 /// Main update call
84 85 void update(const U64 deltaTime);
  @@ -139,7 +140,7 @@
139 140 template<typename T = GUIElement>
140 141 inline T* getGuiElement(I64 sceneID, ULL elementName) {
141 142 static_assert(std::is_base_of<GUIElement, T>::value, "getGuiElement error: Target is not a valid GUI item");
142 - return static_cast<T*>(_guiStack[sceneID][elementName]);
143 + return static_cast<T*>(_guiStack[sceneID][elementName].first);
143 144 }
144 145 template<typename T = GUIElement>
145 146 inline T* getGuiElement(I64 sceneID, I64 elementID) {
  @@ -148,8 +149,8 @@
148 149
149 150 GUIElement* element = nullptr;
150 151 for (GUIMap::value_type it : guiStackForScene) {
151 - if (it.second->getGUID() == elementID) {
152 - element = it.second;
152 + if (it.second.first->getGUID() == elementID) {
153 + element = it.second.first;
153 154 break;
154 155 }
155 156 }