From 2de4a1b5d30e0f182806dc2697c9a3a325571f3a Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Mon, 27 Aug 2018 00:53:47 +0300 Subject: 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. --- engines/wintermute/ad/ad_response_box.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'engines') 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)) { -- cgit v1.2.3