Changes for BaseUI Update

This commit is contained in:
JeffR 2022-02-17 18:04:31 -06:00
parent 90951b3cc8
commit ed36cf2c5c
20 changed files with 156 additions and 45 deletions

View file

@ -98,7 +98,7 @@ EndImplementEnumType;
GuiButtonBaseCtrl::GuiButtonBaseCtrl()
{
mDepressed = false;
mMouseOver = false;
mHighlighted = false;
mActive = true;
static StringTableEntry sButton = StringTable->insert( "Button" );
mButtonText = sButton;
@ -288,14 +288,14 @@ void GuiButtonBaseCtrl::onMouseEnter(const GuiEvent &event)
if(isMouseLocked())
{
mDepressed = true;
mMouseOver = true;
mHighlighted = true;
}
else
{
if ( mActive && mProfile->mSoundButtonOver )
SFX->playOnce(mProfile->mSoundButtonOver);
mMouseOver = true;
mHighlighted = true;
}
}
@ -309,7 +309,7 @@ void GuiButtonBaseCtrl::onMouseLeave(const GuiEvent &)
onMouseLeave_callback();
if( isMouseLocked() )
mDepressed = false;
mMouseOver = false;
mHighlighted = false;
}
//-----------------------------------------------------------------------------
@ -542,3 +542,17 @@ DefineEngineMethod( GuiButtonBaseCtrl, resetState, void, (),,
{
object->resetState();
}
DefineEngineMethod(GuiButtonBaseCtrl, setHighlighted, void, (bool highlighted), (false),
"Reset the mousing state of the button.\n\n"
"This method should not generally be called.")
{
object->setHighlighted(highlighted);
}
DefineEngineMethod(GuiButtonBaseCtrl, isHighlighted, bool, (),,
"Reset the mousing state of the button.\n\n"
"This method should not generally be called.")
{
return object->isHighlighted();
}