mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 12:01:47 +00:00
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs. Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines. Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing. Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc. (Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
//replaces the old Ticklag verb, fps is easier to understand
|
|
/client/proc/set_server_fps()
|
|
set category = "Debug"
|
|
set name = "Set Server FPS"
|
|
set desc = "Sets game speed in frames-per-second. Can potentially break the game"
|
|
|
|
if(!check_rights(R_DEBUG))
|
|
return
|
|
|
|
var/cfg_fps = CONFIG_GET(number/fps)
|
|
var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null)
|
|
|
|
if(new_fps <= 0)
|
|
to_chat(src, span_danger("Error: set_server_fps(): Invalid world.fps value. No changes made."), confidential = TRUE)
|
|
return
|
|
if(new_fps > cfg_fps * 1.5)
|
|
if(tgui_alert(usr, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!",list("Confirm","ABORT-ABORT-ABORT")) != "Confirm")
|
|
return
|
|
|
|
var/msg = "[key_name(src)] has modified world.fps to [new_fps]"
|
|
log_admin(msg, 0)
|
|
message_admins(msg, 0)
|
|
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Set Server FPS", "[new_fps]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
|
|
CONFIG_SET(number/fps, new_fps)
|
|
world.change_fps(new_fps)
|