mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
tgui Preferences Menu + total rewrite of the preferences backend (#61313)
About The Pull Request Rewrites the entire preferences menu in tgui. Rewrites the entire backend to be built upon datumized preferences, rather than constant additions to the preferences base datum. Splits game preferences into its own window. Antagonists are now split into their individual rulesets. You can now be a roundstart heretic without signing up for latejoin heretic, as an example. This iteration matches parity, and provides very little new functionality, but adding anything new will be much easier. Fixes #60823 Fixes #28907 Fixes #44887 Fixes #59912 Fixes #58458 Fixes #59181 Major TODOs Quirk icons, from @Fikou (with some slight adjustments from me) Lore text, from @EOBGames (4/6, need moths and then ethereal lore from @AMonkeyThatCodes) Heavy documentation on how one would add new preferences, species, jobs, etc A lot of specialized testing so that people's real data don't get corrupted Changelog cl Mothblocks, Floyd on lots of the design refactor: The preferences menu has been completely rewritten in tgui. refactor: The "Stop Sounds" verb has been moved to OOC. /cl
This commit is contained in:
@@ -864,10 +864,10 @@ attack_basic_mob
|
||||
. = ..()
|
||||
if(get(src, /mob) == usr && !QDELETED(src))
|
||||
var/mob/living/L = usr
|
||||
if(usr.client.prefs.enable_tips)
|
||||
var/timedelay = usr.client.prefs.tip_delay/100
|
||||
if(usr.client.prefs.read_preference(/datum/preference/toggle/enable_tooltips))
|
||||
var/timedelay = usr.client.prefs.read_preference(/datum/preference/numeric/tooltip_delay) / 100
|
||||
tip_timer = addtimer(CALLBACK(src, .proc/openTip, location, control, params, usr), timedelay, TIMER_STOPPABLE)//timer takes delay in deciseconds, but the pref is in milliseconds. dividing by 100 converts it.
|
||||
if(usr.client.prefs.itemoutline_pref)
|
||||
if(usr.client.prefs.read_preference(/datum/preference/toggle/item_outlines))
|
||||
if(istype(L) && L.incapacitated())
|
||||
apply_outline(COLOR_RED_GRAY) //if they're dead or handcuffed, let's show the outline as red to indicate that they can't interact with that right now
|
||||
else
|
||||
@@ -885,7 +885,7 @@ attack_basic_mob
|
||||
/obj/item/proc/apply_outline(outline_color = null)
|
||||
if(get(src, /mob) != usr || QDELETED(src) || isobserver(usr)) //cancel if the item isn't in an inventory, is being deleted, or if the person hovering is a ghost (so that people spectating you don't randomly make your items glow)
|
||||
return
|
||||
var/theme = lowertext(usr.client.prefs.UI_style)
|
||||
var/theme = lowertext(usr.client?.prefs?.read_preference(/datum/preference/choiced/ui_style))
|
||||
if(!outline_color) //if we weren't provided with a color, take the theme's color
|
||||
switch(theme) //yeah it kinda has to be this way
|
||||
if("midnight")
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define DARK_COLOR_LIGHTNESS_THRESHOLD 0.25
|
||||
|
||||
#define RANDOM_GRAFFITI "Random Graffiti"
|
||||
#define RANDOM_LETTER "Random Letter"
|
||||
#define RANDOM_PUNCTUATION "Random Punctuation"
|
||||
@@ -762,9 +760,7 @@
|
||||
|
||||
if(isobj(target) && !(target.flags_1 & UNPAINTABLE_1))
|
||||
if(actually_paints)
|
||||
var/list/rgb = hex2rgb(paint_color)
|
||||
var/list/hsl = rgb2hsl(rgb[1], rgb[2], rgb[3])
|
||||
var/color_is_dark = hsl[3] < DARK_COLOR_LIGHTNESS_THRESHOLD
|
||||
var/color_is_dark = is_color_dark(paint_color)
|
||||
|
||||
if (color_is_dark && !(target.flags_1 & ALLOW_DARK_PAINTS_1))
|
||||
to_chat(user, span_warning("A color that dark on an object like this? Surely not..."))
|
||||
@@ -865,7 +861,6 @@
|
||||
charges = -1
|
||||
desc = "Now with 30% more bluespace technology."
|
||||
|
||||
#undef DARK_COLOR_LIGHTNESS_THRESHOLD
|
||||
#undef RANDOM_GRAFFITI
|
||||
#undef RANDOM_LETTER
|
||||
#undef RANDOM_PUNCTUATION
|
||||
|
||||
@@ -129,8 +129,8 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
. = ..()
|
||||
if(!equipped)
|
||||
if(user.client)
|
||||
background_color = user.client.prefs.pda_color
|
||||
switch(user.client.prefs.pda_style)
|
||||
background_color = user.client.prefs.read_preference(/datum/preference/color/pda_color)
|
||||
switch(user.client.prefs.read_preference(/datum/preference/choiced/pda_style))
|
||||
if(MONO)
|
||||
font_index = MODE_MONO
|
||||
font_mode = FONT_MONO
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
// Clean up the cell on destroy
|
||||
/obj/item/clothing/suit/space/Destroy()
|
||||
if(cell)
|
||||
if(isatom(cell))
|
||||
QDEL_NULL(cell)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/magic/lesser/New()
|
||||
choosable_races = GLOB.roundstart_races.Copy()
|
||||
choosable_races = get_selectable_species().Copy()
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/magic/badmin/New()
|
||||
|
||||
Reference in New Issue
Block a user