diff options
author | Tobia Tesan | 2013-09-20 17:39:32 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-09-21 23:22:37 +0200 |
commit | 1869481767b205b3475d9d79e69f69c8cc184b02 (patch) | |
tree | a45511c00fc0b1f3c780911cabae6c208e07b622 /engines/wintermute | |
parent | 59f4a9e7ac519405a728b9d9a448114c05fe4776 (diff) | |
download | scummvm-rg350-1869481767b205b3475d9d79e69f69c8cc184b02.tar.gz scummvm-rg350-1869481767b205b3475d9d79e69f69c8cc184b02.tar.bz2 scummvm-rg350-1869481767b205b3475d9d79e69f69c8cc184b02.zip |
WINTERMUTE: Setters/getters for UIButton
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/ad/ad_response_box.cpp | 10 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_button.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/ui/ui_button.h | 14 |
3 files changed, 26 insertions, 10 deletions
diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index f9680e99df..229ba8152b 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -125,8 +125,8 @@ bool AdResponseBox::invalidateButtons() { _respButtons[i]->putFont(nullptr); _respButtons[i]->setText(""); _respButtons[i]->_cursor = nullptr; - _respButtons[i]->_fontHover = nullptr; - _respButtons[i]->_fontPress = nullptr; + _respButtons[i]->putFontHover(nullptr); + _respButtons[i]->putFontPress(nullptr); } return STATUS_OK; } @@ -169,12 +169,12 @@ bool AdResponseBox::createButtons() { } else { btn->putFont(_font); } - btn->_fontHover = (_fontHover == nullptr) ? _gameRef->getSystemFont() : _fontHover; - btn->_fontPress = btn->_fontHover; + btn->putFontHover((_fontHover == nullptr) ? _gameRef->getSystemFont() : _fontHover); + btn->putFontPress(btn->getFontHover()); btn->_align = _align; if (_gameRef->_touchInterface) { - btn->_fontHover = btn->getFont(); + btn->putFontHover(btn->getFont()); } diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp index b2e6c3953b..eff1059e1f 100644 --- a/engines/wintermute/ui/ui_button.cpp +++ b/engines/wintermute/ui/ui_button.cpp @@ -1206,4 +1206,16 @@ bool UIButton::persist(BasePersistenceManager *persistMgr) { return STATUS_OK; } +void UIButton::putFontHover(BaseFont *font) { + _fontHover = font; +} + +BaseFont *UIButton::getFontHover() { + return _fontHover; +} + +void UIButton::putFontPress(BaseFont *font) { + _fontPress = font; +} + } // End of namespace Wintermute diff --git a/engines/wintermute/ui/ui_button.h b/engines/wintermute/ui/ui_button.h index 846121e320..2d7cb012dd 100644 --- a/engines/wintermute/ui/ui_button.h +++ b/engines/wintermute/ui/ui_button.h @@ -57,15 +57,16 @@ public: virtual bool scSetProperty(const char *name, ScValue *value) override; virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override; virtual const char *scToString() override; - BaseFont *_fontDisable; - BaseFont *_fontPress; - BaseFont *_fontHover; - BaseFont *_fontFocus; + BaseSprite *_imageHover; BaseSprite *_imagePress; BaseSprite *_imageDisable; BaseSprite *_imageFocus; TTextAlign _align; + + void putFontHover(BaseFont *font); + BaseFont *getFontHover(); + void putFontPress(BaseFont *font); private: bool _pixelPerfect; @@ -78,7 +79,10 @@ private: UITiledImage *_backFocus; bool _press; bool _hover; - + BaseFont *_fontDisable; + BaseFont *_fontPress; + BaseFont *_fontHover; + BaseFont *_fontFocus; }; } // End of namespace Wintermute |