Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.49 KB | None | 0 0
  1. Index: source/gui/GUIManager.cpp
  2. ===================================================================
  3. --- source/gui/GUIManager.cpp   (revision 22755)
  4. +++ source/gui/GUIManager.cpp   (working copy)
  5. @@ -377,11 +377,11 @@ void CGUIManager::TickObjects()
  6.  
  7.     for (const SGUIPage& p : pageStack)
  8.         p.gui->TickObjects();
  9.  }
  10.  
  11. -void CGUIManager::Draw()
  12. +void CGUIManager::Draw() const
  13.  {
  14.     PROFILE3_GPU("gui");
  15.  
  16.     for (const SGUIPage& p : m_PageStack)
  17.         p.gui->Draw();
  18. Index: source/gui/GUIManager.h
  19. ===================================================================
  20. --- source/gui/GUIManager.h (revision 22755)
  21. +++ source/gui/GUIManager.h (working copy)
  22. @@ -114,11 +114,11 @@ public:
  23.     void TickObjects();
  24.  
  25.     /**
  26.      * See CGUI::Draw; applies to @em all loaded pages.
  27.      */
  28. -   void Draw();
  29. +   void Draw() const;
  30.  
  31.     /**
  32.      * See CGUI::UpdateResolution; applies to @em all loaded pages.
  33.      */
  34.     void UpdateResolution();
  35. Index: source/gui/IGUIObject.cpp
  36. ===================================================================
  37. --- source/gui/IGUIObject.cpp   (revision 22756)
  38. +++ source/gui/IGUIObject.cpp   (working copy)
  39. @@ -126,11 +126,11 @@ void IGUIObject::AddSetting(const CStr&
  40.         return;
  41.  
  42.     m_Settings[Name] = new CGUISetting<T>(*this, Name);
  43.  }
  44.  
  45. -bool IGUIObject::MouseOver()
  46. +bool IGUIObject::MouseOver() const
  47.  {
  48.     return m_CachedActualSize.PointInside(m_pGUI.GetMousePos());
  49.  }
  50.  
  51.  bool IGUIObject::MouseOverIcon()
  52. @@ -423,19 +423,19 @@ JSObject* IGUIObject::GetJSObject()
  53.         CreateJSObject();
  54.  
  55.     return m_JSObject.get();
  56.  }
  57.  
  58. -bool IGUIObject::IsHidden()
  59. +bool IGUIObject::IsHidden() const
  60.  {
  61.     // Statically initialise some strings, so we don't have to do
  62.     // lots of allocation every time this function is called
  63.     static const CStr strHidden("hidden");
  64.     return GUI<bool>::GetSetting(this, strHidden);
  65.  }
  66.  
  67. -bool IGUIObject::IsHiddenOrGhost()
  68. +bool IGUIObject::IsHiddenOrGhost() const
  69.  {
  70.     static const CStr strGhost("ghost");
  71.     return IsHidden() || GUI<bool>::GetSetting(this, strGhost);
  72.  }
  73.  
  74. Index: source/gui/IGUIObject.h
  75. ===================================================================
  76. --- source/gui/IGUIObject.h (revision 22756)
  77. +++ source/gui/IGUIObject.h (working copy)
  78. @@ -76,11 +76,11 @@ public:
  79.      * an object from CButton, which changes only this
  80.      * to checking the circle that "size" makes.
  81.      *
  82.      * @return true if mouse is hovering
  83.      */
  84. -   virtual bool MouseOver();
  85. +   virtual bool MouseOver() const;
  86.  
  87.     /**
  88.      * Test if mouse position is over an icon
  89.      */
  90.     virtual bool MouseOverIcon();
  91. @@ -130,11 +130,11 @@ public:
  92.     void AddChild(IGUIObject* pChild);
  93.  
  94.     /**
  95.      * Return all child objects of the current object.
  96.      */
  97. -   std::vector<IGUIObject*>& GetChildren() { return m_Children; }
  98. +   const std::vector<IGUIObject*>& GetChildren() const { return m_Children; }
  99.  
  100.     //@}
  101.     //--------------------------------------------------------
  102.     /** @name Settings Management */
  103.     //--------------------------------------------------------
  104. @@ -149,16 +149,16 @@ public:
  105.     bool SettingExists(const CStr& Setting) const;
  106.  
  107.     /**
  108.      * Returns whether this is object is set to be hidden.
  109.      */
  110. -   bool IsHidden();
  111. +   bool IsHidden() const;
  112.  
  113.     /**
  114.      * Returns whether this object is set to be hidden or ghost.
  115.      */
  116. -   bool IsHiddenOrGhost();
  117. +   bool IsHiddenOrGhost() const;
  118.  
  119.     /**
  120.      * All sizes are relative to resolution, and the calculation
  121.      * is not wanted in real time, therefore it is cached, update
  122.      * the cached size with this function.
  123. @@ -244,11 +244,11 @@ public:
  124.      * Calls an IGUIObject member function recursively on this object and its children.
  125.      * Aborts recursion at IGUIObjects that have the isRestricted function return true.
  126.      * The arguments of the callback function must be references.
  127.     */
  128.     template<typename... Args>
  129. -   void RecurseObject(bool(IGUIObject::*isRestricted)(), void(IGUIObject::*callbackFunction)(Args... args), Args&&... args)
  130. +   void RecurseObject(bool(IGUIObject::*isRestricted)() const, void(IGUIObject::*callbackFunction)(Args... args), Args&&... args)
  131.     {
  132.         if (this != m_pGUI.GetBaseObject())
  133.         {
  134.             if (isRestricted && (this->*isRestricted)())
  135.                 return;
  136. @@ -508,9 +508,9 @@ class CGUIDummyObject : public IGUIObjec
  137.  public:
  138.     CGUIDummyObject(CGUI& pGUI) : IGUIObject(pGUI) {}
  139.  
  140.     virtual void Draw() {}
  141.     // Empty can never be hovered. It is only a category.
  142. -   virtual bool MouseOver() { return false; }
  143. +   virtual bool MouseOver() const { return false; }
  144.  };
  145.  
  146.  #endif // INCLUDED_IGUIOBJECT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement