+static void execSetupMain()
+{
+ setup_mode = SETUP_MODE_MAIN;
+ DrawSetupScreen();
+}
+
+static void execSetupGraphics()
+{
+ setup.graphics_set = artwork.gfx_current->name;
+
+ setup_mode = SETUP_MODE_GRAPHICS;
+ DrawSetupScreen();
+}
+
+static void execSetupSound()
+{
+ setup.sounds_set = artwork.snd_current->name;
+ setup.music_set = artwork.mus_current->name;
+
+ setup_mode = SETUP_MODE_SOUND;
+ DrawSetupScreen();
+}
+
+static void execSetupChooseGraphics()
+{
+ setup_mode = SETUP_MODE_CHOOSE_GRAPHICS;
+ DrawSetupScreen();
+}
+
+static void execSetupChooseSounds()
+{
+ setup_mode = SETUP_MODE_CHOOSE_SOUNDS;
+ DrawSetupScreen();
+}
+
+static void execSetupChooseMusic()
+{
+ setup_mode = SETUP_MODE_CHOOSE_MUSIC;
+ DrawSetupScreen();
+}
+
+static void execSetupInput()
+{
+ setup_mode = SETUP_MODE_INPUT;
+ DrawSetupScreen();
+}
+
+static void execSetupShortcut()
+{
+ setup_mode = SETUP_MODE_SHORTCUT;
+ DrawSetupScreen();
+}
+
+static void execExitSetupChooseArtwork()
+{
+ if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS)
+ execSetupGraphics();
+ else
+ execSetupSound();
+}
+
+static void execExitSetup()
+{
+ game_status = MAINMENU;
+ DrawMainMenu();
+}
+
+static void execSaveAndExitSetup()
+{
+ SaveSetup();
+ execExitSetup();
+}
+
+static struct TokenInfo setup_info_main[] =
+{
+ { TYPE_ENTER_MENU, execSetupGraphics, "Graphics Setup" },
+ { TYPE_ENTER_MENU, execSetupSound, "Sound Setup" },
+ { TYPE_ENTER_MENU, execSetupInput, "Input Devices" },
+ { TYPE_ENTER_MENU, execSetupShortcut, "Key Shortcuts" },
+ { TYPE_EMPTY, NULL, "" },
+#if 0
+ { TYPE_SWITCH, &setup.double_buffering,"Buffered gfx:" },
+ { TYPE_SWITCH, &setup.fading, "Fading:" },
+#endif
+ { TYPE_SWITCH, &setup.quick_doors, "Quick Doors:" },
+ { TYPE_SWITCH, &setup.ask_on_escape, "Ask on Esc:" },
+ { TYPE_SWITCH, &setup.toons, "Toons:" },
+ { TYPE_SWITCH, &setup.autorecord, "Auto-Record:" },
+ { TYPE_SWITCH, &setup.team_mode, "Team-Mode:" },
+ { TYPE_SWITCH, &setup.handicap, "Handicap:" },
+ { TYPE_SWITCH, &setup.time_limit, "Timelimit:" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execExitSetup, "Exit" },
+ { TYPE_LEAVE_MENU, execSaveAndExitSetup, "Save and exit" },
+ { 0, NULL, NULL }
+};
+
+static struct TokenInfo setup_info_graphics[] =
+{
+ { TYPE_ENTER_MENU, execSetupChooseGraphics,"Custom Graphics" },
+ { TYPE_STRING, &setup.graphics_set, "" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_SWITCH, &setup.fullscreen, "Fullscreen:" },
+ { TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" },
+ { TYPE_SWITCH, &setup.soft_scrolling, "Soft Scroll.:" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
+ { 0, NULL, NULL }
+};
+
+static struct TokenInfo setup_info_sound[] =
+{
+ { TYPE_SWITCH, &setup.sound, "Sound:", },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_SWITCH, &setup.sound_simple, "Simple Sound:" },
+ { TYPE_SWITCH, &setup.sound_loops, "Sound Loops:" },
+ { TYPE_SWITCH, &setup.sound_music, "Game Music:" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_ENTER_MENU, execSetupChooseSounds, "Custom Sounds" },
+ { TYPE_STRING, &setup.sounds_set, "" },
+ { TYPE_ENTER_MENU, execSetupChooseMusic, "Custom Music" },
+ { TYPE_STRING, &setup.music_set, "" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
+ { 0, NULL, NULL }
+};
+
+static struct TokenInfo setup_info_shortcut[] =
+{
+ { TYPE_KEYTEXT, NULL, "Quick Save Game:", },
+ { TYPE_KEY, &setup.shortcut.save_game, "" },
+ { TYPE_KEYTEXT, NULL, "Quick Load Game:", },
+ { TYPE_KEY, &setup.shortcut.load_game, "" },
+ { TYPE_KEYTEXT, NULL, "Toggle Pause:", },
+ { TYPE_KEY, &setup.shortcut.toggle_pause, "" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupMain, "Exit" },
+ { 0, NULL, NULL }
+};
+
+static Key getSetupKey()
+{
+ Key key = KSYM_UNDEFINED;
+ boolean got_key_event = FALSE;
+
+ while (!got_key_event)
+ {
+ if (PendingEvent()) /* got event */