From 337431901f2d18acd15762961af5f8321531cc4b Mon Sep 17 00:00:00 2001 From: Ivan Savenko <saven.ivan@gmail.com> Date: Fri, 9 Aug 2024 14:57:40 +0000 Subject: [PATCH] Moved object construction macros to more logical location --- client/gui/CGuiHandler.h | 21 --------------------- client/gui/CIntObject.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/client/gui/CGuiHandler.h b/client/gui/CGuiHandler.h index 1e5317f57..a91361d04 100644 --- a/client/gui/CGuiHandler.h +++ b/client/gui/CGuiHandler.h @@ -112,24 +112,3 @@ public: }; extern CGuiHandler GH; //global gui handler - -struct SObjectConstruction -{ - CIntObject *myObj; - SObjectConstruction(CIntObject *obj); - ~SObjectConstruction(); -}; - -struct SSetCaptureState -{ - bool previousCapture; - SSetCaptureState(bool allow, ui8 actions); - ~SSetCaptureState(); -}; - -#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this) -#define OBJ_CONSTRUCTION_TARGETED(obj) SObjectConstruction obj__i(obj) -#define OBJECT_CONSTRUCTION_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) -#define OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) - -#define OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE SSetCaptureState obj__i1(true, 255 - DISPOSE); SObjectConstruction obj__i(this) diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index e8dd53348..9a21c4e6f 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -211,3 +211,24 @@ class EmptyStatusBar : public IStatusBar virtual void setEnteringMode(bool on){}; virtual void setEnteredText(const std::string & text){}; }; + +struct SObjectConstruction +{ + CIntObject *myObj; + SObjectConstruction(CIntObject *obj); + ~SObjectConstruction(); +}; + +struct SSetCaptureState +{ + bool previousCapture; + SSetCaptureState(bool allow, ui8 actions); + ~SSetCaptureState(); +}; + +#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this) +#define OBJ_CONSTRUCTION_TARGETED(obj) SObjectConstruction obj__i(obj) +#define OBJECT_CONSTRUCTION_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) +#define OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) + +#define OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE SSetCaptureState obj__i1(true, ALL_ACTIONS); SObjectConstruction obj__i(this)