Radials, Tooltips, RCD and Borg Selection (#8710)

This commit is contained in:
Matt Atlas
2020-04-24 17:00:30 +02:00
committed by GitHub
parent 278bd03455
commit 15bcc0f6d5
23 changed files with 923 additions and 63 deletions
+2 -1
View File
@@ -19,7 +19,8 @@
/////////
//OTHER//
/////////
var/datum/preferences/prefs = null
var/datum/preferences/prefs
var/datum/tooltip/tooltips
var/move_delay = 1
var/moving = null
var/adminobs = null
+7 -2
View File
@@ -373,10 +373,8 @@
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)
@@ -425,6 +423,9 @@
del(src)
return 0
if(!tooltips)
tooltips = new /datum/tooltip(src)
if(holder)
add_admin_verbs()
@@ -575,6 +576,10 @@
if(prefs)
prefs.ShowChoices(usr)
/client/proc/apply_fps(var/client_fps)
if(world.byond_version >= 511 && byond_version >= 511 && client_fps >= 0 && client_fps <= 1000)
vars["fps"] = prefs.clientfps
//I honestly can't find a good place for this atm.
//If the webint interaction gets more features, I'll move it. - Skull132
/client/verb/view_linking_requests()
@@ -30,7 +30,8 @@
"html_UI_style",
"skin_theme",
"ooccolor",
"clientfps"
"clientfps",
"tooltip_style"
),
"args" = list("ckey")
)
@@ -49,6 +50,7 @@
"skin_theme",
"ooccolor",
"clientfps",
"tooltip_style",
"ckey" = 1
)
)
@@ -62,7 +64,8 @@
"html_UI_style" = pref.html_UI_style,
"skin_theme" = pref.skin_theme,
"ooccolor" = pref.ooccolor,
"clientfps" = pref.clientfps
"clientfps" = pref.clientfps,
"tooltip_style" = pref.tooltip_style
)
/datum/category_item/player_setup_item/player_global/ui/sanitize_preferences()
@@ -81,6 +84,7 @@
dat += "<b>Custom UI</b> (recommended for White UI):<br>"
dat += "-Color: <a href='?src=\ref[src];select_color=1'><b>[pref.UI_style_color]</b></a> [HTML_RECT(pref.UI_style_color)] - <a href='?src=\ref[src];reset=ui'>reset</a><br>"
dat += "-Alpha(transparency): <a href='?src=\ref[src];select_alpha=1'><b>[pref.UI_style_alpha]</b></a> - <a href='?src=\ref[src];reset=alpha'>reset</a><br>"
dat += "<b>Tooltip Style:</b> <a href='?src=\ref[src];select_tooltip_style=1'><b>[pref.tooltip_style]</b></a><br>"
dat += "<b>HTML UI Style:</b> <a href='?src=\ref[src];select_html=1'><b>[pref.html_UI_style]</b></a><br>"
dat += "<b>Main UI Style:</b> <a href='?src=\ref[src];select_skin_theme=1'><b>[pref.skin_theme]</b></a><br>"
dat += "-FPS: <a href='?src=\ref[src];select_fps=1'><b>[pref.clientfps]</b></a> - <a href='?src=\ref[src];reset=fps'>reset</a><br>"
@@ -132,16 +136,27 @@
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["select_fps"])
var/version_message
if (user.client && user.client.byond_version < 511)
version_message = "\nYou need to be using byond version 511 or later to take advantage of this feature, your version of [user.client.byond_version] is too low"
if (world.byond_version < 511)
version_message += "\nThis server does not currently support client side fps. You can set now for when it does."
var/new_fps = input(user, "Choose your desired fps.[version_message]\n(0 = synced with server tick rate (currently:[world.fps]))", "Global Preference") as num|null
if (isnum(new_fps) && CanUseTopic(user))
pref.clientfps = Clamp(new_fps, 0, 1000)
var/mob/target_mob = preference_mob()
if(target_mob && target_mob.client)
target_mob.client.apply_fps(pref.clientfps)
return TOPIC_REFRESH
else if(href_list["select_tooltip_style"])
var/tooltip_style_new = input(user, "Choose a new tooltip style.", "Global Preference", pref.tooltip_style) as null|anything in all_tooltip_styles
if(!tooltip_style_new || !CanUseTopic(user))
return TOPIC_NOACTION
pref.tooltip_style = tooltip_style_new
return TOPIC_REFRESH
else if(href_list["reset"])
switch(href_list["reset"])
+2
View File
@@ -28,6 +28,8 @@ datum/preferences
var/UI_style_alpha = 255
var/html_UI_style = "Nano"
var/skin_theme = "Light"
//Style for popup tooltips
var/tooltip_style = "Midnight"
var/motd_hash = "" //Hashes for the new server greeting window.
var/memo_hash = ""
+10 -4
View File
@@ -1,6 +1,4 @@
/var/all_ui_styles = list(
var/all_ui_styles = list(
"Midnight" = 'icons/mob/screen/midnight.dmi',
"Orange" = 'icons/mob/screen/orange.dmi',
"old" = 'icons/mob/screen/old.dmi',
@@ -8,12 +6,20 @@
"old-noborder" = 'icons/mob/screen/old-noborder.dmi'
)
var/all_tooltip_styles = list(
"Midnight", //Default for everyone is the first one,
"Plasmafire",
"Retro",
"Slimecore",
"Operative",
"Clockwork"
)
/proc/ui_style2icon(ui_style)
if(ui_style in all_ui_styles)
return all_ui_styles[ui_style]
return all_ui_styles["White"]
/client/verb/change_ui()
set name = "Change UI"
set category = "Preferences"