mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 08:40:59 +00:00
NANCY: Set correct default textbox font
Modified the Textbox code so the conversation font is no longer the default, but rather has to be requested by Conversation types. This fixes the nancy6 tutorial having a blue highlighted text while explicitly needing red.
This commit is contained in:
parent
29b8052958
commit
09a21ad755
engines/nancy
@ -169,7 +169,10 @@ void ConversationSound::execute() {
|
||||
case kRun:
|
||||
if (!_hasDrawnTextbox) {
|
||||
_hasDrawnTextbox = true;
|
||||
const TBOX *textboxData = (const TBOX *)g_nancy->getEngineData("TBOX");
|
||||
assert(textboxData);
|
||||
NancySceneState.getTextbox().clear();
|
||||
NancySceneState.getTextbox().setOverrideFont(textboxData->conversationFontID);
|
||||
|
||||
if (ConfMan.getBool("subtitles")) {
|
||||
NancySceneState.getTextbox().addTextLine(_text);
|
||||
|
@ -113,9 +113,6 @@ void TextBoxWrite::readData(Common::SeekableReadStream &stream) {
|
||||
void TextBoxWrite::execute() {
|
||||
auto &tb = NancySceneState.getTextbox();
|
||||
tb.clear();
|
||||
const TBOX *textboxData = (const TBOX *)g_nancy->getEngineData("TBOX");
|
||||
assert(textboxData);
|
||||
tb.overrideFontID(textboxData->defaultFontID);
|
||||
tb.addTextLine(_text);
|
||||
tb.setVisible(true);
|
||||
finishExecution();
|
||||
|
@ -132,7 +132,7 @@ void RiddlePuzzle::execute() {
|
||||
g_nancy->_sound->loadSound(_riddles[_riddleID].sound);
|
||||
g_nancy->_sound->playSound(_riddles[_riddleID].sound);
|
||||
NancySceneState.getTextbox().clear();
|
||||
NancySceneState.getTextbox().overrideFontID(_textboxTextFontID);
|
||||
NancySceneState.getTextbox().setOverrideFont(_textboxTextFontID);
|
||||
NancySceneState.getTextbox().addTextLine(_riddles[_riddleID].text);
|
||||
|
||||
_state = kRun;
|
||||
|
@ -131,7 +131,8 @@ void HypertextParser::drawAllText(const Common::Rect &textBounds, uint fontID, u
|
||||
font = g_nancy->_graphicsManager->getFont(curFontID);
|
||||
highlightFont = g_nancy->_graphicsManager->getFont(highlightFontID);
|
||||
|
||||
// Do word wrapping on the text, sans tokens
|
||||
// Do word wrapping on the text, sans tokens. This assumes
|
||||
// all text uses fonts of the same width
|
||||
Array<Common::String> wrappedLines;
|
||||
font->wordWrap(currentLine, textBounds.width(), wrappedLines, 0);
|
||||
|
||||
|
@ -145,7 +145,7 @@ void Textbox::drawTextbox() {
|
||||
textBounds.right -= tbox->rightOffset;
|
||||
|
||||
HypertextParser::drawAllText( textBounds, // bounds of text within full surface
|
||||
_fontIDOverride != -1 ? _fontIDOverride : tbox->conversationFontID, // font for basic text
|
||||
_fontIDOverride != -1 ? _fontIDOverride : tbox->defaultFontID, // font for basic text
|
||||
tbox->highlightConversationFontID); // font for highlight text
|
||||
|
||||
setVisible(true);
|
||||
@ -172,7 +172,7 @@ void Textbox::addTextLine(const Common::String &text, uint32 autoClearTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void Textbox::overrideFontID(const uint fontID) {
|
||||
void Textbox::setOverrideFont(const uint fontID) {
|
||||
const BSUM *bsum = (const BSUM *)g_nancy->getEngineData("BSUM");
|
||||
assert(bsum);
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
void clear() override;
|
||||
|
||||
void addTextLine(const Common::String &text, uint32 autoClearTime = 0);
|
||||
void overrideFontID(const uint fontID);
|
||||
void setOverrideFont(const uint fontID);
|
||||
|
||||
private:
|
||||
uint16 getInnerHeight() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user