1 /* 2 Copyright (C) 2001-2013 The Exult Team 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software 16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #ifndef GAMEPLAYOPTIONS_GUMP_H 20 #define GAMEPLAYOPTIONS_GUMP_H 21 22 #include "Modal_gump.h" 23 24 #include <array> 25 #include <memory> 26 #include <string> 27 28 class Gump_button; 29 30 class GameplayOptions_gump : public Modal_gump { 31 private: 32 int facestats; 33 int fastmouse; 34 int mouse3rd; 35 int doubleclick; 36 int rightclick_close; 37 int cheats; 38 int paperdolls; 39 int text_bg; 40 int frames; 41 int right_pathfind; 42 int gumps_pause; 43 44 std::vector<std::string> frametext; 45 int smooth_scrolling; 46 47 enum button_ids { 48 id_first = 0, 49 id_ok = id_first, 50 id_cancel, 51 id_facestats, 52 id_text_bg, 53 id_fastmouse, 54 id_mouse3rd, 55 id_doubleclick, 56 id_rightclick_close, 57 id_right_pathfind, 58 id_gumps_pause, 59 id_cheats, 60 id_frames, 61 id_smooth_scrolling, 62 id_paperdolls, 63 id_count 64 }; 65 std::array<std::unique_ptr<Gump_button>, id_count> buttons; 66 67 public: 68 GameplayOptions_gump(); 69 70 // Paint it and its contents. 71 void paint() override; 72 void close() override; 73 74 // Handle events: 75 bool mouse_down(int mx, int my, int button) override; 76 bool mouse_up(int mx, int my, int button) override; 77 78 void build_buttons(); 79 80 void load_settings(); 81 void save_settings(); 82 void cancel(); 83 toggle_facestats(int state)84 void toggle_facestats(int state) { 85 facestats = state; 86 } 87 toggle_fastmouse(int state)88 void toggle_fastmouse(int state) { 89 fastmouse = state; 90 } 91 toggle_mouse3rd(int state)92 void toggle_mouse3rd(int state) { 93 mouse3rd = state; 94 } 95 toggle_doubleclick(int state)96 void toggle_doubleclick(int state) { 97 doubleclick = state; 98 } 99 toggle_cheats(int state)100 void toggle_cheats(int state) { 101 cheats = state; 102 } 103 toggle_paperdolls(int state)104 void toggle_paperdolls(int state) { 105 paperdolls = state; 106 } 107 toggle_text_bg(int state)108 void toggle_text_bg(int state) { 109 text_bg = state; 110 } 111 toggle_frames(int state)112 void toggle_frames(int state) { 113 frames = state; 114 } 115 toggle_rightclick_close(int state)116 void toggle_rightclick_close(int state) { 117 rightclick_close = state; 118 } 119 toggle_right_pathfind(int state)120 void toggle_right_pathfind(int state) { 121 right_pathfind = state; 122 } 123 toggle_gumps_pause(int state)124 void toggle_gumps_pause(int state) { 125 gumps_pause = state; 126 } 127 toggle_smooth_scrolling(int state)128 void toggle_smooth_scrolling(int state) { 129 smooth_scrolling = state; 130 } 131 }; 132 133 #endif 134