mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix build, fix element disabling
This commit is contained in:
@@ -40,7 +40,6 @@ CGuiHandler GH;
|
||||
static thread_local bool inGuiThread = false;
|
||||
|
||||
ObjectConstruction::ObjectConstruction(CIntObject *obj)
|
||||
:myObj(obj)
|
||||
{
|
||||
GH.createdObj.push_front(obj);
|
||||
GH.captureChildren = true;
|
||||
@@ -48,10 +47,9 @@ ObjectConstruction::ObjectConstruction(CIntObject *obj)
|
||||
|
||||
ObjectConstruction::~ObjectConstruction()
|
||||
{
|
||||
assert(GH.createdObj.size());
|
||||
assert(GH.createdObj.front() == myObj);
|
||||
assert(!GH.createdObj.empty());
|
||||
GH.createdObj.pop_front();
|
||||
GH.captureChildren = GH.createdObj.size();
|
||||
GH.captureChildren = !GH.createdObj.empty();
|
||||
}
|
||||
|
||||
void CGuiHandler::init()
|
||||
|
||||
@@ -106,6 +106,8 @@ void CIntObject::disable()
|
||||
{
|
||||
if(isActive())
|
||||
deactivate();
|
||||
|
||||
recActions = NO_ACTIONS;
|
||||
}
|
||||
|
||||
void CIntObject::enable()
|
||||
@@ -116,7 +118,7 @@ void CIntObject::enable()
|
||||
redraw();
|
||||
}
|
||||
|
||||
recActions = 255;
|
||||
recActions = ALL_ACTIONS;
|
||||
}
|
||||
|
||||
void CIntObject::setEnabled(bool on)
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
void addUsedEvents(ui16 newActions);
|
||||
void removeUsedEvents(ui16 newActions);
|
||||
|
||||
enum {ACTIVATE=1, DEACTIVATE=2, UPDATE=4, SHOWALL=8, SHARE_POS=16, ALL_ACTIONS=31};
|
||||
enum {NO_ACTIONS = 0, ACTIVATE=1, DEACTIVATE=2, UPDATE=4, SHOWALL=8, SHARE_POS=16, ALL_ACTIONS=31};
|
||||
ui8 recActions; //which calls we allow to receive from parent
|
||||
|
||||
/// deactivates if needed, blocks all automatic activity, allows only disposal
|
||||
@@ -214,7 +214,6 @@ class EmptyStatusBar : public IStatusBar
|
||||
|
||||
class ObjectConstruction
|
||||
{
|
||||
CIntObject *myObj;
|
||||
public:
|
||||
ObjectConstruction(CIntObject *obj);
|
||||
~ObjectConstruction();
|
||||
|
||||
Reference in New Issue
Block a user