diff options
author | Filippos Karapetis | 2008-04-20 14:47:37 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-04-20 14:47:37 +0000 |
commit | 7ca439f410ac1c46a387567b30271ae4e4a2ed30 (patch) | |
tree | 4d4154169b074293581ad6a11ee821290418f4fb /engines/m4/m4_menus.h | |
parent | d0590a09eac68d5cde64d37fb2e5bbd1471a676a (diff) | |
download | scummvm-rg350-7ca439f410ac1c46a387567b30271ae4e4a2ed30.tar.gz scummvm-rg350-7ca439f410ac1c46a387567b30271ae4e4a2ed30.tar.bz2 scummvm-rg350-7ca439f410ac1c46a387567b30271ae4e4a2ed30.zip |
Initial import of the work in progress M4 engine
svn-id: r31600
Diffstat (limited to 'engines/m4/m4_menus.h')
-rw-r--r-- | engines/m4/m4_menus.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/engines/m4/m4_menus.h b/engines/m4/m4_menus.h new file mode 100644 index 0000000000..f0a0f07333 --- /dev/null +++ b/engines/m4/m4_menus.h @@ -0,0 +1,106 @@ +/* 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$ + * + */ + +#ifndef M4_M4_MENUS_H +#define M4_M4_MENUS_H + +#include "common/list.h" +#include "common/ptr.h" + +#include "m4/viewmgr.h" +#include "m4/m4.h" +#include "m4/gui.h" +#include "m4/saveload.h" + +namespace M4 { + +#define M4_DIALOG_FADE_STEPS 5 +#define M4_DIALOG_FADE_DELAY 30 + +typedef Common::List<MenuObject *> MenuObjectList; + +class OrionMenuView: public DialogView { + typedef MenuObjectList::iterator MenuObjectsIterator; +private: + MenuType _menuType; + SpriteAsset *_sprites; + MenuObjectList _menuObjects; + MenuObject *_currentItem; + typedef void (*Callback)(OrionMenuView *view); + OrionMenuView::Callback _escapeHandler, _returnHandler; + bool _closeFlag; + bool _calledFromMainMenu; + bool _interfaceWasVisible; + int _firstSlotIndex; + + bool loadSprites(const char *seriesName); + M4Surface *createThumbnail(); + void destroyView(); +public: + OrionMenuView(M4Engine *vm, int x, int y, MenuType menuType, bool calledFromMainMenu, + bool loadSaveFromHotkey); + ~OrionMenuView(); + MenuType getMenuType() { return _menuType; } + SpriteAsset *sprites() { return _sprites; } + MenuObjectList &items() { return _menuObjects; } + MenuObject *getItem(int objectId); + void setTopSaveSlot(int slotNumber); + void refresh(const Common::Rect &areaRect); + void close() { _closeFlag = true; } + + bool onEvent(M4EventType eventType, int param, int x, int y, bool &captureEvents); + + int _originalMidiVolume; + SaveGameList *_saveNames; + bool _loadSaveFromHotkey; +}; + +class OrionCallbacks { +public: + static void closeMenuFn(DialogView *view, MenuObject *item); + static void closeMenuFn(OrionMenuView *view); + static void gameOptionsMenuFn(DialogView *view, MenuObject *item); + static void gameSaveGameFn(DialogView *view, MenuObject *item); + static void gameLoadGameFn(DialogView *view, MenuObject *item); + static void gameExitFn(DialogView *view, MenuObject *item); + static void optionsDigiSliderFn(DialogView *view, MenuObject *item); + static void optionsMidiSliderFn(DialogView *view, MenuObject *item); + static void optionsScrollingFn(DialogView *view, MenuObject *item); + static void optionsCancelFn(DialogView *view, MenuObject *item); + static void optionsDoneFn(DialogView *view, MenuObject *item); + static void optionsReturnFn(OrionMenuView *view); + static void optionsEscapeFn(OrionMenuView *view); + static void saveLoadSaveFn(DialogView *view, MenuObject *item); + static void saveLoadLoadFn(DialogView *view, MenuObject *item); + static void saveLoadSlotFn(DialogView *view, MenuObject *item); + static void saveLoadCancelFn(DialogView *view, MenuObject *item); + static void saveLoadSliderFn(DialogView *view, MenuObject *item); + static void saveLoadEscapeFn(OrionMenuView *view); + static void saveLoadReturnFn(OrionMenuView *view); +}; + +} + +#endif |