mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Attempts to make movement with high ping easier (#12846)
* first attempts at high ping movement * moved from verb to preference
This commit is contained in:
@@ -103,6 +103,7 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
var/parallax_speed = 2
|
||||
var/special_popup = 0
|
||||
var/tooltips = 1
|
||||
var/stumble = 0 //whether the player pauses after their first step
|
||||
//character preferences
|
||||
var/real_name //our character's name
|
||||
var/be_random_name = 0 //whether we are a random name every round
|
||||
@@ -324,6 +325,8 @@ var/const/MAX_SAVE_SLOTS = 8
|
||||
<a href='?_src_=prefs;preference=nanoui'><b>[(usenanoui) ? "NanoUI" : "HTML"]</b></a><br>
|
||||
<b>Progress Bars:</b>
|
||||
<a href='?_src_=prefs;preference=progbar'><b>[(progress_bars) ? "Yes" : "No"]</b></a><br>
|
||||
<b>Pause after first step:</b>
|
||||
<a href='?_src_=prefs;preference=stumble'><b>[(stumble) ? "Yes" : "No"]</b></a><br>
|
||||
</div>
|
||||
<div id="rightDiv" style="width:50%;height:100%;float:right;">
|
||||
<b>Randomized Character Slot:</b>
|
||||
@@ -1511,6 +1514,8 @@ NOTE: The change will take effect AFTER any current recruiting periods."}
|
||||
tooltips = !tooltips
|
||||
if("progbar")
|
||||
progress_bars = !progress_bars
|
||||
if("stumble")
|
||||
stumble = !stumble
|
||||
|
||||
if("ghost_deadchat")
|
||||
toggles ^= CHAT_DEAD
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
space_parallax = text2num(preference_list_client["space_parallax"])
|
||||
space_dust = text2num(preference_list_client["space_dust"])
|
||||
parallax_speed = text2num(preference_list_client["parallax_speed"])
|
||||
stumble = text2num(preference_list_client["stumble"])
|
||||
|
||||
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
|
||||
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
@@ -113,6 +114,7 @@
|
||||
space_parallax = sanitize_integer(space_parallax, 0, 1, initial(space_parallax))
|
||||
space_dust = sanitize_integer(space_dust, 0, 1, initial(space_dust))
|
||||
parallax_speed = sanitize_integer(parallax_speed, 0, 5, initial(parallax_speed))
|
||||
stumble = sanitize_integer(stumble, 0, 1, initial(stumble))
|
||||
return 1
|
||||
|
||||
|
||||
@@ -176,15 +178,15 @@
|
||||
check.Add("SELECT ckey FROM client WHERE ckey = ?", ckey)
|
||||
if(check.Execute(db))
|
||||
if(!check.NextRow())
|
||||
q.Add("INSERT into client (ckey, ooc_color, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",\
|
||||
ckey, ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed)
|
||||
q.Add("INSERT into client (ckey, ooc_color, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",\
|
||||
ckey, ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble)
|
||||
if(!q.Execute(db))
|
||||
message_admins("Error #: [q.Error()] - [q.ErrorMsg()]")
|
||||
WARNING("Error #:[q.Error()] - [q.ErrorMsg()]")
|
||||
return 0
|
||||
else
|
||||
q.Add("UPDATE client SET ooc_color=?,lastchangelog=?,UI_style=?,default_slot=?,toggles=?,UI_style_color=?,UI_style_alpha=?,warns=?,warnbans=?,randomslot=?,volume=?,usewmp=?,special=?,usenanoui=?,tooltips=?,progress_bars=?,space_parallax=?,space_dust=?,parallax_speed=? WHERE ckey = ?",\
|
||||
ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, ckey)
|
||||
q.Add("UPDATE client SET ooc_color=?,lastchangelog=?,UI_style=?,default_slot=?,toggles=?,UI_style_color=?,UI_style_alpha=?,warns=?,warnbans=?,randomslot=?,volume=?,usewmp=?,special=?,usenanoui=?,tooltips=?,progress_bars=?,space_parallax=?,space_dust=?,parallax_speed=?, stumble=? WHERE ckey = ?",\
|
||||
ooccolor, lastchangelog, UI_style, default_slot, toggles, UI_style_color, UI_style_alpha, warns, warnbans, randomslot, volume, usewmp, special_popup, usenanoui, tooltips, progress_bars, space_parallax, space_dust, parallax_speed, stumble, ckey)
|
||||
if(!q.Execute(db))
|
||||
message_admins("Error #: [q.Error()] - [q.ErrorMsg()]")
|
||||
WARNING("Error #:[q.Error()] - [q.ErrorMsg()]")
|
||||
|
||||
13
code/modules/migrations/SS13_Prefs/008-add-stumble.dm
Normal file
13
code/modules/migrations/SS13_Prefs/008-add-stumble.dm
Normal file
@@ -0,0 +1,13 @@
|
||||
/datum/migration/sqlite/ss13_prefs/_008
|
||||
id = 8
|
||||
name = "Add Stumble"
|
||||
|
||||
/datum/migration/sqlite/ss13_prefs/_008/up()
|
||||
if(!hasColumn("client","stumble"))
|
||||
return execute("ALTER TABLE `client` ADD COLUMN stumble INTEGER DEFAULT 0")
|
||||
return TRUE
|
||||
|
||||
/datum/migration/sqlite/ss13_prefs/_008/down()
|
||||
if(hasColumn("client","stumble"))
|
||||
return execute("ALTER TABLE `client` DROP COLUMN stumble")
|
||||
return TRUE
|
||||
@@ -390,6 +390,9 @@
|
||||
step_rand(mob)
|
||||
mob.last_movement=world.time
|
||||
else
|
||||
if (prefs.stumble && ((world.time - mob.last_movement) > 5 && move_delay < 2))
|
||||
mob.delayNextMove(3) //if set, delays the second step when a mob starts moving to attempt to make precise high ping movement easier
|
||||
// to_chat(src, "<span class='notice'>First Step</span>")
|
||||
step(mob, dir)
|
||||
mob.last_movement=world.time
|
||||
|
||||
|
||||
Reference in New Issue
Block a user