Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/IGUIButtonBehavior.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | public: | ||||
* @param z Z-value | * @param z Z-value | ||||
* @param sprite Sprite drawn when not pressed, hovered or disabled | * @param sprite Sprite drawn when not pressed, hovered or disabled | ||||
* @param sprite_over Sprite drawn when m_MouseHovering is true | * @param sprite_over Sprite drawn when m_MouseHovering is true | ||||
* @param sprite_pressed Sprite drawn when m_Pressed is true | * @param sprite_pressed Sprite drawn when m_Pressed is true | ||||
* @param sprite_disabled Sprite drawn when "enabled" is false | * @param sprite_disabled Sprite drawn when "enabled" is false | ||||
* @param cell_id Identifies the icon to be used (if the sprite contains | * @param cell_id Identifies the icon to be used (if the sprite contains | ||||
* cell-using images) | * cell-using images) | ||||
*/ | */ | ||||
void DrawButton(const CRect& rect, const float& z, CGUISpriteInstance& sprite, CGUISpriteInstance& sprite_over, CGUISpriteInstance& sprite_pressed, CGUISpriteInstance& sprite_disabled, int cell_id); | void DrawButton(const CRect& rect, const float& z, const CGUISpriteInstance& sprite, const CGUISpriteInstance& sprite_over, const CGUISpriteInstance& sprite_pressed, const CGUISpriteInstance& sprite_disabled, int cell_id); | ||||
protected: | protected: | ||||
/** | /** | ||||
* @see IGUIObject#ResetStates() | * @see IGUIObject#ResetStates() | ||||
*/ | */ | ||||
virtual void ResetStates() | virtual void ResetStates() | ||||
{ | { | ||||
// Notify the gui that we aren't hovered anymore | // Notify the gui that we aren't hovered anymore | ||||
UpdateMouseOver(nullptr); | UpdateMouseOver(nullptr); | ||||
m_Pressed = false; | m_Pressed = false; | ||||
m_PressedRight = false; | m_PressedRight = false; | ||||
} | } | ||||
/** | /** | ||||
* Everybody knows how a button works, you don't simply press it, | * Everybody knows how a button works, you don't simply press it, | ||||
* you have to first press the button, and then release it... | * you have to first press the button, and then release it... | ||||
* in between those two steps you can actually leave the button | * in between those two steps you can actually leave the button | ||||
* area, as long as you release it within the button area... Anyway | * area, as long as you release it within the button area... Anyway | ||||
* this lets us know we are done with step one (clicking). | * this lets us know we are done with step one (clicking). | ||||
*/ | */ | ||||
bool m_Pressed; | bool m_Pressed; | ||||
bool m_PressedRight; | bool m_PressedRight; | ||||
// Settings | |||||
CStrW m_SoundDisabled; | |||||
CStrW m_SoundEnter; | |||||
CStrW m_SoundLeave; | |||||
CStrW m_SoundPressed; | |||||
CStrW m_SoundReleased; | |||||
}; | }; | ||||
#endif // INCLUDED_IGUIBUTTONBEHAVIOR | #endif // INCLUDED_IGUIBUTTONBEHAVIOR |
Wildfire Games · Phabricator