00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef OPTIONSMENU_H
00019 #define OPTIONSMENU_H
00020
00021 #include <string.h>
00022 #include "constants.h"
00023 #include "sdlhandler.h"
00024 #include "sdleventhandler.h"
00025 #include "sdlscreenview.h"
00026 #include "scourge.h"
00027 #include "userconfiguration.h"
00028 #include "util.h"
00029 #include "gui/window.h"
00030 #include "gui/button.h"
00031 #include "gui/scrollinglist.h"
00032 #include "gui/cardcontainer.h"
00033 #include "gui/multiplelabel.h"
00034 #include "gui/checkbox.h"
00035 #include "gui/slider.h"
00036
00041 #define MAX_CONTROLS_LINE_SIZE 80
00042
00043 class Scourge;
00044 class UserConfiguration;
00045
00046 class OptionsMenu {
00047 private:
00048
00049 char ** controlLines;
00050 Scourge *scourge;
00051 UserConfiguration * uc;
00052 bool showDebug;
00053 bool controlsLoaded;
00054 bool videoLoaded;
00055 bool gameSettingsLoaded;
00056 int nbControlLines;
00057 bool waitingForNewKey;
00058 bool ignoreKeyUp;
00059
00060 enum modeOptions {
00061 CONTROLS = 0, VIDEO, AUDIO, GAME_SETTINGS
00062 };
00063 int selectedMode;
00064
00065 Window *mainWin;
00066 Button *controlsButton, *videoButton, *audioButton, *gameSettingsButton;
00067 Button *changeControlButton, *saveButton, *closeButton;
00068 Label * keyBindingsLabel;
00069 Label * waitingLabel;
00070 Label * changeTakeEffectLabel;
00071
00072 MultipleLabel * gameSpeedML;
00073 Checkbox * alwaysCenterMapCheckbox;
00074 Checkbox * keepMapSize;
00075 Checkbox * frameOnFullScreen;
00076 Checkbox * turnBasedBattle;
00077 Checkbox *ovalCutoutShown;
00078 Checkbox * alwaysShowPath;
00079 Checkbox *tooltipEnabled;
00080 Slider *tooltipInterval;
00081
00082 MultipleLabel * videoResolutionML;
00083 Checkbox * fullscreenCheckbox;
00084 Checkbox * doublebufCheckbox;
00085 Checkbox * hwpalCheckbox;
00086 Checkbox * resizeableCheckbox;
00087 Checkbox * forceHwsurfCheckbox;
00088 Checkbox * forceSwsurfCheckbox;
00089 Checkbox * hwaccelCheckbox;
00090 Checkbox * stencilbufCheckbox;
00091 Checkbox * multitexturingCheckbox;
00092 MultipleLabel * shadowsML;
00093
00094 CardContainer *cards;
00095 ScrollingList *controlBindingsList;
00096
00097 Slider *musicVolume;
00098 Slider *effectsVolume;
00099
00100 void setSelectedMode();
00101 void loadControls();
00102 void loadVideo();
00103 void loadGameSettings();
00104
00105 public:
00106 OptionsMenu(Scourge *scourge);
00107 ~OptionsMenu();
00108
00109 bool handleEvent(SDL_Event *event);
00110 bool handleEvent(Widget *widget, SDL_Event *event);
00111
00112 void show();
00113 void hide();
00114 inline bool isVisible() { return mainWin->isVisible(); }
00115
00116 protected:
00117 };
00118
00119 #endif