mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* TGUI Preferences Menu + total rewrite of the preferences backend (#17368) * It compiles * It opens * Sync 1 * Add asset caching * Sync 2 * It opens without dev now * Update a few packages * Sync 3 * Sync 4 keybind fix * start of dehardcoded species * Small fixes * Add more individual preferences * ASS sync * Automatic changelog generation #17368 [ci skip] * AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH * e * Fix some TS stuff * Sort quirks starting from good * Fix skin tone selector * Jamie Fixes * Update moth.dm * Fix latejoin menu + tweaks * Some fixes * Finally fix job selection * e * Ling * MORE * config * Convert pref: ooccolor * Convert pref: asay color * Convert pref: tooltips * Convert pref: ui style * Convert pref: buttons locked * Convert pref: hotkeys * Convert pref: tgui stuff * Convert pref: windowflashing * Convert pref: ghost stuff * Convert pref: map & antag * Convert pref: PDA stuff * Convert pref: credits & glasses 1 * Convert pref: name * Convert pref: appearances 1 * Convert pref: appearances 2 * Convert pref: jobless role * Convert pref: runechat * Convert pref: yogtoggles + tail wagging 1 * Convert pref: client fps * Convert pref: graphic settings * Convert pref: pda uplink & menuoptions * Convert pref: map & flare * Convert pref: Bar choice * Fix setup character button * Convert pref: alt announcer * Fix * Add cycle background button * Convert pref: disable balloon alert * fix * Clean savefile * Fix backpack pref * Fix underwear selection * Fixes some shit * Updates * Fix computer runtime * Fix pref names * Convert pref: donor item & hat * More computer fixes * Convert pref: borg hat * Convert pref: donor pda (broken) * Convert pref: purrbation * Convert pref: afreeze * Convert pref: accent * Various savefile improvements * Convert pref: persistent scars 1 * A few pref fixes * Some more fixes * Various SSoverlays improvements * Add IPC appearances * Add polysmorph appearances * No icons for ipc and polysmorph * Podpeople deserve death * Add plasmaman appearance * h * fix * fix2 * asdf * fsdf * aaaaa * FUCK MOTHS * Preternis color * e * e * Update human.dmi * icon fix * un snowflake * fix underwear icon * remove color from here * donor ree * aa * maybe * Restore a bunch of TGUI files * More TGUI fixes * test * Fix more errors * a * test * e? * a;lso this * maybe * Fix * Revert "maybe" This reverts commit14d044a7e3. * fuck off m8 * e * fak off m8 * e2? * AHHH * AHA * AHHH * fix linter 2 * debug * fix runtime * Update dynamic.json * Revert "debug" This reverts commit18681432bd. * 2 * who sleeps in an async? * Hack * e * Fix a few blocking calls * Oh bother * Stay dead * fuck * Update jobs.dm * move debugging * Update jobs.dm * Test * YEET * Revert "YEET" This reverts commit4082e3b133. * Update jobs.dm * Update jobs.dm * e * Fix sechailer runtime * Fix human hair color * d * Ports part of that job refactor * Convert latejoin to new departments * Fix ghost form * Quirk validation * Hopefully pod color fix * oops * Prayge job fix * test * Better unit test asset loading * Remove print * Add error just in case * Remove brief outfit and bypass centcom deadmin * Remove broadcast login/logout * Remove darkened flash * Remove fov darkness * Remove ghost lighting * Remove some tgui prefs * Typo fix * Small fixes * IPC name fix * IPC and pod colors * Jobless fix * Donor item fix * Oopsie * Quirk bandaid * Misc * Move new prefs to Preferences tab for now * Add skillcape * FUCK THIS SHIT * Remove /tg/ gamer cloak * Restrict some job related preferences to clean up UI * Remove useless client var * e * Small tweaks * Dont allow selecting mood quirks if mood is disabled * AHHH * Filter ckey-locked donor items * stupid jamie * AI core display fix * Move donor stuff back to the top * Remove TODOs * Clean up perks * Linter fixes * e * WORKS * LORE * Fix skillcape list * Backpack why * Fixes * Fix cargo console * Remove these * Add horns, frills and mark * Fix not applying all features * Add some missing mutant bodyparts * Update numberinput * Makes animatednumber cooler * Oops * Add default ghost orbit * Default to normal backpack * Fixes skillcapes not being filtered * Donor fix prayge * yep * Adds fallback latejoin menu * Rework donor stuff a bit * Fix donor tgui logic * Delete unused proc * Update FA * Un-yogify quirks * Better checking of quirks * Update tgfont * Fix quirk icons * Fix backup name * Fix donor stuff * A few runtime fixes * Fix another runtime * Give fallback latejoin verb upon connecting * Update AirAlarm interface * maybe this works * Test * Sentient * Remove AI core display preview icons * Fix resetting plasmaman helmet style * Equip plasman in preview * Fix plasmaman preview icon * fuck keybind fix * Extra keybind sanity --------- Co-authored-by: Yogbot-13 <admin@yogstation.net> Co-authored-by: Jamie D <993128+JamieD1@users.noreply.github.com> Co-authored-by: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com> Co-authored-by: adamsong <adamsong@users.noreply.github.com>
128 lines
3.3 KiB
Plaintext
128 lines
3.3 KiB
Plaintext
SUBSYSTEM_DEF(overlays)
|
|
name = "Overlay"
|
|
flags = SS_NO_FIRE|SS_NO_INIT
|
|
|
|
var/list/stats
|
|
|
|
/datum/controller/subsystem/overlays/PreInit()
|
|
stats = list()
|
|
|
|
/datum/controller/subsystem/overlays/Shutdown()
|
|
text2file(render_stats(stats), "[GLOB.log_directory]/overlay.log")
|
|
|
|
/datum/controller/subsystem/overlays/Recover()
|
|
stats = SSoverlays.stats
|
|
|
|
/// Converts an overlay list into text for debug printing
|
|
/// Of note: overlays aren't actually mutable appearances, they're just appearances
|
|
/// Don't have access to that type tho, so this is the best you're gonna get
|
|
/proc/overlays2text(list/overlays)
|
|
var/list/unique_overlays = list()
|
|
// As anything because we're basically doing type coerrsion, rather then actually filtering for mutable apperances
|
|
for(var/mutable_appearance/overlay as anything in overlays)
|
|
var/key = "[overlay.icon]-[overlay.icon_state]-[overlay.dir]"
|
|
unique_overlays[key] += 1
|
|
var/list/output_text = list()
|
|
for(var/key in unique_overlays)
|
|
output_text += "([key]) = [unique_overlays[key]]"
|
|
return output_text.Join("\n")
|
|
|
|
/proc/iconstate2appearance(icon, iconstate)
|
|
var/static/image/stringbro = new()
|
|
stringbro.icon = icon
|
|
stringbro.icon_state = iconstate
|
|
return stringbro.appearance
|
|
|
|
/proc/icon2appearance(icon)
|
|
var/static/image/iconbro = new()
|
|
iconbro.icon = icon
|
|
return iconbro.appearance
|
|
|
|
/atom/proc/build_appearance_list(build_overlays)
|
|
if (!islist(build_overlays))
|
|
build_overlays = list(build_overlays)
|
|
for (var/overlay in build_overlays)
|
|
if(!overlay)
|
|
build_overlays -= overlay
|
|
continue
|
|
if (istext(overlay))
|
|
build_overlays -= overlay
|
|
build_overlays += iconstate2appearance(icon, overlay)
|
|
else if(isicon(overlay))
|
|
build_overlays -= overlay
|
|
build_overlays += icon2appearance(overlay)
|
|
return build_overlays
|
|
|
|
/atom/proc/cut_overlays()
|
|
STAT_START_STOPWATCH
|
|
overlays = null
|
|
POST_OVERLAY_CHANGE(src)
|
|
STAT_STOP_STOPWATCH
|
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
|
|
|
/atom/proc/cut_overlay(list/remove_overlays)
|
|
if(!overlays)
|
|
return
|
|
STAT_START_STOPWATCH
|
|
overlays -= build_appearance_list(remove_overlays)
|
|
POST_OVERLAY_CHANGE(src)
|
|
STAT_STOP_STOPWATCH
|
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
|
|
|
/atom/proc/add_overlay(list/add_overlays)
|
|
if(!overlays)
|
|
return
|
|
|
|
STAT_START_STOPWATCH
|
|
overlays += build_appearance_list(add_overlays)
|
|
POST_OVERLAY_CHANGE(src)
|
|
STAT_STOP_STOPWATCH
|
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
|
|
|
/atom/proc/copy_overlays(atom/other, cut_old) //copys our_overlays from another atom
|
|
if(!other)
|
|
if(cut_old)
|
|
cut_overlays()
|
|
return
|
|
|
|
STAT_START_STOPWATCH
|
|
var/list/cached_other = other.overlays.Copy()
|
|
if(cut_old)
|
|
if(cached_other)
|
|
overlays = cached_other
|
|
else
|
|
overlays = null
|
|
POST_OVERLAY_CHANGE(src)
|
|
STAT_STOP_STOPWATCH
|
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
|
else if(cached_other)
|
|
overlays += cached_other
|
|
POST_OVERLAY_CHANGE(src)
|
|
STAT_STOP_STOPWATCH
|
|
STAT_LOG_ENTRY(SSoverlays.stats, type)
|
|
|
|
//TODO: Better solution for these?
|
|
/image/proc/add_overlay(x)
|
|
overlays |= x
|
|
|
|
/image/proc/cut_overlay(x)
|
|
overlays -= x
|
|
|
|
/image/proc/cut_overlays(x)
|
|
overlays.Cut()
|
|
|
|
/image/proc/copy_overlays(atom/other, cut_old)
|
|
if(!other)
|
|
if(cut_old)
|
|
cut_overlays()
|
|
return
|
|
|
|
var/list/cached_other = other.overlays.Copy()
|
|
if(cached_other)
|
|
if(cut_old || !overlays.len)
|
|
overlays = cached_other
|
|
else
|
|
overlays |= cached_other
|
|
else if(cut_old)
|
|
cut_overlays()
|