static MenuData* create_options_menu_gamepad(MenuData *parent) { MenuData *m = create_options_menu_base("Gamepad Options"); m->end = destroy_options_menu_gamepad; OptionsMenuContext *ctx = m->context; ctx->data = strdup(config_get_str(CONFIG_GAMEPAD_DEVICE)); OptionBinding *b; add_menu_entry(m, "Enable Gamepad/Joystick support", do_nothing, b = bind_option(CONFIG_GAMEPAD_ENABLED, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); add_menu_entry(m, "Device", do_nothing, b = bind_gpdevice(CONFIG_GAMEPAD_DEVICE) ); b->dependence = gamepad_enabled_depencence; add_menu_separator(m); add_menu_entry(m, "Customize controls…", enter_options_menu_gamepad_controls, NULL); add_menu_separator(m); add_menu_entry(m, "X axis", do_nothing, b = bind_gpaxisbinding(CONFIG_GAMEPAD_AXIS_LR) ); add_menu_entry(m, "Y axis", do_nothing, b = bind_gpaxisbinding(CONFIG_GAMEPAD_AXIS_UD) ); add_menu_entry(m, "Axes mode", do_nothing, b = bind_option(CONFIG_GAMEPAD_AXIS_FREE, bind_common_onoff_get, bind_common_onoff_set) ); bind_addvalue(b, "free"); bind_addvalue(b, "restricted"); add_menu_entry(m, "X axis sensitivity", do_nothing, b = bind_scale(CONFIG_GAMEPAD_AXIS_LR_SENS, -2, 2, 0.05) ); b->pad++; add_menu_entry(m, "Y axis sensitivity", do_nothing, b = bind_scale(CONFIG_GAMEPAD_AXIS_UD_SENS, -2, 2, 0.05) ); b->pad++; add_menu_entry(m, "Dead zone", do_nothing, b = bind_scale(CONFIG_GAMEPAD_AXIS_DEADZONE, 0, 1, 0.01) ); add_menu_separator(m); add_menu_entry(m, "Back", menu_action_close, NULL); return m; }
MenuData* create_options_menu(void) { MenuData *m = create_options_menu_base("Options"); OptionBinding *b; add_menu_entry(m, "Player name", do_nothing, b = bind_stroption(CONFIG_PLAYERNAME) ); add_menu_separator(m); add_menu_entry(m, "Save replays", do_nothing, b = bind_option(CONFIG_SAVE_RPY, bind_common_onoffplus_get, bind_common_onoffplus_set) ); bind_addvalue(b, "always"); bind_addvalue(b, "never"); bind_addvalue(b, "ask"); add_menu_entry(m, "Auto-restart in Spell Practice", do_nothing, b = bind_option(CONFIG_SPELLSTAGE_AUTORESTART, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); add_menu_entry(m, "Power in Spell and Stage Practice", do_nothing, b = bind_option(CONFIG_PRACTICE_POWER, bind_power_get, bind_power_set) ); bind_addvalue(b, "0.0"); bind_addvalue(b, "1.0"); bind_addvalue(b, "2.0"); bind_addvalue(b, "3.0"); bind_addvalue(b, "4.0"); add_menu_entry(m, "Shoot by default", do_nothing, b = bind_option(CONFIG_SHOT_INVERTED, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); add_menu_entry(m, "Boss healthbar style", do_nothing, b = bind_option(CONFIG_HEALTHBAR_STYLE, bind_common_int_get, bind_common_int_set) ); bind_addvalue(b, "classic"); bind_addvalue(b, "modern"); add_menu_entry(m, "Floating score text visibility", do_nothing, b = bind_scale(CONFIG_SCORETEXT_ALPHA, 0, 1, 0.05) ); add_menu_separator(m); add_menu_entry(m, "SFX Volume", do_nothing, b = bind_scale(CONFIG_SFX_VOLUME, 0, 1, 0.05) ); b->dependence = audio_output_works; add_menu_entry(m, "BGM Volume", do_nothing, b = bind_scale(CONFIG_BGM_VOLUME, 0, 1, 0.05) ); b->dependence = audio_output_works; add_menu_entry(m, "Mute audio", do_nothing, b = bind_option(CONFIG_MUTE_AUDIO, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); add_menu_separator(m); add_menu_entry(m, "Video options…", enter_options_menu_video, NULL); add_menu_entry(m, "Customize controls…", enter_options_menu_controls, NULL); add_menu_entry(m, "Gamepad & Joystick options…", enter_options_menu_gamepad, NULL); add_menu_separator(m); add_menu_entry(m, "Back", menu_action_close, NULL); return m; }
static MenuData* create_options_menu_video(MenuData *parent) { MenuData *m = create_options_menu_base("Video Options"); OptionBinding *b; add_menu_entry(m, "Fullscreen", do_nothing, b = bind_option(CONFIG_FULLSCREEN, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); b->dependence = bind_fullscreen_dependence; add_menu_entry(m, "Display", do_nothing, b = bind_video_display(CONFIG_VID_DISPLAY) ); add_menu_entry(m, "Window size", do_nothing, b = bind_resolution() ); b->setter = bind_resolution_set; b->dependence = bind_resolution_dependence; add_menu_entry(m, "Resizable window", do_nothing, b = bind_option(CONFIG_VID_RESIZABLE, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); b->dependence = bind_resizable_dependence; add_menu_separator(m); add_menu_entry(m, "Pause the game when not focused", do_nothing, b = bind_option(CONFIG_FOCUS_LOSS_PAUSE, bind_common_onoff_get, bind_common_onoff_set) ); bind_onoff(b); add_menu_entry(m, "Vertical synchronization", do_nothing, b = bind_option(CONFIG_VSYNC, bind_common_onoffplus_get, bind_common_onoffplus_set) ); bind_addvalue(b, "on"); bind_addvalue(b, "off"); if(video_query_capability(VIDEO_CAP_VSYNC_ADAPTIVE) != VIDEO_NEVER_AVAILABLE) { bind_addvalue(b, "adaptive"); } add_menu_entry(m, "Skip frames", do_nothing, b = bind_option(CONFIG_VID_FRAMESKIP, bind_common_intplus1_get, bind_common_intplus1_set) ); bind_addvalue(b, "0"); bind_addvalue(b, "½"); bind_addvalue(b, "⅔"); add_menu_separator(m); add_menu_entry(m, "Overall rendering quality", do_nothing, b = bind_scale(CONFIG_FG_QUALITY, 0.1, 1.0, 0.05) ); add_menu_entry(m, "Draw background", do_nothing, b = bind_option(CONFIG_NO_STAGEBG, bind_common_onoff_inverted_get, bind_common_onoff_inverted_set) ); bind_onoff(b); add_menu_entry(m, "Background rendering quality", do_nothing, b = bind_scale(CONFIG_BG_QUALITY, 0.1, 1.0, 0.05) ); b->dependence = bind_bgquality_dependence; b->pad++; add_menu_separator(m); add_menu_entry(m, "Anti-aliasing", do_nothing, b = bind_option(CONFIG_FXAA, bind_common_int_get, bind_common_int_set) ); bind_addvalue(b, "none"); bind_addvalue(b, "fxaa"); add_menu_entry(m, "Particle effects", do_nothing, b = bind_option(CONFIG_PARTICLES, bind_common_int_get, bind_common_int_set) ); bind_addvalue(b, "minimal"); bind_addvalue(b, "full"); add_menu_entry(m, "Postprocessing effects", do_nothing, b = bind_option(CONFIG_POSTPROCESS, bind_common_int_get, bind_common_int_set) ); bind_addvalue(b, "minimal"); bind_addvalue(b, "fast"); bind_addvalue(b, "full"); add_menu_separator(m); add_menu_entry(m, "Back", menu_action_close, NULL); return m; }
void create_options_menu(MenuData *m) { OptionBinding *b; create_menu(m); m->type = MT_Transient; m->ondestroy = destroy_options_menu; m->context = NULL; #define bind_onoff(b) bind_addvalue(b, "on"); bind_addvalue(b, "off") add_menu_entry(m, "Player Name", do_nothing, NULL); b = bind_stroption(m, "playername", PLAYERNAME); add_menu_separator(m); allocate_binding(m); add_menu_entry(m, "Video Mode", do_nothing, NULL); b = bind_resolution(m); add_menu_entry(m, "Fullscreen", do_nothing, NULL); b = bind_option(m, "fullscreen", FULLSCREEN, bind_common_onoffget, bind_fullscreen_set); bind_onoff(b); add_menu_entry(m, "Audio", do_nothing, NULL); b = bind_option(m, "disable_audio", NO_AUDIO, bind_common_onoffget_inverted, bind_noaudio_set); bind_onoff(b); add_menu_entry(m, "Shaders", do_nothing, NULL); b = bind_option(m, "disable_shader", NO_SHADER, bind_common_onoffget_inverted, bind_noshader_set); bind_onoff(b); add_menu_entry(m, "Stage Background", do_nothing, NULL); b = bind_option(m, "disable_stagebg", NO_STAGEBG, bind_common_intget, bind_common_intset); bind_addvalue(b, "on"); bind_addvalue(b, "off"); bind_addvalue(b, "auto"); add_menu_entry(m, "Minimum FPS", do_nothing, NULL); b = bind_option(m, "disable_stagebg_auto_fpslimit", NO_STAGEBG_FPSLIMIT, bind_common_intget, bind_common_intset); bind_setvaluerange(b, 20, 60); bind_setdependence(b, bind_stagebg_fpslimit_dependence); add_menu_entry(m, "Save Replays", do_nothing, NULL); b = bind_option(m, "save_rpy", SAVE_RPY, bind_saverpy_get, bind_saverpy_set); bind_addvalue(b, "on"); bind_addvalue(b, "off"); bind_addvalue(b, "ask"); add_menu_separator(m); allocate_binding(m); add_menu_entry(m, "Move up", do_nothing, NULL); bind_keybinding(m, "key_up", KEY_UP); add_menu_entry(m, "Move down", do_nothing, NULL); bind_keybinding(m, "key_down", KEY_DOWN); add_menu_entry(m, "Move left", do_nothing, NULL); bind_keybinding(m, "key_left", KEY_LEFT); add_menu_entry(m, "Move right", do_nothing, NULL); bind_keybinding(m, "key_right", KEY_RIGHT); add_menu_separator(m); allocate_binding(m); add_menu_entry(m, "Fire", do_nothing, NULL); bind_keybinding(m, "key_shot", KEY_SHOT); add_menu_entry(m, "Focus", do_nothing, NULL); bind_keybinding(m, "key_focus", KEY_FOCUS); add_menu_entry(m, "Bomb", do_nothing, NULL); bind_keybinding(m, "key_bomb", KEY_BOMB); add_menu_separator(m); allocate_binding(m); add_menu_entry(m, "Toggle fullscreen", do_nothing, NULL); bind_keybinding(m, "key_fullscreen", KEY_FULLSCREEN); add_menu_entry(m, "Take a screenshot", do_nothing, NULL); bind_keybinding(m, "key_screenshot", KEY_SCREENSHOT); add_menu_entry(m, "Skip dialog", do_nothing, NULL); bind_keybinding(m, "key_skip", KEY_SKIP); add_menu_separator(m); allocate_binding(m); add_menu_entry(m, "Return to the main menu", backtomain, m); allocate_binding(m); }