diff options
author | uruk | 2014-03-03 22:38:39 +0100 |
---|---|---|
committer | uruk | 2014-03-03 22:38:39 +0100 |
commit | b19dbace4295fb0e91647352ef450e61faf297e0 (patch) | |
tree | e245809e06ee91ca79846c5907a8a0b33de23853 /engines | |
parent | 7a7bf4f529f127d203a8c8f0be11389fa7b7eaeb (diff) | |
download | scummvm-rg350-b19dbace4295fb0e91647352ef450e61faf297e0.tar.gz scummvm-rg350-b19dbace4295fb0e91647352ef450e61faf297e0.tar.bz2 scummvm-rg350-b19dbace4295fb0e91647352ef450e61faf297e0.zip |
AVALANCHE: Rename Menu to DropDownMenu.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/animation.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/avalanche.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/avalanche.h | 4 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 14 | ||||
-rw-r--r-- | engines/avalanche/background.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/dropdown.cpp (renamed from engines/avalanche/menu.cpp) | 142 | ||||
-rw-r--r-- | engines/avalanche/dropdown.h (renamed from engines/avalanche/menu.h) | 26 | ||||
-rw-r--r-- | engines/avalanche/module.mk | 2 | ||||
-rw-r--r-- | engines/avalanche/parser.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/timer.cpp | 2 |
10 files changed, 106 insertions, 106 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 1ec3dbd4d2..86ca4c8541 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -1205,7 +1205,7 @@ void Animation::drawSprites() { * @remarks Originally called 'trippancy_link' */ void Animation::animLink() { - if (_vm->_menu->isActive() || _vm->_seeScroll) + if (_vm->_dropdown->isActive() || _vm->_seeScroll) return; for (int16 i = 0; i < kSpriteNumbMax; i++) { AnimationType *curSpr = _sprites[i]; @@ -1329,7 +1329,7 @@ void Animation::handleMoveKey(const Common::Event &event) { if (!_vm->_userMovesAvvy) return; - if (_vm->_menu->_activeMenuItem._activeNow) + if (_vm->_dropdown->_activeMenuItem._activeNow) _vm->_parser->tryDropdown(); else { switch (event.kbd.keycode) { diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 27c366914a..3b1ca6026d 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -51,7 +51,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription * _sequence = nullptr; _timer = nullptr; _animation = nullptr; - _menu = nullptr; + _dropdown = nullptr; _closing = nullptr; _sound = nullptr; _nim = nullptr; @@ -76,7 +76,7 @@ AvalancheEngine::~AvalancheEngine() { delete _sequence; delete _timer; delete _animation; - delete _menu; + delete _dropdown; delete _closing; delete _sound; delete _nim; @@ -161,7 +161,7 @@ Common::ErrorCode AvalancheEngine::initialize() { _sequence = new Sequence(this); _timer = new Timer(this); _animation = new Animation(this); - _menu = new Menu(this); + _dropdown = new DropDownMenu(this); _closing = new Closing(this); _sound = new SoundHandler(this); _nim = new Nim(this); @@ -444,7 +444,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _background->release(); minorRedraw(); - _menu->setup(); + _dropdown->setup(); setRoom(kPeopleAvalot, _room); _alive = true; refreshObjectList(); diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index ecaff26766..2012da6a12 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -37,7 +37,7 @@ #include "avalanche/sequence.h" #include "avalanche/timer.h" #include "avalanche/animation.h" -#include "avalanche/menu.h" +#include "avalanche/dropdown.h" #include "avalanche/closing.h" #include "avalanche/sound.h" #include "avalanche/nim.h" @@ -84,7 +84,7 @@ public: Sequence *_sequence; Timer *_timer; Animation *_animation; - Menu *_menu; + DropDownMenu *_dropdown; Closing *_closing; SoundHandler *_sound; Nim *_nim; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 34c5c4aa86..5e530a4266 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -199,7 +199,7 @@ void AvalancheEngine::setup() { _animation->_sprites[0]->_speedX = kWalk; _animation->updateSpeed(); - _menu->init(); + _dropdown->init(); _graphics->drawSoundLight(_sound->_soundFl); @@ -227,7 +227,7 @@ void AvalancheEngine::runAvalot() { updateEvents(); // The event handler. _clock->update(); - _menu->update(); + _dropdown->update(); _background->update(); _animation->animLink(); checkClick(); @@ -488,7 +488,7 @@ void AvalancheEngine::exitRoom(byte x) { * @remarks Originally called 'new_town' */ void AvalancheEngine::enterNewTown() { - _menu->setup(); + _dropdown->setup(); switch (_room) { case kRoomOutsideNottsPub: // Entry into Nottingham. @@ -1104,7 +1104,7 @@ void AvalancheEngine::checkClick() { _graphics->loadMouse(kCurIBeam); //I-beam else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) _graphics->loadMouse(kCurScrewDriver); // screwdriver - else if (!_menu->isActive()) { // Dropdown can handle its own pointers. + else if (!_dropdown->isActive()) { // Dropdown can handle its own pointers. if (_holdLeftMouse) { _graphics->loadMouse(kCurCrosshair); // Mark's crosshairs guideAvvy(cursorPos); // Normally, if you click on the picture, you're guiding Avvy around. @@ -1115,7 +1115,7 @@ void AvalancheEngine::checkClick() { if (_holdLeftMouse) { if ((0 <= cursorPos.y) && (cursorPos.y <= 21)) { // Click on the dropdown menu. if (_dropsOk) - _menu->update(); + _dropdown->update(); } else if ((317 <= cursorPos.y) && (cursorPos.y <= 339)) { // Click on the command line. _parser->_inputTextPos = (cursorPos.x - 23) / 8; if (_parser->_inputTextPos > _parser->_inputText.size() + 1) @@ -1397,7 +1397,7 @@ void AvalancheEngine::resetAllVariables() { _animation->resetVariables(); _sequence->resetVariables(); _background->resetVariables(); - _menu->resetVariables(); + _dropdown->resetVariables(); _timer->resetVariables(); } @@ -1448,7 +1448,7 @@ void AvalancheEngine::newGame() { enterRoom(kRoomYours, 1); avvy->_visible = false; drawScore(); - _menu->setup(); + _dropdown->setup(); _clock->update(); spriteRun(); } diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp index e5b66c509b..c3d6ac3481 100644 --- a/engines/avalanche/background.cpp +++ b/engines/avalanche/background.cpp @@ -48,7 +48,7 @@ Background::~Background() { * @remarks Originally called 'pics_link' */ void Background::update() { - if (_vm->_menu->isActive()) + if (_vm->_dropdown->isActive()) return; // No animation when the menus are up. switch (_vm->_room) { diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/dropdown.cpp index a4cecc5da5..0bc1f7eb8b 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/dropdown.cpp @@ -28,42 +28,42 @@ /* Original name: DROPDOWN A customized version of Oopmenu (qv). */ #include "avalanche/avalanche.h" -#include "avalanche/menu.h" +#include "avalanche/dropdown.h" namespace Avalanche { -void HeadType::init(char trig, char altTrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *menu) { +void HeadType::init(char trig, char altTrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, DropDownMenu *menu) { _trigger = trig; _altTrigger = altTrig; _title = title; _position = pos; - _xpos = _position * _menu->kSpacing + _menu->kIndent; - _xright = (_position + 1) * _menu->kSpacing + _menu->kIndent; + _xpos = _position * _dropdown->kSpacing + _dropdown->kIndent; + _xright = (_position + 1) * _dropdown->kSpacing + _dropdown->kIndent; _setupFunc = setupFunc; _chooseFunc = chooseFunc; - _menu = menu; + _dropdown = menu; } void HeadType::draw() { CursorMan.showMouse(false); - _menu->drawMenuText(_xpos, 1, _trigger, _title, true, false); + _dropdown->drawMenuText(_xpos, 1, _trigger, _title, true, false); CursorMan.showMouse(true); } void HeadType::highlight() { CursorMan.showMouse(false); - _menu->_vm->_sound->stopSound(); - _menu->drawMenuText(_xpos, 1, _trigger, _title, true, true); + _dropdown->_vm->_sound->stopSound(); + _dropdown->drawMenuText(_xpos, 1, _trigger, _title, true, true); - _menu->_activeMenuItem._left = _xpos; - _menu->_activeMenuItem._activeNow = true; - _menu->_activeMenuItem._activeNum = _position; - _menu->_menuActive = true; + _dropdown->_activeMenuItem._left = _xpos; + _dropdown->_activeMenuItem._activeNow = true; + _dropdown->_activeMenuItem._activeNum = _position; + _dropdown->_menuActive = true; // Force reload and redraw of cursor. - _menu->_vm->_currentMouse = 177; + _dropdown->_vm->_currentMouse = 177; } @@ -73,12 +73,12 @@ bool HeadType::parseAltTrigger(char key) { return false; } -void MenuItem::init(Menu *menu) { - _menu = menu; +void MenuItem::init(DropDownMenu *menu) { + _dropdown = menu; _activeNow = false; _activeNum = 1; - _menu->_menuActive = false; + _dropdown->_menuActive = false; } void MenuItem::reset() { @@ -113,8 +113,8 @@ void MenuItem::displayOption(byte y, bool highlit) { else backgroundColor = kColorLightgray; - _menu->_vm->_graphics->drawMenuBlock((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10, backgroundColor); - _menu->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit); + _dropdown->_vm->_graphics->drawMenuBlock((_flx1 + 1) * 8, 3 + (y + 1) * 10, (_flx2 + 1) * 8, 13 + (y + 1) * 10, backgroundColor); + _dropdown->drawMenuText(_left, 4 + (y + 1) * 10, _options[y]._trigger, text, _options[y]._valid, highlit); } void MenuItem::display() { @@ -125,15 +125,15 @@ void MenuItem::display() { _flx2 = _left + _width; _fly = 15 + _optionNum * 10; _activeNow = true; - _menu->_menuActive = true; + _dropdown->_menuActive = true; - _menu->_vm->_graphics->drawMenuItem((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly); + _dropdown->_vm->_graphics->drawMenuItem((_flx1 + 1) * 8, 12, (_flx2 + 1) * 8, _fly); displayOption(0, true); for (int y = 1; y < _optionNum; y++) displayOption(y, false); - _menu->_vm->_currentMouse = 177; + _dropdown->_vm->_currentMouse = 177; CursorMan.showMouse(true); // 4 = fletch } @@ -141,12 +141,12 @@ void MenuItem::display() { void MenuItem::wipe() { CursorMan.showMouse(false); - _menu->drawMenuText(_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._xpos, 1, - _menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._trigger, - _menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._title, true, false); + _dropdown->drawMenuText(_dropdown->_menuBar._menuItems[_dropdown->_activeMenuItem._activeNum]._xpos, 1, + _dropdown->_menuBar._menuItems[_dropdown->_activeMenuItem._activeNum]._trigger, + _dropdown->_menuBar._menuItems[_dropdown->_activeMenuItem._activeNum]._title, true, false); _activeNow = false; - _menu->_menuActive = false; + _dropdown->_menuActive = false; _firstlix = false; CursorMan.showMouse(true); @@ -191,7 +191,7 @@ void MenuItem::select(byte which) { if (_choiceNum > _optionNum) _choiceNum = 0; // Off the top, I suppose. - (_menu->*_menu->_menuBar._menuItems[_activeNum]._chooseFunc)(); + (_dropdown->*_dropdown->_menuBar._menuItems[_activeNum]._chooseFunc)(); } void MenuItem::parseKey(char c) { @@ -204,34 +204,34 @@ void MenuItem::parseKey(char c) { } } if (!found) - _menu->_vm->_sound->blip(); + _dropdown->_vm->_sound->blip(); } MenuBar::MenuBar() { _menuNum = 0; - _menu = nullptr; + _dropdown = nullptr; } -void MenuBar::init(Menu *menu) { - _menu = menu; +void MenuBar::init(DropDownMenu *menu) { + _dropdown = menu; _menuNum = 0; } void MenuBar::createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc) { - _menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _menu); + _menuItems[_menuNum].init(trig, altTrig, title, _menuNum, setupFunc, chooseFunc, _dropdown); _menuNum++; } void MenuBar::draw() { - _menu->_vm->_graphics->drawMenuBar(kMenuBackgroundColor); + _dropdown->_vm->_graphics->drawMenuBar(kMenuBackgroundColor); - byte savecp = _menu->_vm->_cp; - _menu->_vm->_cp = 3; + byte savecp = _dropdown->_vm->_cp; + _dropdown->_vm->_cp = 3; for (int i = 0; i < _menuNum; i++) _menuItems[i].draw(); - _menu->_vm->_cp = savecp; + _dropdown->_vm->_cp = savecp; } void MenuBar::parseAltTrigger(char c) { @@ -244,13 +244,13 @@ void MenuBar::parseAltTrigger(char c) { } void MenuBar::setupMenuItem(byte which) { - if (_menu->_activeMenuItem._activeNow) { - _menu->_activeMenuItem.wipe(); // Get rid of menu. - if (_menu->_activeMenuItem._activeNum == _menuItems[which]._position) + if (_dropdown->_activeMenuItem._activeNow) { + _dropdown->_activeMenuItem.wipe(); // Get rid of menu. + if (_dropdown->_activeMenuItem._activeNum == _menuItems[which]._position) return; // Clicked on own highlight. } _menuItems[which].highlight(); - (_menu->*_menuItems[which]._setupFunc)(); + (_dropdown->*_menuItems[which]._setupFunc)(); } void MenuBar::chooseMenuItem(int16 x) { @@ -262,7 +262,7 @@ void MenuBar::chooseMenuItem(int16 x) { } } -Menu::Menu(AvalancheEngine *vm) { +DropDownMenu::DropDownMenu(AvalancheEngine *vm) { _vm = vm; _activeMenuItem.init(this); _menuBar.init(this); @@ -271,7 +271,7 @@ Menu::Menu(AvalancheEngine *vm) { _lastPerson = kPeopleNone; } -void Menu::findWhatYouCanDoWithIt() { +void DropDownMenu::findWhatYouCanDoWithIt() { switch (_vm->_thinks) { case kObjectWine: case kObjectPotion: @@ -299,7 +299,7 @@ void Menu::findWhatYouCanDoWithIt() { } } -void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) { +void DropDownMenu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, bool valid, bool highlighted) { Color fontColor; Color backgroundColor; if (highlighted) { @@ -342,11 +342,11 @@ void Menu::drawMenuText(int16 x, int16 y, char trigger, Common::String text, boo _vm->_graphics->refreshScreen(); } -void Menu::bleep() { +void DropDownMenu::bleep() { _vm->_sound->playNote(177, 7); } -void Menu::parseKey(char r, char re) { +void DropDownMenu::parseKey(char r, char re) { #if 0 switch (r) { case 0: @@ -395,14 +395,14 @@ void Menu::parseKey(char r, char re) { warning("STUB: Dropdown::parseKey()"); // To be implemented properly later! Don't remove the comment above! } -Common::String Menu::selectGender(byte x) { +Common::String DropDownMenu::selectGender(byte x) { if (x < 175) return "im"; else return "er"; } -void Menu::setupMenuGame() { +void DropDownMenu::setupMenuGame() { _activeMenuItem.reset(); _activeMenuItem.setupOption("Help...", 'H', "f1", true); _activeMenuItem.setupOption("Boss Key", 'B', "alt-B", false); @@ -412,7 +412,7 @@ void Menu::setupMenuGame() { _activeMenuItem.display(); } -void Menu::setupMenuFile() { +void DropDownMenu::setupMenuFile() { _activeMenuItem.reset(); _activeMenuItem.setupOption("New game", 'N', "f4", true); _activeMenuItem.setupOption("Load...", 'L', "^f3", true); @@ -423,7 +423,7 @@ void Menu::setupMenuFile() { _activeMenuItem.display(); } -void Menu::setupMenuAction() { +void DropDownMenu::setupMenuAction() { _activeMenuItem.reset(); Common::String f5Does = _vm->f5Does(); @@ -449,7 +449,7 @@ void Menu::setupMenuAction() { _activeMenuItem.display(); } -void Menu::setupMenuPeople() { +void DropDownMenu::setupMenuPeople() { if (!people.empty()) people.clear(); @@ -465,7 +465,7 @@ void Menu::setupMenuPeople() { _activeMenuItem.display(); } -void Menu::setupMenuObjects() { +void DropDownMenu::setupMenuObjects() { _activeMenuItem.reset(); for (int i = 0; i < kObjectNum; i++) { if (_vm->_objects[i]) @@ -474,7 +474,7 @@ void Menu::setupMenuObjects() { _activeMenuItem.display(); } -void Menu::setupMenuWith() { +void DropDownMenu::setupMenuWith() { _activeMenuItem.reset(); if (_vm->_thinkThing) { @@ -531,7 +531,7 @@ void Menu::setupMenuWith() { _activeMenuItem.display(); } -void Menu::runMenuGame() { +void DropDownMenu::runMenuGame() { // Help, boss, untrash screen. switch (_activeMenuItem._choiceNum) { case 0: @@ -552,7 +552,7 @@ void Menu::runMenuGame() { } } -void Menu::runMenuFile() { +void DropDownMenu::runMenuFile() { // New game, load, save, save as, DOS shell, about, quit. switch (_activeMenuItem._choiceNum) { case 0: @@ -579,7 +579,7 @@ void Menu::runMenuFile() { } } -void Menu::runMenuAction() { +void DropDownMenu::runMenuAction() { // Get up, pause game, open door, look, inventory, walk/run. switch (_activeMenuItem._choiceNum) { case 0: { @@ -616,16 +616,16 @@ void Menu::runMenuAction() { } } -void Menu::runMenuObjects() { +void DropDownMenu::runMenuObjects() { _vm->thinkAbout(_vm->_objectList[_activeMenuItem._choiceNum], AvalancheEngine::kThing); } -void Menu::runMenuPeople() { +void DropDownMenu::runMenuPeople() { _vm->thinkAbout(people[_activeMenuItem._choiceNum], AvalancheEngine::kPerson); _lastPerson = (People)people[_activeMenuItem._choiceNum]; } -void Menu::runMenuWith() { +void DropDownMenu::runMenuWith() { _vm->_parser->_thing = _vm->_thinks; if (_vm->_thinkThing) { @@ -664,21 +664,21 @@ void Menu::runMenuWith() { _vm->callVerb((VerbCode)(byte)_verbStr[_activeMenuItem._choiceNum]); } -void Menu::setup() { +void DropDownMenu::setup() { _menuBar.init(this); _activeMenuItem.init(this); - _menuBar.createMenuItem('F', "File", '!', &Avalanche::Menu::setupMenuFile, &Avalanche::Menu::runMenuFile); - _menuBar.createMenuItem('G', "Game", 34, &Avalanche::Menu::setupMenuGame, &Avalanche::Menu::runMenuGame); - _menuBar.createMenuItem('A', "Action", 30, &Avalanche::Menu::setupMenuAction, &Avalanche::Menu::runMenuAction); - _menuBar.createMenuItem('O', "Objects", 24, &Avalanche::Menu::setupMenuObjects, &Avalanche::Menu::runMenuObjects); - _menuBar.createMenuItem('P', "People", 25, &Avalanche::Menu::setupMenuPeople, &Avalanche::Menu::runMenuPeople); - _menuBar.createMenuItem('W', "With", 17, &Avalanche::Menu::setupMenuWith, &Avalanche::Menu::runMenuWith); + _menuBar.createMenuItem('F', "File", '!', &Avalanche::DropDownMenu::setupMenuFile, &Avalanche::DropDownMenu::runMenuFile); + _menuBar.createMenuItem('G', "Game", 34, &Avalanche::DropDownMenu::setupMenuGame, &Avalanche::DropDownMenu::runMenuGame); + _menuBar.createMenuItem('A', "Action", 30, &Avalanche::DropDownMenu::setupMenuAction, &Avalanche::DropDownMenu::runMenuAction); + _menuBar.createMenuItem('O', "Objects", 24, &Avalanche::DropDownMenu::setupMenuObjects, &Avalanche::DropDownMenu::runMenuObjects); + _menuBar.createMenuItem('P', "People", 25, &Avalanche::DropDownMenu::setupMenuPeople, &Avalanche::DropDownMenu::runMenuPeople); + _menuBar.createMenuItem('W', "With", 17, &Avalanche::DropDownMenu::setupMenuWith, &Avalanche::DropDownMenu::runMenuWith); _menuBar.draw(); } -void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it... +void DropDownMenu::update() { // TODO: Optimize it ASAP!!! It really needs it... _vm->_graphics->saveScreen(); Common::Point cursorPos = _vm->getMousePos(); @@ -769,7 +769,7 @@ void Menu::update() { // TODO: Optimize it ASAP!!! It really needs it... _vm->_graphics->removeBackup(); } -char Menu::getThingChar(byte which) { +char DropDownMenu::getThingChar(byte which) { static const char thingsChar[] = "WMBParCLguKeSnIohn"; // V=Vinegar char result; @@ -786,7 +786,7 @@ char Menu::getThingChar(byte which) { return result; } -byte Menu::getNameChar(People whose) { +byte DropDownMenu::getNameChar(People whose) { static const char ladChar[] = "ASCDMTRwLfgeIyPu"; static const char lassChar[] = "kG\0xB1o"; @@ -798,7 +798,7 @@ byte Menu::getNameChar(People whose) { error("getName() - Unexpected character id %d", (byte) whose); } -Common::String Menu::getThing(byte which) { +Common::String DropDownMenu::getThing(byte which) { static const char things[kObjectNum][20] = { "Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt", "Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key", @@ -830,15 +830,15 @@ Common::String Menu::getThing(byte which) { return result; } -bool Menu::isActive() { +bool DropDownMenu::isActive() { return _menuActive; } -void Menu::init() { +void DropDownMenu::init() { _menuActive = false; } -void Menu::resetVariables() { +void DropDownMenu::resetVariables() { _lastPerson = kPeoplePardon; } } // End of namespace Avalanche. diff --git a/engines/avalanche/menu.h b/engines/avalanche/dropdown.h index f4833d31c4..417b775c3d 100644 --- a/engines/avalanche/menu.h +++ b/engines/avalanche/dropdown.h @@ -27,17 +27,17 @@ /* Original name: DROPDOWN A customized version of Oopmenu (qv). */ -#ifndef AVALANCHE_MENU_H -#define AVALANCHE_MENU_H +#ifndef AVALANCHE_DROPDOWN_H +#define AVALANCHE_DROPDOWN_H #include "common/str.h" namespace Avalanche { class AvalancheEngine; -class Menu; +class DropDownMenu; -typedef void (Menu::*MenuFunc)(); +typedef void (DropDownMenu::*MenuFunc)(); static const Color kMenuBackgroundColor = kColorLightgray; static const Color kMenuBorderColor = kColorBlack; @@ -49,13 +49,13 @@ public: int16 _xpos, _xright; MenuFunc _setupFunc, _chooseFunc; - void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, Menu *menu); + void init(char trig, char alTtrig, Common::String title, byte pos, MenuFunc setupFunc, MenuFunc chooseFunc, DropDownMenu *menu); void draw(); void highlight(); bool parseAltTrigger(char key); private: - Menu *_menu; + DropDownMenu *_dropdown; }; struct OptionType { @@ -75,7 +75,7 @@ public: byte _activeNum; // And if so, which is it? byte _choiceNum; // Your choice? - void init(Menu *menu); + void init(DropDownMenu *menu); void reset(); void setupOption(Common::String title, char trigger, Common::String shortcut, bool valid); void display(); @@ -88,7 +88,7 @@ private: byte _optionNum; byte _highlightNum; - Menu *_menu; + DropDownMenu *_dropdown; void displayOption(byte y, bool highlit); void moveHighlight(int8 inc); @@ -103,20 +103,20 @@ public: byte _menuNum; MenuBar(); - void init(Menu *menu); + void init(DropDownMenu *menu); void createMenuItem(char trig, Common::String title, char altTrig, MenuFunc setupFunc, MenuFunc chooseFunc); void draw(); void chooseMenuItem(int16 x); private: - Menu *_menu; + DropDownMenu *_dropdown; void setupMenuItem(byte which); // CHECKME: Useless function void parseAltTrigger(char c); }; -class Menu { +class DropDownMenu { public: friend class HeadType; friend class MenuItem; @@ -125,7 +125,7 @@ public: MenuItem _activeMenuItem; MenuBar _menuBar; - Menu(AvalancheEngine *vm); + DropDownMenu(AvalancheEngine *vm); void update(); void setup(); // Standard menu bar. @@ -179,4 +179,4 @@ private: } // End of namespace Avalanche. -#endif // AVALANCHE_MENU_H +#endif // AVALANCHE_DROPDOWN_H diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk index eb95e32585..16ad5d944c 100644 --- a/engines/avalanche/module.mk +++ b/engines/avalanche/module.mk @@ -9,7 +9,7 @@ MODULE_OBJS = \ console.o \ detection.o \ graphics.o \ - menu.o \ + dropdown.o \ parser.o \ dialogs.o \ sequence.o \ diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 01067af7ca..44e8dde9ae 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -381,8 +381,8 @@ void Parser::init() { void Parser::handleInputText(const Common::Event &event) { byte inChar = event.kbd.ascii; warning("STUB: Parser::handleInputText()"); -// if (_vm->_menu->_activeMenuItem._activeNow) { -// _vm->_menu->parseKey(inChar, _vm->_enhanced->extd); +// if (_vm->_dropdown->_activeMenuItem._activeNow) { +// _vm->_dropdown->parseKey(inChar, _vm->_enhanced->extd); // } else { if (_inputText.size() < 76) { if ((inChar == '"') || (inChar == '`')) { @@ -402,7 +402,7 @@ void Parser::handleInputText(const Common::Event &event) { } void Parser::handleBackspace() { - if (_vm->_menu->_activeMenuItem._activeNow) + if (_vm->_dropdown->_activeMenuItem._activeNow) return; if (_inputTextPos > 0) { @@ -416,7 +416,7 @@ void Parser::handleBackspace() { } void Parser::handleReturn() { - if (_vm->_menu->_activeMenuItem._activeNow) + if (_vm->_dropdown->_activeMenuItem._activeNow) tryDropdown(); else if (!_inputText.empty()) { _inputTextBackup = _inputText; diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index 69e0d84b3c..c361203886 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -64,7 +64,7 @@ void Timer::addTimer(int32 duration, byte action, byte reason) { * @remarks Originally called 'one_tick' */ void Timer::updateTimer() { - if (_vm->_menu->isActive()) + if (_vm->_dropdown->isActive()) return; for (int i = 0; i < 7; i++) { |