From 7c74f4f82697570f9627ce1c87eacf7cf7361d31 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Nov 2017 20:24:03 -0500 Subject: XEEN: Create Windows class to hold the windows array --- engines/xeen/dialogs_quests.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'engines/xeen/dialogs_quests.cpp') diff --git a/engines/xeen/dialogs_quests.cpp b/engines/xeen/dialogs_quests.cpp index 0ca9f9d4b5..75b44669c8 100644 --- a/engines/xeen/dialogs_quests.cpp +++ b/engines/xeen/dialogs_quests.cpp @@ -40,6 +40,7 @@ void Quests::execute() { EventsManager &events = *_vm->_events; Party &party = *_vm->_party; Screen &screen = *_vm->_screen; + Windows &windows = *_vm->_windows; Mode oldMode = _vm->_mode; int count = 0; bool headerShown = false; @@ -50,15 +51,15 @@ void Quests::execute() { enum { QUEST_ITEMS, CURRENT_QUESTS, AUTO_NOTES } mode = QUEST_ITEMS; bool windowFlag; - if (screen._windows[29]._enabled) { + if (windows[29]._enabled) { windowFlag = false; } else { - screen._windows[29].open(); - screen._windows[30].open(); + windows[29].open(); + windows[30].open(); windowFlag = true; } - screen._windows[29].writeString(Res.QUESTS_DIALOG_TEXT); + windows[29].writeString(Res.QUESTS_DIALOG_TEXT); drawButtons(&screen); while (!_vm->shouldQuit()) { @@ -102,9 +103,9 @@ void Quests::execute() { } if (count == 0) { - screen._windows[30].writeString(Res.NO_QUEST_ITEMS); + windows[30].writeString(Res.NO_QUEST_ITEMS); } else { - screen._windows[30].writeString(Common::String::format(Res.QUEST_ITEMS_DATA, + windows[30].writeString(Common::String::format(Res.QUEST_ITEMS_DATA, lines[topRow].c_str(), lines[topRow + 1].c_str(), lines[topRow + 2].c_str(), lines[topRow + 3].c_str(), lines[topRow + 4].c_str(), lines[topRow + 5].c_str(), @@ -137,7 +138,7 @@ void Quests::execute() { if (count == 0) lines[1] = Res.NO_CURRENT_QUESTS; - screen._windows[30].writeString(Common::String::format(Res.CURRENT_QUESTS_DATA, + windows[30].writeString(Common::String::format(Res.CURRENT_QUESTS_DATA, lines[topRow].c_str(), lines[topRow + 1].c_str(), lines[topRow + 2].c_str())); break; @@ -164,7 +165,7 @@ void Quests::execute() { if (count == 0) lines[1] = Res.NO_AUTO_NOTES; - screen._windows[30].writeString(Common::String::format(Res.AUTO_NOTES_DATA, + windows[30].writeString(Common::String::format(Res.AUTO_NOTES_DATA, lines[topRow].c_str(), lines[topRow + 1].c_str(), lines[topRow + 2].c_str(), lines[topRow + 3].c_str(), lines[topRow + 4].c_str(), lines[topRow + 5].c_str(), @@ -174,8 +175,8 @@ void Quests::execute() { break; } - screen._windows[30].writeString("\v000\t000"); - screen._windows[24].update(); + windows[30].writeString("\v000\t000"); + windows[24].update(); // Key handling _buttonValue = 0; @@ -226,8 +227,8 @@ void Quests::execute() { } if (windowFlag) { - screen._windows[30].close(); - screen._windows[29].close(); + windows[30].close(); + windows[29].close(); } _vm->_mode = oldMode; } -- cgit v1.2.3