Skip to content

Commit

Permalink
Add default settings for SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw committed Aug 18, 2024
1 parent ecb126b commit 3f5ba41
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions src/defaultsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void set_default_settings()

// Client
settings->setDefault("address", "");
settings->setDefault("remote_port", "30000");
settings->setDefault("enable_sound", "true");
settings->setDefault("enable_touch", bool_to_cstr(has_touch));
settings->setDefault("sound_volume", "0.8");
Expand Down Expand Up @@ -136,7 +137,43 @@ void set_default_settings()
settings->setDefault("chat_weblink_color", "#8888FF");

// Keymap
settings->setDefault("remote_port", "30000");
#if USE_SDL2
settings->setDefault("save_keys_as_scancodes", "true");
settings->setDefault("keymap_forward", "<26>");
settings->setDefault("keymap_autoforward", "");
settings->setDefault("keymap_backward", "<22>");
settings->setDefault("keymap_left", "<4>");
settings->setDefault("keymap_right", "<7>");
settings->setDefault("keymap_jump", "<44>");
settings->setDefault("keymap_sneak", "KEY_LSHIFT");
settings->setDefault("keymap_dig", "KEY_LBUTTON");
settings->setDefault("keymap_place", "KEY_RBUTTON");
settings->setDefault("keymap_drop", "<20>");
settings->setDefault("keymap_zoom", "<29>");
settings->setDefault("keymap_inventory", "<12>");
settings->setDefault("keymap_aux1", "<8>");
settings->setDefault("keymap_chat", "<23>");
settings->setDefault("keymap_cmd", "<56>");
settings->setDefault("keymap_cmd_local", "<55>");
settings->setDefault("keymap_minimap", "<25>");
settings->setDefault("keymap_console", "KEY_F10");

// See https://github.com/minetest/minetest/issues/12792
settings->setDefault("keymap_rangeselect", has_touch ? "<21>" : "");

settings->setDefault("keymap_freemove", "<14>");
settings->setDefault("keymap_pitchmove", "");
settings->setDefault("keymap_fastmove", "<13>");
settings->setDefault("keymap_noclip", "<11>");
settings->setDefault("keymap_hotbar_next", "<17>");
settings->setDefault("keymap_hotbar_previous", "<5>");
settings->setDefault("keymap_mute", "<16>");
settings->setDefault("keymap_camera_mode", "<6>");
settings->setDefault("keymap_increase_viewing_range_min", "<46>");
settings->setDefault("keymap_decrease_viewing_range_min", "<45>");
#else
// TODO: Remove this once we fully switch to SDL2
settings->setDefault("save_keys_as_scancodes", "false");
settings->setDefault("keymap_forward", "KEY_KEY_W");
settings->setDefault("keymap_autoforward", "");
settings->setDefault("keymap_backward", "KEY_KEY_S");
Expand Down Expand Up @@ -166,6 +203,11 @@ void set_default_settings()
settings->setDefault("keymap_hotbar_next", "KEY_KEY_N");
settings->setDefault("keymap_hotbar_previous", "KEY_KEY_B");
settings->setDefault("keymap_mute", "KEY_KEY_M");
settings->setDefault("keymap_camera_mode", "KEY_KEY_C");
settings->setDefault("keymap_increase_viewing_range_min", "+");
settings->setDefault("keymap_decrease_viewing_range_min", "-");
#endif

settings->setDefault("keymap_increase_volume", "");
settings->setDefault("keymap_decrease_volume", "");
settings->setDefault("keymap_cinematic", "");
Expand All @@ -180,11 +222,8 @@ void set_default_settings()
#endif
settings->setDefault("keymap_toggle_debug", "KEY_F5");
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
settings->setDefault("keymap_camera_mode", "KEY_KEY_C");
settings->setDefault("keymap_screenshot", "KEY_F12");
settings->setDefault("keymap_fullscreen", "KEY_F11");
settings->setDefault("keymap_increase_viewing_range_min", "+");
settings->setDefault("keymap_decrease_viewing_range_min", "-");
settings->setDefault("keymap_slot1", "KEY_KEY_1");
settings->setDefault("keymap_slot2", "KEY_KEY_2");
settings->setDefault("keymap_slot3", "KEY_KEY_3");
Expand Down Expand Up @@ -363,7 +402,6 @@ void set_default_settings()
settings->setDefault("repeat_dig_time", "0.0");
settings->setDefault("safe_dig_and_place", "false");
settings->setDefault("random_input", "false");
settings->setDefault("save_keys_as_scancodes", "false");
settings->setDefault("aux1_descends", "false");
settings->setDefault("doubletap_jump", "false");
settings->setDefault("always_fly_fast", "true");
Expand Down

0 comments on commit 3f5ba41

Please sign in to comment.