2009-02-01 19:27:01 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-03-04 11:53:25 +00:00
|
|
|
#ifdef ENABLE_LOL
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
#ifndef KYRA_GUI_LOL_H
|
|
|
|
#define KYRA_GUI_LOL_H
|
|
|
|
|
|
|
|
#include "kyra/gui.h"
|
|
|
|
|
|
|
|
namespace Kyra {
|
2009-06-15 20:52:09 +00:00
|
|
|
#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); \
|
2009-09-26 21:17:47 +00:00
|
|
|
if (_vm->gameFlags().use16ColorMode) { \
|
|
|
|
menu.bkgdColor = 0xcc; \
|
|
|
|
menu.color1 = 0xff; \
|
|
|
|
menu.color2 = 0xdd; \
|
|
|
|
} else { \
|
2009-06-15 20:52:09 +00:00
|
|
|
menu.bkgdColor = 225; \
|
|
|
|
menu.color1 = 223; \
|
|
|
|
menu.color2 = 227; \
|
2009-09-26 21:17:47 +00:00
|
|
|
} \
|
2009-06-15 20:52:09 +00:00
|
|
|
menu.menuNameId = b; \
|
|
|
|
menu.highlightedItem = c; \
|
|
|
|
menu.numberOfItems = d; \
|
|
|
|
menu.titleX = (dim->sx << 3) + (dim->w << 2); \
|
|
|
|
menu.titleY = 6; \
|
2009-09-26 21:17:47 +00:00
|
|
|
menu.textColor = _vm->gameFlags().use16ColorMode ? 0xe1 : 254; \
|
2009-06-15 20:52:09 +00:00
|
|
|
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; \
|
2009-06-16 21:23:26 +00:00
|
|
|
item.itemString = 0; \
|
2009-06-15 20:52:09 +00:00
|
|
|
item.x = b; \
|
|
|
|
item.y = c; \
|
|
|
|
item.width = d; \
|
|
|
|
item.height = e; \
|
2009-12-01 19:19:58 +00:00
|
|
|
item.textColor = _vm->gameFlags().use16ColorMode ? 0xc1 : 204; \
|
2009-09-26 21:17:47 +00:00
|
|
|
item.highlightColor = _vm->gameFlags().use16ColorMode ? 0xe1 : 254; \
|
2009-06-15 20:52:09 +00:00
|
|
|
item.titleX = -1; \
|
2009-09-26 21:17:47 +00:00
|
|
|
if (_vm->gameFlags().use16ColorMode) { \
|
|
|
|
item.bkgdColor = 0xcc; \
|
|
|
|
item.color1 = 0xff; \
|
|
|
|
item.color2 = 0xdd; \
|
|
|
|
} else { \
|
2009-06-15 20:52:09 +00:00
|
|
|
item.bkgdColor = 225; \
|
|
|
|
item.color1 = 223; \
|
|
|
|
item.color2 = 227; \
|
2009-09-26 21:17:47 +00:00
|
|
|
} \
|
2009-06-15 20:52:09 +00:00
|
|
|
item.saveSlot = 0; \
|
|
|
|
item.labelId = f; \
|
2009-06-16 21:23:26 +00:00
|
|
|
item.labelString = 0; \
|
2009-06-15 20:52:09 +00:00
|
|
|
item.labelX = 0; \
|
|
|
|
item.labelY = 0; \
|
|
|
|
item.keyCode = g; \
|
|
|
|
} while (0)
|
2009-02-01 19:27:01 +00:00
|
|
|
|
|
|
|
class LoLEngine;
|
|
|
|
class Screen_LoL;
|
|
|
|
|
|
|
|
class GUI_LoL : public GUI {
|
|
|
|
friend class LoLEngine;
|
|
|
|
public:
|
|
|
|
GUI_LoL(LoLEngine *vm);
|
|
|
|
|
2009-06-15 20:52:09 +00:00
|
|
|
void initStaticData();
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// button specific
|
2009-02-15 03:36:30 +00:00
|
|
|
void processButton(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel);
|
|
|
|
|
2009-06-15 20:52:09 +00:00
|
|
|
int redrawShadedButtonCallback(Button *button);
|
|
|
|
int redrawButtonCallback(Button *button);
|
|
|
|
|
|
|
|
int runMenu(Menu &menu);
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// utilities for thumbnail creation
|
2009-06-20 14:26:01 +00:00
|
|
|
void createScreenThumbnail(Graphics::Surface &dst);
|
2009-02-01 19:27:01 +00:00
|
|
|
|
|
|
|
private:
|
2009-06-15 20:52:09 +00:00
|
|
|
void backupPage0();
|
|
|
|
void restorePage0();
|
|
|
|
|
2010-01-24 15:40:36 +00:00
|
|
|
void setupSaveMenuSlots(Menu &menu, int num);
|
|
|
|
void updateSavegameList();
|
2009-06-15 20:52:09 +00:00
|
|
|
|
2009-10-11 11:30:24 +00:00
|
|
|
void printMenuText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 flags);
|
2009-06-15 20:52:09 +00:00
|
|
|
int getMenuCenterStringX(const char *str, int x1, int x2);
|
|
|
|
|
|
|
|
int getInput();
|
|
|
|
|
|
|
|
int clickedMainMenu(Button *button);
|
|
|
|
int clickedLoadMenu(Button *button);
|
2009-06-19 18:46:19 +00:00
|
|
|
int clickedSaveMenu(Button *button);
|
|
|
|
int clickedDeleteMenu(Button *button);
|
2009-06-16 21:23:26 +00:00
|
|
|
int clickedOptionsMenu(Button *button);
|
2009-06-21 16:59:51 +00:00
|
|
|
int clickedAudioMenu(Button *button);
|
2009-06-15 20:52:09 +00:00
|
|
|
int clickedDeathMenu(Button *button);
|
2009-06-20 14:26:01 +00:00
|
|
|
int clickedSavenameMenu(Button *button);
|
2009-06-15 21:39:43 +00:00
|
|
|
int clickedChoiceMenu(Button *button);
|
2009-06-15 20:52:09 +00:00
|
|
|
|
|
|
|
int scrollUp(Button *button);
|
|
|
|
int scrollDown(Button *button);
|
|
|
|
|
|
|
|
Button *getButtonListData() { return _menuButtons; }
|
|
|
|
Button *getScrollUpButton() { return &_scrollUpButton; }
|
|
|
|
Button *getScrollDownButton() { return &_scrollDownButton; }
|
|
|
|
|
2009-06-21 16:59:51 +00:00
|
|
|
|
2009-06-15 20:52:09 +00:00
|
|
|
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);
|
|
|
|
|
2009-06-21 16:59:51 +00:00
|
|
|
Button _menuButtons[10];
|
2009-06-15 20:52:09 +00:00
|
|
|
Button _scrollUpButton;
|
|
|
|
Button _scrollDownButton;
|
2009-06-19 18:46:19 +00:00
|
|
|
Menu _mainMenu, _gameOptions, _audioOptions, _choiceMenu, _loadMenu, _saveMenu, _deleteMenu, _savenameMenu, _deathMenu;
|
2009-06-15 20:52:09 +00:00
|
|
|
Menu *_currentMenu, *_lastMenu, *_newMenu;
|
|
|
|
int _menuResult;
|
2009-06-20 14:26:01 +00:00
|
|
|
char *_saveDescription;
|
2009-06-15 20:52:09 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
LoLEngine *_vm;
|
|
|
|
Screen_LoL *_screen;
|
|
|
|
|
|
|
|
bool _pressFlag;
|
|
|
|
|
2009-05-23 01:15:20 +00:00
|
|
|
Button *_specialProcessButton;
|
2009-02-15 03:36:30 +00:00
|
|
|
Button *_backUpButtonList;
|
|
|
|
bool _buttonListChanged;
|
|
|
|
uint16 _flagsModifier;
|
2009-05-28 23:49:41 +00:00
|
|
|
uint8 _mouseClick;
|
2009-02-15 03:36:30 +00:00
|
|
|
|
2009-06-15 20:52:09 +00:00
|
|
|
int _savegameOffset;
|
2009-06-21 16:59:51 +00:00
|
|
|
int _sliderSfx;
|
2009-02-01 19:27:01 +00:00
|
|
|
|
|
|
|
Button::Callback _scrollUpFunctor;
|
|
|
|
Button::Callback _scrollDownFunctor;
|
2010-01-24 15:40:36 +00:00
|
|
|
|
|
|
|
char **_savegameList;
|
|
|
|
int _savegameListSize;
|
|
|
|
bool _savegameListUpdateNeeded;
|
2009-02-01 19:27:01 +00:00
|
|
|
};
|
|
|
|
|
2009-10-04 21:26:33 +00:00
|
|
|
} // End of namespace Kyra
|
2009-02-01 19:27:01 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2009-03-04 11:53:25 +00:00
|
|
|
#endif // ENABLE_LOL
|
|
|
|
|