diff options
author | lolbot-iichan | 2018-08-27 00:53:47 +0300 |
---|---|---|
committer | Filippos Karapetis | 2020-01-11 18:05:39 +0200 |
commit | 2de4a1b5d30e0f182806dc2697c9a3a325571f3a (patch) | |
tree | 53603059c09770382f06411835f91596b0c20109 /engines | |
parent | 767913d2d5c7e83e715886910a99dba619b3aeb7 (diff) | |
download | scummvm-rg350-2de4a1b5d30e0f182806dc2697c9a3a325571f3a.tar.gz scummvm-rg350-2de4a1b5d30e0f182806dc2697c9a3a325571f3a.tar.bz2 scummvm-rg350-2de4a1b5d30e0f182806dc2697c9a3a325571f3a.zip |
WINTERMUTE: Add FoxTail dialogues UI hack
FoxTail fork of WME seems to have hard-coded modifications for dialogue UI.
Buttons are ignoring hover-font and pressed-font settings.
Buttons also have hard-coded-path scripts attached to them.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/ad/ad_response_box.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engines/wintermute/ad/ad_response_box.cpp b/engines/wintermute/ad/ad_response_box.cpp index fc8e778f37..bd4ae50eab 100644 --- a/engines/wintermute/ad/ad_response_box.cpp +++ b/engines/wintermute/ad/ad_response_box.cpp @@ -29,6 +29,7 @@ #include "engines/wintermute/ad/ad_game.h" #include "engines/wintermute/ad/ad_response.h" #include "engines/wintermute/ad/ad_response_box.h" +#include "engines/wintermute/base/base_engine.h" #include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/base_parser.h" @@ -190,6 +191,18 @@ bool AdResponseBox::createButtons() { btn->setWidth(width); } } + +#ifdef ENABLE_FOXTAIL + if (BaseEngine::instance().isFoxTail()) { + btn->addScript("interface/scripts/dialogue_button.script"); + btn->setWidth(120); + if (_fontHover == nullptr) { + btn->setFontHover(btn->getFont()); + btn->setFontPress(btn->getFontHover()); + } + } +#endif + btn->setName("response"); btn->correctSize(); @@ -500,6 +513,22 @@ bool AdResponseBox::display() { // prepare response buttons bool scrollNeeded = false; for (i = _scrollOffset; i < _respButtons.size(); i++) { + +#ifdef ENABLE_FOXTAIL + // FoxTail's "HORIZONTAL=TRUE" display boxes are actual 2x3 display boxes + // Tests show that this hack was removed in FOXTAIL_1_2_362 + if (_horizontal && BaseEngine::instance().isFoxTail(FOXTAIL_OLDEST_VERSION, FOXTAIL_1_2_304)) { + if (i >= _scrollOffset + 6) { + scrollNeeded = true; + break; + } + _respButtons[i]->setVisible(true); + _respButtons[i]->_posX = 55 + 120 * (i / 3); + _respButtons[i]->_posY = 100 + 10 * (i % 3); + continue; + } +#endif + if ((_horizontal && xxx + _respButtons[i]->getWidth() > rect.right) || (!_horizontal && yyy + _respButtons[i]->getHeight() > rect.bottom)) { |