diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index db412292..6606a846 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -225,6 +225,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/auto_fit_viewport = TRUE
var/uplink_spawn_loc = UPLINK_PDA
+
+ var/sprint_spacebar = FALSE
+ var/sprint_toggle = FALSE
var/list/exp = list()
var/list/menuoptions
@@ -1014,6 +1017,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "
"
dat += "Ambient Occlusion: [ambientocclusion ? "Enabled" : "Disabled"]
"
dat += "Fit Viewport: [auto_fit_viewport ? "Auto" : "Manual"]
"
+ dat += "Sprint Key: [sprint_spacebar ? "Space" : "Shift"]
"
+ dat += "Toggle Sprint: [sprint_toggle ? "Enabled" : "Disabled"]
"
if (CONFIG_GET(flag/maprotation) && CONFIG_GET(flag/tgstyle_maprotation))
var/p_map = preferred_map
@@ -2521,6 +2526,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(auto_fit_viewport && parent)
parent.fit_viewport()
+ if("sprint_key")
+ sprint_spacebar = !sprint_spacebar
+
+ if("sprint_toggle")
+ sprint_toggle = !sprint_toggle
+
if("save")
save_preferences()
save_character()
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index 1de8ccf0..76c98014 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -116,6 +116,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["parallax"] >> parallax
S["ambientocclusion"] >> ambientocclusion
S["auto_fit_viewport"] >> auto_fit_viewport
+ S["sprint_spacebar"] >> sprint_spacebar
+ S["sprint_toggle"] >> sprint_toggle
S["menuoptions"] >> menuoptions
S["enable_tips"] >> enable_tips
S["tip_delay"] >> tip_delay
@@ -161,6 +163,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null)
ambientocclusion = sanitize_integer(ambientocclusion, 0, 1, initial(ambientocclusion))
auto_fit_viewport = sanitize_integer(auto_fit_viewport, 0, 1, initial(auto_fit_viewport))
+ sprint_spacebar = sanitize_integer(sprint_spacebar, 0, 1, initial(sprint_spacebar))
+ sprint_toggle = sanitize_integer(sprint_toggle, 0, 1, initial(sprint_toggle))
ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form))
ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit))
ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
@@ -226,6 +230,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["parallax"], parallax)
WRITE_FILE(S["ambientocclusion"], ambientocclusion)
WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport)
+ WRITE_FILE(S["sprint_spacebar"], sprint_spacebar)
+ WRITE_FILE(S["sprint_toggle"], sprint_toggle)
WRITE_FILE(S["menuoptions"], menuoptions)
WRITE_FILE(S["enable_tips"], enable_tips)
WRITE_FILE(S["tip_delay"], tip_delay)
diff --git a/code/modules/keybindings/bindings_human.dm b/code/modules/keybindings/bindings_human.dm
index a9eaface..ed033935 100644
--- a/code/modules/keybindings/bindings_human.dm
+++ b/code/modules/keybindings/bindings_human.dm
@@ -58,13 +58,23 @@
return
switch(_key)
if("Shift")
- sprint_hotkey(TRUE)
+ if(!user.prefs.sprint_spacebar)
+ user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE) //Yes, this looks hacky. Yes, this works.
+ return
+ if("Space")
+ if(user.prefs.sprint_spacebar)
+ user.prefs.sprint_toggle ? togglesprint() : sprint_hotkey(TRUE)
return
return ..()
/mob/living/carbon/human/key_up(_key, client/user)
switch(_key)
if("Shift")
- sprint_hotkey(FALSE)
+ if(!user.prefs.sprint_spacebar && !user.prefs.sprint_toggle)
+ sprint_hotkey(FALSE)
+ return
+ if("Space")
+ if(user.prefs.sprint_spacebar && !user.prefs.sprint_toggle)
+ sprint_hotkey(FALSE)
return
return ..()