diff --git a/SQL/migrate/V001__Initial_schema.sql b/SQL/migrate/V001__Initial_schema.sql index 66dd529cd8b..701efb5d5da 100644 --- a/SQL/migrate/V001__Initial_schema.sql +++ b/SQL/migrate/V001__Initial_schema.sql @@ -253,6 +253,7 @@ CREATE TABLE `ss13_player_pai` ( CREATE TABLE `ss13_player_preferences` ( `ckey` varchar(32) NOT NULL, `ooccolor` text, + `clientfps` int(11) DEFAULT '0', `lastchangelog` text, `UI_style` text, `current_character` int(11) DEFAULT '0', diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index e68de493363..f279d2e7f87 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -371,6 +371,10 @@ prefs.client = src // Safety reasons here. prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning +#if DM_VERSION >= 511 + if (byond_version >= 511 && prefs.clientfps) + fps = prefs.clientfps +#endif // DM_VERSION >= 511 if(SStheming) SStheming.apply_theme_from_perfs(src) diff --git a/code/modules/client/preference_setup/global/01_ui.dm b/code/modules/client/preference_setup/global/01_ui.dm index 7810b718605..68a0dc602ca 100644 --- a/code/modules/client/preference_setup/global/01_ui.dm +++ b/code/modules/client/preference_setup/global/01_ui.dm @@ -9,6 +9,7 @@ S["html_UI_style"] >> pref.html_UI_style S["skin_theme"] >> pref.skin_theme S["ooccolor"] >> pref.ooccolor + S["clientfps"] >> pref.clientfps /datum/category_item/player_setup_item/player_global/ui/save_preferences(var/savefile/S) S["UI_style"] << pref.UI_style @@ -17,6 +18,7 @@ S["html_UI_style"] << pref.html_UI_style S["skin_theme"] << pref.skin_theme S["ooccolor"] << pref.ooccolor + S["clientfps"] << pref.clientfps /datum/category_item/player_setup_item/player_global/ui/gather_load_query() return list( @@ -27,7 +29,8 @@ "UI_style_alpha", "html_UI_style", "skin_theme", - "ooccolor" + "ooccolor", + "clientfps" ), "args" = list("ckey") ) @@ -45,6 +48,7 @@ "html_UI_style", "skin_theme", "ooccolor", + "clientfps", "ckey" = 1 ) ) @@ -57,13 +61,15 @@ "UI_style" = pref.UI_style, "html_UI_style" = pref.html_UI_style, "skin_theme" = pref.skin_theme, - "ooccolor" = pref.ooccolor + "ooccolor" = pref.ooccolor, + "clientfps" = pref.clientfps ) /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)) pref.UI_style_color = sanitize_hexcolor(pref.UI_style_color, initial(pref.UI_style_color)) pref.UI_style_alpha = sanitize_integer(text2num(pref.UI_style_alpha), 0, 255, initial(pref.UI_style_alpha)) + pref.clientfps = sanitize_integer(text2num(pref.clientfps), 0, 1000, initial(pref.clientfps)) pref.html_UI_style = sanitize_inlist(pref.html_UI_style, SStheming.available_html_themes, initial(pref.html_UI_style)) pref.skin_theme = sanitize_inlist(pref.skin_theme, SStheming.skin_themes, initial(pref.skin_theme)) pref.ooccolor = sanitize_hexcolor(pref.ooccolor, initial(pref.ooccolor)) @@ -77,6 +83,7 @@ dat += "-Alpha(transparency): [pref.UI_style_alpha] - reset
" dat += "HTML UI Style: [pref.html_UI_style]
" dat += "Main UI Style: [pref.skin_theme]
" + dat += "-FPS: [pref.clientfps] - reset
" if(can_select_ooc_color(user)) dat += "OOC Color: " if(pref.ooccolor == initial(pref.ooccolor)) @@ -125,6 +132,17 @@ pref.ooccolor = new_ooccolor return TOPIC_REFRESH + else if ("select_fps") + #if DM_VERSION >= 511 + var/desiredfps = input(user, "Choose your desired fps.\n(0 = synced with server tick rate (currently:[world.fps]))", "Character Preference") as null|num + pref.clientfps = sanitize_integer(desiredfps, 0, 1000, initial(pref.clientfps)) + user.client.fps = pref.clientfps + #else + to_user_chat("\nThis server does not currently support client side fps. You can set now for when it does.") + #endif // DM_VERSION >= 511 + + + else if(href_list["reset"]) switch(href_list["reset"]) if("ui") @@ -133,6 +151,8 @@ pref.UI_style_alpha = initial(pref.UI_style_alpha) if("ooc") pref.ooccolor = initial(pref.ooccolor) + if("fps") + pref.clientfps = 0 return TOPIC_REFRESH return ..() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index b61d65d5e22..7e3f4408d8d 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -130,6 +130,7 @@ datum/preferences // SPAAAACE var/parallax_speed = 2 var/toggles_secondary = PARALLAX_SPACE | PARALLAX_DUST | PROGRESS_BARS + var/clientfps = 0 var/list/pai = list() // A list for holding pAI related data. diff --git a/html/changelogs/fps.yml b/html/changelogs/fps.yml new file mode 100644 index 00000000000..70a79bf7fbe --- /dev/null +++ b/html/changelogs/fps.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Lady Fowl + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds the ability for clients to set there FPS clientside."