CHANGED: #1471 Don't show the over texture for buttons when in editor mode.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2012-07-22 02:46:33 +02:00
parent ed300ea4b8
commit 69a40421a7
5 changed files with 21 additions and 8 deletions

View file

@ -105,6 +105,8 @@ namespace NLGUI
_RenderLayer= 0; _RenderLayer= 0;
_AvoidResizeParent= false; _AvoidResizeParent= false;
editorSelected = false;
} }
// dtor // dtor
@ -458,8 +460,17 @@ namespace NLGUI
bool isInGroup( CInterfaceGroup *group ); bool isInGroup( CInterfaceGroup *group );
static void setEditorMode( bool b ){ editorMode = b; }
void setEditorSelected( bool b ){ editorSelected = b; }
bool isEditorSelected() const{ return editorSelected; }
protected: protected:
bool editorSelected;
static bool editorMode;
///the parent ///the parent
CInterfaceGroup* _Parent; CInterfaceGroup* _Parent;

View file

@ -135,7 +135,7 @@ namespace NLGUI
{ {
case ToggleButton: case ToggleButton:
{ {
if (_Pushed) if (_Pushed && !editorMode )
{ {
nTxId = _TextureIdPushed; nTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -161,7 +161,7 @@ namespace NLGUI
} }
else else
{ {
if ((_Over) && (CWidgetManager::getInstance()->getCapturePointerLeft() == this)) if ( (_Over) && (CWidgetManager::getInstance()->getCapturePointerLeft() == this) && !editorMode )
{ {
nTxId = _TextureIdPushed; nTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -177,7 +177,7 @@ namespace NLGUI
break; break;
case PushButton: case PushButton:
{ {
if (_Over && (CWidgetManager::getInstance()->getCapturePointerLeft() == this)) if ( _Over && (CWidgetManager::getInstance()->getCapturePointerLeft() == this) && !editorMode )
{ {
nTxId = _TextureIdPushed; nTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -218,7 +218,7 @@ namespace NLGUI
if (_Over) if ( _Over && !editorMode )
{ {
if ((lastOver == false) && (_AHOnOver != NULL)) if ((lastOver == false) && (_AHOnOver != NULL))

View file

@ -278,7 +278,7 @@ namespace NLGUI
{ {
case ToggleButton: case ToggleButton:
{ {
if (_Pushed) if (_Pushed && !editorMode )
{ {
pTxId = _TextureIdPushed; pTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -304,7 +304,7 @@ namespace NLGUI
} }
else else
{ {
if ((_Over) && (CWidgetManager::getInstance()->getCapturePointerLeft() == this)) if ((_Over) && (CWidgetManager::getInstance()->getCapturePointerLeft() == this) && !editorMode )
{ {
pTxId = _TextureIdPushed; pTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -320,7 +320,7 @@ namespace NLGUI
break; break;
case PushButton: case PushButton:
{ {
if (_Over && (CWidgetManager::getInstance()->getCapturePointerLeft() == this)) if (_Over && (CWidgetManager::getInstance()->getCapturePointerLeft() == this) && !editorMode )
{ {
pTxId = _TextureIdPushed; pTxId = _TextureIdPushed;
color = getCurrentColorPushed(globalColor); color = getCurrentColorPushed(globalColor);
@ -355,7 +355,7 @@ namespace NLGUI
rVR.drawRotFlipBitmap ( _RenderLayer, x+_BmpLeftW+txw, y, _BmpRightW, txh, 0, false, pTxId[2], color ); rVR.drawRotFlipBitmap ( _RenderLayer, x+_BmpLeftW+txw, y, _BmpRightW, txh, 0, false, pTxId[2], color );
// *** Draw Over // *** Draw Over
if (_Over && (_OverWhenPushed || !(_Pushed || CWidgetManager::getInstance()->getCapturePointerLeft() == this))) if ( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || CWidgetManager::getInstance()->getCapturePointerLeft() == this)))
{ {
if ((lastOver == false) && (_AHOnOver != NULL)) if ((lastOver == false) && (_AHOnOver != NULL))
CAHManager::getInstance()->runActionHandler (_AHOnOver, this, _AHOverParams); CAHManager::getInstance()->runActionHandler (_AHOnOver, this, _AHOverParams);

View file

@ -31,6 +31,7 @@ using namespace NLMISC;
namespace NLGUI namespace NLGUI
{ {
bool CInterfaceElement::editorMode = false;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
CInterfaceElement::~CInterfaceElement() CInterfaceElement::~CInterfaceElement()

View file

@ -62,6 +62,7 @@ namespace GUIEditor
NLGUI::CAHManager::setEditorMode( true ); NLGUI::CAHManager::setEditorMode( true );
NLGUI::CLuaManager::setEditorMode( true ); NLGUI::CLuaManager::setEditorMode( true );
NLGUI::CInterfaceElement::setEditorMode( true );
NLGUI::CViewRenderer::setDriver( getDriver() ); NLGUI::CViewRenderer::setDriver( getDriver() );
NLGUI::CViewRenderer::setTextContext( getTextContext() ); NLGUI::CViewRenderer::setTextContext( getTextContext() );