aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs_quests.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-11-29 20:24:03 -0500
committerPaul Gilbert2017-11-29 20:24:03 -0500
commit7c74f4f82697570f9627ce1c87eacf7cf7361d31 (patch)
tree31877c0e928163535bacf1c8af03d30b2da02b08 /engines/xeen/dialogs_quests.cpp
parent0a4d3a15c47118a34a47befc9bce19b6ed53fd8d (diff)
downloadscummvm-rg350-7c74f4f82697570f9627ce1c87eacf7cf7361d31.tar.gz
scummvm-rg350-7c74f4f82697570f9627ce1c87eacf7cf7361d31.tar.bz2
scummvm-rg350-7c74f4f82697570f9627ce1c87eacf7cf7361d31.zip
XEEN: Create Windows class to hold the windows array
Diffstat (limited to 'engines/xeen/dialogs_quests.cpp')
-rw-r--r--engines/xeen/dialogs_quests.cpp25
1 files changed, 13 insertions, 12 deletions
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;
}