Fix tech overlay issue.

This was SVN commit r11725.
This commit is contained in:
leper 2012-05-02 22:57:35 +00:00
parent d68d8cdee1
commit 5b7027ec53
3 changed files with 17 additions and 59 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2009 Wildfire Games.
/* Copyright (C) 2012 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -112,7 +112,8 @@ protected:
*/
virtual void ResetStates()
{
m_MouseHovering = false;
// Notify the gui that we aren't hovered anymore
UpdateMouseOver(NULL);
m_Pressed = false;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2012 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -427,36 +427,6 @@ float IGUIObject::GetBufferedZ() const
}
}
// TODO Gee: keep this function and all???
void IGUIObject::CheckSettingsValidity()
{
bool hidden;
GUI<bool>::GetSetting(this, "hidden", hidden);
// If we hide an object, reset many of its parts
if (hidden)
{
// Simulate that no object is hovered for this object and all its children
// why? because it's
try
{
GUI<IGUIObject*>::RecurseObject(0, this, &IGUIObject::UpdateMouseOver, NULL);
}
catch (PSERROR_GUI&)
{
}
}
try
{
// Send message to itself
SendEvent(GUIM_SETTINGS_UPDATED, "update");
}
catch (PSERROR_GUI&)
{
}
}
void IGUIObject::RegisterScriptHandler(const CStr& Action, const CStr& Code, CGUI* pGUI)
{
const int paramCount = 1;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2012 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -248,20 +248,6 @@ public:
*/
virtual void UpdateCachedSize();
/**
* Should be called every time the settings has been updated
* will also send a message GUIM_SETTINGS_UPDATED, so that
* if a derived object wants to add things to be updated,
* they add it in that message part, this is a better solution
* than making this virtual, since the updates that the base
* class does, are the most essential.
* This is not private since there should be no harm in
* checking validity.
*
* @throws TODO not quite settled yet.
*/
void CheckSettingsValidity();
/**
* Set a setting by string, regardless of what type it is.
*
@ -394,7 +380,8 @@ protected:
*/
virtual void ResetStates()
{
m_MouseHovering = false;
// Notify the gui that we aren't hovered anymore
UpdateMouseOver(NULL);
}
public:
@ -475,6 +462,16 @@ protected:
void SetScriptHandler(const CStr& Action, JSObject* Function);
/**
* Inputes the object that is currently hovered, this function
* updates this object accordingly (i.e. if it's the object
* being inputted one thing happens, and not, another).
*
* @param pMouseOver Object that is currently hovered,
* can OF COURSE be NULL too!
*/
void UpdateMouseOver(IGUIObject * const &pMouseOver);
//@}
private:
//--------------------------------------------------------
@ -496,16 +493,6 @@ private:
*/
void ChooseMouseOverAndClosest(IGUIObject* &pObject);
/**
* Inputes the object that is currently hovered, this function
* updates this object accordingly (i.e. if it's the object
* being inputted one thing happens, and not, another).
*
* @param pMouseOver Object that is currently hovered,
* can OF COURSE be NULL too!
*/
void UpdateMouseOver(IGUIObject * const &pMouseOver);
// Is the object a Root object, in philosophy, this means it
// has got no parent, and technically, it's got the m_BaseObject
// as parent.