From 583a89be627f300488ea12d8c96c699ff2c684f4 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 15 Jun 2009 20:52:09 +0000 Subject: LOL: - started on the ingame menu code (death menu, load menu and main menu) - fixed regression in kyra gui code (broken menu highlighting) - fixed minor bug in animation code svn-id: r41557 --- engines/kyra/gui_lol.h | 104 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 15 deletions(-) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 631e29bd3b..e80d4af577 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -31,6 +31,48 @@ #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.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.labelX = 0; \ + item.labelY = 0; \ + item.keyCode = g; \ + } while (0) class LoLEngine; class Screen_LoL; @@ -40,14 +82,60 @@ 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) {} 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 clickedDeathMenu(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[7]; + Button _scrollUpButton; + Button _scrollDownButton; + Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _savenameMenu, _deathMenu; + Menu *_currentMenu, *_lastMenu, *_newMenu; + int _menuResult; + LoLEngine *_vm; Screen_LoL *_screen; @@ -59,24 +147,10 @@ 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; 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 -- cgit v1.2.3 From 650f3a50d2acd1962501e9082e946e7ffa13ae13 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 15 Jun 2009 21:39:43 +0000 Subject: LOL: implemented quit menu svn-id: r41560 --- engines/kyra/gui_lol.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index e80d4af577..62f1c5ed9e 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -110,6 +110,7 @@ private: int clickedMainMenu(Button *button); int clickedLoadMenu(Button *button); int clickedDeathMenu(Button *button); + int clickedChoiceMenu(Button *button); int scrollUp(Button *button); int scrollDown(Button *button); -- cgit v1.2.3 From 0b4725d142f56665f9b032e393db1d010b2bde05 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Tue, 16 Jun 2009 21:23:26 +0000 Subject: LOL: implemented options menu (settings aren't saved yet) svn-id: r41596 --- engines/kyra/gui_lol.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 62f1c5ed9e..ef636d0267 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -57,6 +57,7 @@ namespace Kyra { do { \ item.enabled = 1; \ item.itemId = a; \ + item.itemString = 0; \ item.x = b; \ item.y = c; \ item.width = d; \ @@ -69,6 +70,7 @@ namespace Kyra { item.color2 = 227; \ item.saveSlot = 0; \ item.labelId = f; \ + item.labelString = 0; \ item.labelX = 0; \ item.labelY = 0; \ item.keyCode = g; \ @@ -109,6 +111,7 @@ private: int clickedMainMenu(Button *button); int clickedLoadMenu(Button *button); + int clickedOptionsMenu(Button *button); int clickedDeathMenu(Button *button); int clickedChoiceMenu(Button *button); -- cgit v1.2.3 From 66445ae515b7840062e45eb550983d859da17a14 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Fri, 19 Jun 2009 18:46:19 +0000 Subject: LOL: - implemented delete menu - fixed some bugs in the menu code svn-id: r41683 --- engines/kyra/gui_lol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index ef636d0267..8489a2a7fc 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -111,6 +111,8 @@ private: int clickedMainMenu(Button *button); int clickedLoadMenu(Button *button); + int clickedSaveMenu(Button *button); + int clickedDeleteMenu(Button *button); int clickedOptionsMenu(Button *button); int clickedDeathMenu(Button *button); int clickedChoiceMenu(Button *button); @@ -136,7 +138,7 @@ private: Button _menuButtons[7]; Button _scrollUpButton; Button _scrollDownButton; - Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _savenameMenu, _deathMenu; + Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _deleteMenu, _savenameMenu, _deathMenu; Menu *_currentMenu, *_lastMenu, *_newMenu; int _menuResult; -- cgit v1.2.3 From 8d26c58372c9878a26e220c69c76e5500f1f942f Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sat, 20 Jun 2009 14:26:01 +0000 Subject: LOL: implemented save menu svn-id: r41713 --- engines/kyra/gui_lol.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index 8489a2a7fc..da41eebf0c 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -96,7 +96,7 @@ public: int runMenu(Menu &menu); // utilities for thumbnail creation - void createScreenThumbnail(Graphics::Surface &dst) {} + void createScreenThumbnail(Graphics::Surface &dst); private: void backupPage0(); @@ -115,6 +115,7 @@ private: int clickedDeleteMenu(Button *button); int clickedOptionsMenu(Button *button); int clickedDeathMenu(Button *button); + int clickedSavenameMenu(Button *button); int clickedChoiceMenu(Button *button); int scrollUp(Button *button); @@ -141,6 +142,7 @@ private: Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _deleteMenu, _savenameMenu, _deathMenu; Menu *_currentMenu, *_lastMenu, *_newMenu; int _menuResult; + char *_saveDescription; LoLEngine *_vm; Screen_LoL *_screen; -- cgit v1.2.3 From 5b0b0051c15ff23ed8daf801d4b56cbaadf2f101 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Sun, 21 Jun 2009 16:59:51 +0000 Subject: LOL: - implemented audio menu - menu settings now get saved - remove white spaces svn-id: r41729 --- engines/kyra/gui_lol.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/kyra/gui_lol.h') diff --git a/engines/kyra/gui_lol.h b/engines/kyra/gui_lol.h index da41eebf0c..832199f23e 100644 --- a/engines/kyra/gui_lol.h +++ b/engines/kyra/gui_lol.h @@ -114,6 +114,7 @@ private: 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); @@ -125,7 +126,7 @@ private: Button *getScrollUpButton() { return &_scrollUpButton; } Button *getScrollDownButton() { return &_scrollDownButton; } - + Button::Callback getScrollUpButtonHandler() const { return _scrollUpFunctor; } Button::Callback getScrollDownButtonHandler() const { return _scrollDownFunctor; } @@ -136,7 +137,7 @@ private: const char *getMenuItemTitle(const MenuItem &menuItem); const char *getMenuItemLabel(const MenuItem &menuItem); - Button _menuButtons[7]; + Button _menuButtons[10]; Button _scrollUpButton; Button _scrollDownButton; Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _deleteMenu, _savenameMenu, _deathMenu; @@ -156,6 +157,7 @@ private: uint8 _mouseClick; int _savegameOffset; + int _sliderSfx; Button::Callback _scrollUpFunctor; Button::Callback _scrollDownFunctor; -- cgit v1.2.3