Merge pull request #3655 from VOREStation/aro-fps

Adds a client FPS setting
This commit is contained in:
Aronai Sieyes
2018-05-10 15:46:29 -04:00
committed by GitHub
4 changed files with 23 additions and 1 deletions

View File

@@ -21,6 +21,9 @@
#define SEE_INVISIBLE_MINIMUM 5
#define INVISIBILITY_MAXIMUM 100
// For the client FPS pref and anywhere else
#define MAX_CLIENT_FPS 200
// Some arbitrary defines to be used by self-pruning global lists. (see master_controller)
#define PROCESS_KILL 26 // Used to trigger removal from a processing list.
#define MAX_GEAR_COST 15 // Used in chargen for accessory loadout limit.

View File

@@ -8,6 +8,7 @@
S["UI_style_alpha"] >> pref.UI_style_alpha
S["ooccolor"] >> pref.ooccolor
S["tooltipstyle"] >> pref.tooltipstyle
S["client_fps"] >> pref.client_fps
/datum/category_item/player_setup_item/player_global/ui/save_preferences(var/savefile/S)
S["UI_style"] << pref.UI_style
@@ -15,6 +16,7 @@
S["UI_style_alpha"] << pref.UI_style_alpha
S["ooccolor"] << pref.ooccolor
S["tooltipstyle"] << pref.tooltipstyle
S["client_fps"] << pref.client_fps
/datum/category_item/player_setup_item/player_global/ui/sanitize_preferences()
pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style))
@@ -22,6 +24,7 @@
pref.UI_style_alpha = sanitize_integer(pref.UI_style_alpha, 0, 255, initial(pref.UI_style_alpha))
pref.ooccolor = sanitize_hexcolor(pref.ooccolor, initial(pref.ooccolor))
pref.tooltipstyle = sanitize_inlist(pref.tooltipstyle, all_tooltip_styles, initial(pref.tooltipstyle))
pref.client_fps = sanitize_integer(pref.client_fps, 0, MAX_CLIENT_FPS, initial(pref.client_fps))
/datum/category_item/player_setup_item/player_global/ui/content(var/mob/user)
. = "<b>UI Style:</b> <a href='?src=\ref[src];select_style=1'><b>[pref.UI_style]</b></a><br>"
@@ -29,6 +32,7 @@
. += "-Color: <a href='?src=\ref[src];select_color=1'><b>[pref.UI_style_color]</b></a><3E><table style='display:inline;' bgcolor='[pref.UI_style_color]'><tr><td>__</td></tr></table><3E><a href='?src=\ref[src];reset=ui'>reset</a><br>"
. += "-Alpha(transparency): <a href='?src=\ref[src];select_alpha=1'><b>[pref.UI_style_alpha]</b></a><3E><a href='?src=\ref[src];reset=alpha'>reset</a><br>"
. += "<b>Tooltip Style:</b> <a href='?src=\ref[src];select_tooltip_style=1'><b>[pref.tooltipstyle]</b></a><br>"
. += "<b>Client FPS:</b> <a href='?src=\ref[src];select_client_fps=1'><b>[pref.client_fps]</b></a><br>"
if(can_select_ooc_color(user))
. += "<b>OOC Color:</b><3E>"
if(pref.ooccolor == initial(pref.ooccolor))
@@ -62,11 +66,20 @@
return TOPIC_REFRESH
else if(href_list["select_tooltip_style"])
var/tooltip_style_new = input(user, "Choose tooltip style.", "Character Preference", pref.tooltipstyle) as null|anything in all_tooltip_styles
var/tooltip_style_new = input(user, "Choose tooltip style.", "Global Preference", pref.tooltipstyle) as null|anything in all_tooltip_styles
if(!tooltip_style_new || !CanUseTopic(user)) return TOPIC_NOACTION
pref.tooltipstyle = tooltip_style_new
return TOPIC_REFRESH
else if(href_list["select_client_fps"])
var/fps_new = input(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps) as null|num
if(isnull(fps_new) || !CanUseTopic(user)) return TOPIC_NOACTION
if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return TOPIC_NOACTION
pref.client_fps = fps_new
if(pref.client)
pref.client.fps = fps_new
return TOPIC_REFRESH
else if(href_list["reset"])
switch(href_list["reset"])
if("ui")

View File

@@ -22,6 +22,7 @@ datum/preferences
var/UI_style_color = "#ffffff"
var/UI_style_alpha = 255
var/tooltipstyle = "Midnight" //Style for popup tooltips
var/client_fps = 0
//character preferences
var/real_name //our character's name

View File

@@ -34,6 +34,11 @@
if(hud_used) qdel(hud_used) //remove the hud objects
hud_used = new /datum/hud(src)
if(client.prefs && client.prefs.client_fps)
client.fps = client.prefs.client_fps
else
client.fps = 0 // Results in using the server FPS
next_move = 1
disconnect_time = null //clear the disconnect time
sight |= SEE_SELF