MODIFIED: Draw the highlight of the currently selected widget in editor mode.

This commit is contained in:
dfighter1985 2013-03-07 06:01:33 +01:00
parent 8af3618cbf
commit 836f3c9c2c
5 changed files with 19 additions and 3 deletions

View file

@ -424,6 +424,8 @@ namespace NLGUI
void drawHotSpot(THotSpot hs, NLMISC::CRGBA col); void drawHotSpot(THotSpot hs, NLMISC::CRGBA col);
void drawHighlight();
// Returns 'true' if that element can be downcasted to a view // Returns 'true' if that element can be downcasted to a view
virtual bool isView() const { return false; } virtual bool isView() const { return false; }

View file

@ -357,7 +357,7 @@ namespace NLGUI
if ( ( _Over && !editorMode ) || editorSelected ) if ( ( _Over && !editorMode ) )
{ {
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL)) if( !editorMode && (lastOver == false) && (_AHOnOver != NULL))

View file

@ -774,8 +774,7 @@ namespace NLGUI
CCtrlBase *capturePointerLeft = CWidgetManager::getInstance()->getCapturePointerLeft(); CCtrlBase *capturePointerLeft = CWidgetManager::getInstance()->getCapturePointerLeft();
// *** Draw Over // *** Draw Over
if( editorSelected || if( ( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
( !editorMode && _Over && (_OverWhenPushed || !(_Pushed || capturePointerLeft == this ) ) )
) )
{ {
if( !editorMode && (lastOver == false) && (_AHOnOver != NULL) ) if( !editorMode && (lastOver == false) && (_AHOnOver != NULL) )

View file

@ -1300,6 +1300,11 @@ namespace NLGUI
} }
void CInterfaceElement::drawHighlight()
{
CViewRenderer::getInstance()->drawWiredQuad( _XReal, _YReal, _WReal, _HReal );
}
// *************************************************************************** // ***************************************************************************
void CInterfaceElement::invalidateContent() void CInterfaceElement::invalidateContent()
{ {

View file

@ -2056,6 +2056,16 @@ namespace NLGUI
getPointer()->draw (); getPointer()->draw ();
} }
if( CInterfaceElement::getEditorMode() )
{
if( !currentEditorSelection.empty() )
{
CInterfaceElement *e = getElementFromId( currentEditorSelection );
if( e != NULL )
e->drawHighlight();
}
}
// flush layers // flush layers
CViewRenderer::getInstance()->flush(); CViewRenderer::getInstance()->flush();