diff options
Diffstat (limited to 'engines/kyra/gui_lol.h')
-rw-r--r-- | engines/kyra/gui_lol.h | 116 |
1 files changed, 100 insertions, 16 deletions
diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 631e29bd3b..832199f23e 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -31,6 +31,50 @@ #include "kyra/gui.h" namespace Kyra { +#define GUI_LOL_MENU(menu, a, b, c, d, e, f, g, i) \ + do { \ + const ScreenDim *dim = _screen->getScreenDim(a); \ + menu.x = (dim->sx << 3); \ + menu.y = (dim->sy); \ + menu.width = (dim->w << 3); \ + menu.height = (dim->h); \ + menu.bkgdColor = 225; \ + menu.color1 = 223; \ + menu.color2 = 227; \ + menu.menuNameId = b; \ + menu.highlightedItem = c; \ + menu.numberOfItems = d; \ + menu.titleX = (dim->sx << 3) + (dim->w << 2); \ + menu.titleY = 6; \ + menu.textColor = 254; \ + menu.scrollUpButtonX = e; \ + menu.scrollUpButtonY = f; \ + menu.scrollDownButtonX = g; \ + menu.scrollDownButtonY = i; \ + } while (0) + + #define GUI_LOL_MENU_ITEM(item, a, b, c, d, e, f, g) \ + do { \ + item.enabled = 1; \ + item.itemId = a; \ + item.itemString = 0; \ + item.x = b; \ + item.y = c; \ + item.width = d; \ + item.height = e; \ + item.textColor = 204; \ + item.highlightColor = 254; \ + item.titleX = -1; \ + item.bkgdColor = 225; \ + item.color1 = 223; \ + item.color2 = 227; \ + item.saveSlot = 0; \ + item.labelId = f; \ + item.labelString = 0; \ + item.labelX = 0; \ + item.labelY = 0; \ + item.keyCode = g; \ + } while (0) class LoLEngine; class Screen_LoL; @@ -40,14 +84,67 @@ class GUI_LoL : public GUI { public: GUI_LoL(LoLEngine *vm); + void initStaticData(); + // button specific void processButton(Button *button); int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel); + int redrawShadedButtonCallback(Button *button); + int redrawButtonCallback(Button *button); + + int runMenu(Menu &menu); + // utilities for thumbnail creation - void createScreenThumbnail(Graphics::Surface &dst) {} + void createScreenThumbnail(Graphics::Surface &dst); private: + void backupPage0(); + void restorePage0(); + + void setupSavegameNames(Menu &menu, int num); + + void printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 flags, Screen::FontId font=Screen::FID_9_FNT); + int getMenuCenterStringX(const char *str, int x1, int x2); + + int getInput(); + + int clickedMainMenu(Button *button); + int clickedLoadMenu(Button *button); + int clickedSaveMenu(Button *button); + int clickedDeleteMenu(Button *button); + int clickedOptionsMenu(Button *button); + int clickedAudioMenu(Button *button); + int clickedDeathMenu(Button *button); + int clickedSavenameMenu(Button *button); + int clickedChoiceMenu(Button *button); + + int scrollUp(Button *button); + int scrollDown(Button *button); + + Button *getButtonListData() { return _menuButtons; } + Button *getScrollUpButton() { return &_scrollUpButton; } + Button *getScrollDownButton() { return &_scrollDownButton; } + + + Button::Callback getScrollUpButtonHandler() const { return _scrollUpFunctor; } + Button::Callback getScrollDownButtonHandler() const { return _scrollDownFunctor; } + + uint8 defaultColor1() const { return 0xFE; } + uint8 defaultColor2() const { return 0x00; } + + const char *getMenuTitle(const Menu &menu); + const char *getMenuItemTitle(const MenuItem &menuItem); + const char *getMenuItemLabel(const MenuItem &menuItem); + + Button _menuButtons[10]; + Button _scrollUpButton; + Button _scrollDownButton; + Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _deleteMenu, _savenameMenu, _deathMenu; + Menu *_currentMenu, *_lastMenu, *_newMenu; + int _menuResult; + char *_saveDescription; + LoLEngine *_vm; Screen_LoL *_screen; @@ -59,24 +156,11 @@ private: uint16 _flagsModifier; uint8 _mouseClick; - int scrollUp(Button *button) { return 0; } - int scrollDown(Button *button) { return 0; } - - Button *getButtonListData() { return 0; } - Button *getScrollUpButton() { return 0; } - Button *getScrollDownButton() { return 0; } + int _savegameOffset; + int _sliderSfx; Button::Callback _scrollUpFunctor; Button::Callback _scrollDownFunctor; - Button::Callback getScrollUpButtonHandler() const { return _scrollUpFunctor; } - Button::Callback getScrollDownButtonHandler() const { return _scrollDownFunctor; } - - uint8 defaultColor1() const { return 0; } - uint8 defaultColor2() const { return 0; } - - const char *getMenuTitle(const Menu &menu) { return 0; } - const char *getMenuItemTitle(const MenuItem &menuItem) { return 0; } - const char *getMenuItemLabel(const MenuItem &menuItem) { return 0; } }; } // end of namespace Kyra |