mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
TGUIv4 - Core backend updates, TGchat, Asset cache updates (#23726)
* TGUI upgrade project: Port initial TGUI 4.0 changes from TG (#23440) * tgui4.0 * bugfix for un-interaction * fix for input not resetting on close * NTOS restore * fix all interfaces having scrollbars, fix colours * bundle update * dep bumps * bumps the deps as much as possible * button regression fix * TGUI test map rev 1 * fix theme and some component regression * fix login screen regression * fixes regression with uplink cart * bundle * fix regressions * fix the input issue, again * regression fixes, stylesheet edition, hash restore * fixes GPS BSOD * draggable control regression * dev server dep regression * byondUI regression fix * section regression fix * fix secure storage weirdness * Fixed mining vendor scrolling * Arthri review pass 1 * mining vendor double-scroll * fix for RPD, AirAlarm, and Radio * arthri review pass 2 * arthri review pass 3 * sanitize var setting, fix colours, delete unused file * adds CI to branch * god damn AI making random changes * I should remember to compile when changes are made * fixes scrollbar issues * fix camera console, fix flexGrow for sections * CI fix * nanomap fix * Update code/modules/atmospherics/machinery/airalarm.dm * restore margin * style semicolon * TGUIv4 - Moves TGUI Window Sizing from DM to JS (#23524) * Initial commit * Transferring the remaining windows to JS * Resizing part 1 * Resizing part 2 * Some reverts and polish * Forgot that * undeployed nuke window size --------- Co-authored-by: Aylong <alexanderkitsa@gmail.com> * TGUIv4: Remove force_open (#23537) * First state fixes * Removes "force_open" * TGUIv4 - TGUI Version 4.1 (#23547) * Reduced Logging Changes * setSharedState early return for non-interactive UI * TGUI version bump to 4.1 * Fix sending updates for non-interactive UIs * Scalablue UI Stylesheet Changes * CSS Tgui Bundle * JavaScript TGUI Style Changes * Update tgui/packages/tgui/styles/base.scss Co-authored-by: Aylong <69762909+Aylong220@users.noreply.github.com> * Additional changes to Input and Button scalability * TGUI logging proc update * Indentation fix for logging proc * Update code/__HELPERS/_logging.dm Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Additional log_tgui changes --------- Co-authored-by: Aylong <69762909+Aylong220@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * dev server hotfix (#23584) * ui_interact object constructor argument check (#23594) * feat: add smart asset cache, add CDN support for assets, properly group assets (#23585) * feat: add smart asset cache, add CDN support for assets, properly group assets * fix: make tgui actually work * fix: keeping local name for `tgui.bundle.js` and `tgui.bundle.css` for debug and dev server functioning * fix: make `fontawesome` assets finally work * fix: make proper identation for `if` * fix: add `resolveAsset` to `NanoMap.js` * refactor: update `claw_game` and `chess` to new asset framework * refactor/tweak: don't use string concatenation for browser `content` and `head_content`, use list instead. Don't use `common.css` for paper UI, keep local name for stamp image assets, replace hard ref of browser to `atom` (rare case) to `UID` * refactor: remove redundant debug logs * refactor: remove space betwee `if` and `(` * refactor: remove one more redundant log, properly reload UI resources * rafactor: change names of asset files * fix: adjust existing UIs to properly use assets * fix: properly pass args to to `onclose` proc * Update code/modules/asset_cache/transports/asset_transport.dm Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Update code/modules/asset_cache/transports/asset_transport.dm Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * TGUI 4.2: TGchat + Refactor Asset Delivery + Yarn Berry (#23643) * tgchat * Little cleanup * Refactor Asset Delivery (Part 2) * Little tweaks * fix code styling issues * fix file name duplications * Browser window options fix @gaxeer * transfer valve fixes * yarn berry initial * vsc tasks * yarn berry working * node 20 * fix dev server (lol wrong yarn) * bloody regressions * fixes that damn scrolltracking bug * Some tweaks and flexGrow deletions It still doesn't work as it should, which makes me nervous * remove unneeded deps * 514 regression fix * change stuff to not conflict with other servers * name it as requested --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * revert test_TGUI map addition * TGUI 4.3: Stack, Webpack 5 & UI Tweaks, Yarn 3.6.4, TS support, Jest (#23677) * Stack & UI's Refactor Almost final, polish required Stack & UI's Refactor (Part 1) Stack & UI's Refactor (Part 2) Stack & UI's Refactor (Part 3) * Prettier Maybe bad * ClearChat & some tweaks * Adds a Chat Reliability Layer https://github.com/tgstation/tgstation/pull/79479 * Fix chat BSOD https://github.com/tgstation/tgstation/pull/79821 * WebPack 5 (Didn't work) I hate this shit * Yarn 3.6.4 * make it all work * revert snowflake fix * Stories * adds TS support * re-enable test and prettier * update yarn sdk's * Fix some box regression * ping/reply * Fixes regressions and some things * Zebra and Fix chat button transfer +rebuild * make VSC use the proper local typescript lib * Popper Tooltips https://github.com/tgstation/tgstation/pull/58980 * Popper Tooltips performancy fixes * Dropdown v2 https://github.com/tgstation/tgstation/pull/75164 Without Icon.tsx * BB test map * run build --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * we moved these * change test values * ignore scss files * change hash function * TGUIv4: TGchat fix traitor codeword highlighting (#23720) * Codeword highlighting for TGUIv4 * null safeties * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * TGUIv4 - updates standalone build tooling (#23721) * swap `xxhash64` for `md4` * remove hash function * remove old file * TGUI 4.3+4.4: Newscaster fix, `inline-block` replacements and other fixes (#23722) * TGUI 4.3 fixes Newscaster fix + inline-blocks * Be gone Box * Mod Chat -> Mentor Chat * Some warning filters * Rebuild * Delete tgui-common.bundle.js * please work * try it like this * 4.3.1 * 4.3.2 * fix * i forgot to build * 4.4.0 * give me more diff details please so I can fix you * its not binary pls git * test without svgs * removes an un-needed SVG file * inlined SVGs test * fix code styling * comment these --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * TGUIv4 - Removes resizable and improves drag code (#23719) * Initial commit * bundle rebuild * Fixes Radio Sizing * Updates Radio sizing to fix wrapping issues * fix dev server --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * fix hotkeys not being passed to BYOND * Apply suggestions from code review * bump deps * forgot these deps * ci fix * ChemDispenser fixes and HoloControl cooldown * Station Traits TGUI +Rebuild * CI * fix CI for real this time * I have no idea * fix station trait panel * Update code/controllers/subsystem/SSping.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Update code/controllers/subsystem/SSticker.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Update code/controllers/subsystem/SSping.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * deterministic module IDs * TGUI fixes. Again... (#23762) * TGUI Fixes: Part 1 ORM icon for reinforced glass now showing correctly Mining vendor moved to Stack Exofab UI buttons descended from the heavens to the earth * TGUI Fixes: Part 2 DestTagger now works, forgot import LabeledList PowerMonitor graph displays correct Request Console updated to 2.0, BUT, problem with message priority, it was there before the changes, maybe even before the project, I'll have to check it out * TGUI Fixes: Part 2 Fixed `onEnter` input Fixed Cloning Console storage (Im dumbass) Some windows resizing Fixed bad picture in security and medical records console Fixed scrollable dropdown Added translucent color for buttons * Fucking uplink DONE, and Button.Input fix * NT Recruiter and Uplink polish * Del LabeledList from dest. tagger * ChemMaster and OreRedemption log deletion * Update test_tiny.dmm * Translucent button story * Filter for SQL error * del: `log_debug` in `hear_say.dm` * Some little fixes and SpecMenu Stack * Panel.js: mx -> mr * fix ghost spawners * null check --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * fix material name in protolathe * fix various UI interacts * card machine runtime fix * remove legacy folders * TGUIv4 - TGchat Theme Adjustments (#23772) * Initial commit * Changes rule grouping * Robot class style changes and webpack config * Reverts webpack/font changes and subs robot font * revert a state changed in error * fix uninteractable UIs due to chunky fingers * TGUIv4: More fixes, tweaks and fixes for tweaks (#23781) * I fuckin hate PDA * Vending * Add `|` to highlight splitters and some light mode tweaks * Teleporter rewrite * APC and AiAirlock (God forgive me) * clarify highlight syntax --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * TGUIv4 - Abductor Experiment Machine TGUI (#23776) * Experiment Console TGUI * Update for TGUIv4 * UI Size adjustment * ui state and ghost attack update * remove this --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * fix * TGUIv4 - Adjustments, Fixes, and Tweaks (#23785) * Photocopier layout adjustments * Autolathe Text and Button spacing adjustment * Hotkey fix for moving bug * Removes rule sets for visited links * Fixes ordering multiples on cargo console * fix possible wonky json payloads * fix admin log input list stuff * TGUIv4: Reconnect fix and some other fixes + tweaks (#23790) * Fix reconnecting and transfer it to TSX * RPD polish * RCD, AccessList, GuestPass * Focus reset fix when camera switched. God forgive me again... * Purple box and identation fixes For votes and health scanner * ChemMaster and ChemDispenser ChemMaster - translucent pills buttons and no grow produce section ChemDuspenser - dynamic height * ShuttleManipulator Tabs * RCD buttons * make input bar mode more prominent * fix chem master icons * tab fix * Properly sanitizes loaded messages in tgui chat * TGUIv4 - Adjustments, Fixes, and Tweaks v2 (#23795) * Fixes icon spacing for nanobank tabs * Tweaks Dropdown styling * Fixes sending stuff to old chat * OpenDream TGUI fix * Resizes Station Traits window * Adjusts health analyzer messages for chat tabs * Revert "Properly sanitizes loaded messages in tgui chat" This reverts commit4c32a7094a. * Revert "Revert "Properly sanitizes loaded messages in tgui chat"" This reverts commit24afa55922. * Changes how tgui handles static data * Reenable no-undef rule. Enable Format On Save for VSCode (#23803) * Enable Format On Save for VSCode * Re-enable and fix no-undef --------- Co-authored-by: Arthri <41360489+a@users.noreply.github.com> * pda scanner message improvements * fix mentor/admin PMs being sent to the "unsorted" category * fix garbled custom vote messages * moves cyborg analyser to use chatboxes * fixes regression * Prevent F5 reload * TGUIv4: Themes polish and some new ones + misc fixes (#23814) * Little themes tweaks * NTOS chat theme * Update tgui-panel.bundle.js * Capitalize themes * Paradise theme v1.0 * Little StationTraitsPanel cleanup * Update member_content.dmi * NoCapitalize * Rebuild * Delete Paradise.scss * Create paradise.scss * Forgot * Rewritten Security Records Console For Jesus fucking christ... * Vending and Wires sizes tweaks * ThermoMachine * Syndicate Theme * Little darker * Rewritten Medical Records Console * PDA Nanobank fix * Syndicate Theme Darker * Rebuild TGUI * Wires section grow fix * fixes the enshittified paradise icon * Sirryan+Warrior reviews * bloody define comments * comment correction * unprivate these * errant . begone (how did this not cause a compiler error) * TGUIv4 - Adjustments, Fixes, and Tweaks v3 (#23807) * Fixes ERT Manager silenced message function * Adjusts progress bar on ExosuitFabricator * Sets Dropdown selected to align left * Removes the use of self_state select interfaces * Exosuit Fabricator style adjustments * fix sextractor UI * remove empty tochat string * fix human air alarm interactions * fix modals * add F12/IEChooser --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Co-authored-by: Aylong <alexanderkitsa@gmail.com> Co-authored-by: Aylong <69762909+Aylong220@users.noreply.github.com> Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Arthri <41360489+Arthri@users.noreply.github.com> Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
This commit is contained in:
co-authored by
Arthri
Burzah
Aylong
Aylong
Gaxeer
DGamerL
Arthri
parent
98638f1d38
commit
22fbd9aced
@@ -1,337 +0,0 @@
|
||||
/*
|
||||
Asset cache quick users guide:
|
||||
|
||||
Make a datum at the bottom of this file with your assets for your thing.
|
||||
The simple subsystem will most like be of use for most cases.
|
||||
Then call get_asset_datum() with the type of the datum you created and store the return
|
||||
Then call .send(client) on that stored return value.
|
||||
|
||||
You can set verify to TRUE if you want send() to sleep until the client has the assets.
|
||||
*/
|
||||
|
||||
|
||||
// Amount of time(ds) MAX to send per asset, if this get exceeded we cancel the sleeping.
|
||||
// This is doubled for the first asset, then added per asset after
|
||||
#define ASSET_CACHE_SEND_TIMEOUT 7
|
||||
|
||||
//When sending mutiple assets, how many before we give the client a quaint little sending resources message
|
||||
#define ASSET_CACHE_TELL_CLIENT_AMOUNT 8
|
||||
|
||||
//When passively preloading assets, how many to send at once? Too high creates noticable lag where as too low can flood the client's cache with "verify" files
|
||||
#define ASSET_CACHE_PRELOAD_CONCURRENT 3
|
||||
|
||||
/client
|
||||
var/list/cache = list() // List of all assets sent to this client by the asset cache.
|
||||
var/list/completed_asset_jobs = list() // List of all completed jobs, awaiting acknowledgement.
|
||||
var/list/sending = list()
|
||||
var/last_asset_job = 0 // Last job done.
|
||||
|
||||
//This proc sends the asset to the client, but only if it needs it.
|
||||
//This proc blocks(sleeps) unless verify is set to false
|
||||
/proc/send_asset(client/client, asset_name, verify = TRUE)
|
||||
if(!istype(client))
|
||||
if(ismob(client))
|
||||
var/mob/M = client
|
||||
if(M.client)
|
||||
client = M.client
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
if(client.cache.Find(asset_name) || client.sending.Find(asset_name))
|
||||
return 0
|
||||
|
||||
client << browse_rsc(SSassets.cache[asset_name], asset_name)
|
||||
if(!verify) // Can't access the asset cache browser, rip.
|
||||
client.cache += asset_name
|
||||
return 1
|
||||
|
||||
client.sending |= asset_name
|
||||
var/job = ++client.last_asset_job
|
||||
|
||||
client << browse({"
|
||||
<script>
|
||||
window.location.href="?asset_cache_confirm_arrival=[job]"
|
||||
</script>
|
||||
"}, "window=asset_cache_browser")
|
||||
|
||||
var/t = 0
|
||||
var/timeout_time = (ASSET_CACHE_SEND_TIMEOUT * client.sending.len) + ASSET_CACHE_SEND_TIMEOUT
|
||||
while(client && !client.completed_asset_jobs.Find(job) && t < timeout_time) // Reception is handled in Topic()
|
||||
sleep(1) // Lock up the caller until this is received.
|
||||
t++
|
||||
|
||||
if(client)
|
||||
client.sending -= asset_name
|
||||
client.cache |= asset_name
|
||||
client.completed_asset_jobs -= job
|
||||
|
||||
return 1
|
||||
|
||||
//This proc blocks(sleeps) unless verify is set to false
|
||||
/proc/send_asset_list(client/client, list/asset_list, verify = TRUE)
|
||||
if(!istype(client))
|
||||
if(ismob(client))
|
||||
var/mob/M = client
|
||||
if(M.client)
|
||||
client = M.client
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
else
|
||||
return 0
|
||||
|
||||
var/list/unreceived = asset_list - (client.cache + client.sending)
|
||||
if(!unreceived || !unreceived.len)
|
||||
return 0
|
||||
if(unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
|
||||
to_chat(client, "Sending Resources...")
|
||||
for(var/asset in unreceived)
|
||||
if(asset in SSassets.cache)
|
||||
client << browse_rsc(SSassets.cache[asset], asset)
|
||||
|
||||
if(!verify) // Can't access the asset cache browser, rip.
|
||||
client.cache += unreceived
|
||||
return 1
|
||||
|
||||
client.sending |= unreceived
|
||||
var/job = ++client.last_asset_job
|
||||
|
||||
client << browse({"
|
||||
<script>
|
||||
window.location.href="?asset_cache_confirm_arrival=[job]"
|
||||
</script>
|
||||
"}, "window=asset_cache_browser")
|
||||
|
||||
var/t = 0
|
||||
var/timeout_time = ASSET_CACHE_SEND_TIMEOUT * client.sending.len
|
||||
while(client && !client.completed_asset_jobs.Find(job) && t < timeout_time) // Reception is handled in Topic()
|
||||
sleep(1) // Lock up the caller until this is received.
|
||||
t++
|
||||
|
||||
if(client)
|
||||
client.sending -= unreceived
|
||||
client.cache |= unreceived
|
||||
client.completed_asset_jobs -= job
|
||||
|
||||
return 1
|
||||
|
||||
//This proc will download the files without clogging up the browse() queue, used for passively sending files on connection start.
|
||||
//The proc calls procs that sleep for long times.
|
||||
/proc/getFilesSlow(client/client, list/files, register_asset = TRUE)
|
||||
var/concurrent_tracker = 1
|
||||
for(var/file in files)
|
||||
if(!client)
|
||||
break
|
||||
if(register_asset)
|
||||
register_asset(file, files[file])
|
||||
if(concurrent_tracker >= ASSET_CACHE_PRELOAD_CONCURRENT)
|
||||
concurrent_tracker = 1
|
||||
send_asset(client, file)
|
||||
else
|
||||
concurrent_tracker++
|
||||
send_asset(client, file, verify = FALSE)
|
||||
sleep(0) //queuing calls like this too quickly can cause issues in some client versions
|
||||
|
||||
//This proc "registers" an asset, it adds it to the cache for further use, you cannot touch it from this point on or you'll fuck things up.
|
||||
//if it's an icon or something be careful, you'll have to copy it before further use.
|
||||
/proc/register_asset(asset_name, asset)
|
||||
SSassets.cache[asset_name] = asset
|
||||
|
||||
//These datums are used to populate the asset cache, the proc "register()" does this.
|
||||
|
||||
//all of our asset datums, used for referring to these later
|
||||
GLOBAL_LIST_EMPTY(asset_datums)
|
||||
|
||||
//get a assetdatum or make a new one
|
||||
/proc/get_asset_datum(type)
|
||||
if(!(type in GLOB.asset_datums))
|
||||
return new type()
|
||||
return GLOB.asset_datums[type]
|
||||
|
||||
/datum/asset/New()
|
||||
GLOB.asset_datums[type] = src
|
||||
|
||||
/datum/asset/proc/register()
|
||||
return
|
||||
|
||||
/datum/asset/proc/send(client)
|
||||
return
|
||||
|
||||
//If you don't need anything complicated.
|
||||
/datum/asset/simple
|
||||
var/assets = list()
|
||||
var/verify = FALSE
|
||||
|
||||
/datum/asset/simple/register()
|
||||
for(var/asset_name in assets)
|
||||
register_asset(asset_name, assets[asset_name])
|
||||
/datum/asset/simple/send(client)
|
||||
send_asset_list(client,assets,verify)
|
||||
|
||||
|
||||
//DEFINITIONS FOR ASSET DATUMS START HERE.
|
||||
/datum/asset/simple/tgui
|
||||
assets = list(
|
||||
"tgui.bundle.js" = 'tgui/packages/tgui/public/tgui.bundle.js',
|
||||
"tgui.bundle.css" = 'tgui/packages/tgui/public/tgui.bundle.css'
|
||||
)
|
||||
|
||||
/datum/asset/simple/paper
|
||||
assets = list(
|
||||
"large_stamp-clown.png" = 'icons/paper_icons/large_stamp-clown.png',
|
||||
"large_stamp-deny.png" = 'icons/paper_icons/large_stamp-deny.png',
|
||||
"large_stamp-ok.png" = 'icons/paper_icons/large_stamp-ok.png',
|
||||
"large_stamp-hop.png" = 'icons/paper_icons/large_stamp-hop.png',
|
||||
"large_stamp-cmo.png" = 'icons/paper_icons/large_stamp-cmo.png',
|
||||
"large_stamp-ce.png" = 'icons/paper_icons/large_stamp-ce.png',
|
||||
"large_stamp-hos.png" = 'icons/paper_icons/large_stamp-hos.png',
|
||||
"large_stamp-rd.png" = 'icons/paper_icons/large_stamp-rd.png',
|
||||
"large_stamp-cap.png" = 'icons/paper_icons/large_stamp-cap.png',
|
||||
"large_stamp-qm.png" = 'icons/paper_icons/large_stamp-qm.png',
|
||||
"large_stamp-law.png" = 'icons/paper_icons/large_stamp-law.png',
|
||||
"large_stamp-cent.png" = 'icons/paper_icons/large_stamp-cent.png',
|
||||
"large_stamp-syndicate.png" = 'icons/paper_icons/large_stamp-syndicate.png',
|
||||
"large_stamp-rep.png" = 'icons/paper_icons/large_stamp-rep.png',
|
||||
"large_stamp-magistrate.png"= 'icons/paper_icons/large_stamp-magistrate.png',
|
||||
"talisman.png" = 'icons/paper_icons/talisman.png',
|
||||
"ntlogo.png" = 'icons/paper_icons/ntlogo.png',
|
||||
"syndielogo.png" ='icons/paper_icons/syndielogo.png'
|
||||
)
|
||||
|
||||
/datum/asset/simple/chess
|
||||
assets = list(
|
||||
"bishop_black.png" = 'icons/chess_pieces/bishop_black.png',
|
||||
"bishop_white.png" = 'icons/chess_pieces/bishop_white.png',
|
||||
"king_black.png" = 'icons/chess_pieces/king_black.png',
|
||||
"king_white.png" = 'icons/chess_pieces/king_white.png',
|
||||
"knight_black.png" = 'icons/chess_pieces/knight_black.png',
|
||||
"knight_white.png" = 'icons/chess_pieces/knight_white.png',
|
||||
"pawn_black.png" = 'icons/chess_pieces/pawn_black.png',
|
||||
"pawn_white.png" = 'icons/chess_pieces/pawn_white.png',
|
||||
"queen_black.png" = 'icons/chess_pieces/queen_black.png',
|
||||
"queen_white.png" = 'icons/chess_pieces/queen_white.png',
|
||||
"rook_black.png" = 'icons/chess_pieces/rook_black.png',
|
||||
"rook_white.png" = 'icons/chess_pieces/rook_white.png',
|
||||
"sprites.png" = 'icons/chess_pieces/sprites.png',
|
||||
"blank.gif" = 'icons/chess_pieces/blank.gif',
|
||||
"garbochess.js" = 'html/browser/garbochess.js',
|
||||
"boardui.js" = 'html/browser/boardui.js'
|
||||
)
|
||||
|
||||
//Pill sprites for UIs
|
||||
/datum/asset/chem_master
|
||||
var/assets = list()
|
||||
var/verify = FALSE
|
||||
|
||||
/datum/asset/chem_master/register()
|
||||
for(var/i = 1 to 20)
|
||||
assets["pill[i].png"] = icon('icons/obj/chemical.dmi', "pill[i]")
|
||||
for(var/i in list("bottle", "small_bottle", "wide_bottle", "round_bottle", "reagent_bottle"))
|
||||
assets["[i].png"] = icon('icons/obj/chemical.dmi', "[i]")
|
||||
for(var/asset_name in assets)
|
||||
register_asset(asset_name, assets[asset_name])
|
||||
|
||||
/datum/asset/chem_master/send(client)
|
||||
send_asset_list(client, assets, verify)
|
||||
|
||||
//Cloning pod sprites for UIs
|
||||
/datum/asset/cloning
|
||||
var/assets = list()
|
||||
var/verify = FALSE
|
||||
|
||||
/datum/asset/cloning/register()
|
||||
assets["pod_idle.gif"] = icon('icons/obj/cloning.dmi', "pod_idle")
|
||||
assets["pod_cloning.gif"] = icon('icons/obj/cloning.dmi', "pod_cloning")
|
||||
assets["pod_mess.gif"] = icon('icons/obj/cloning.dmi', "pod_mess")
|
||||
for(var/asset_name in assets)
|
||||
register_asset(asset_name, assets[asset_name])
|
||||
|
||||
/datum/asset/cloning/send(client)
|
||||
send_asset_list(client, assets, verify)
|
||||
|
||||
//Pipe sprites for UIs
|
||||
/datum/asset/rpd
|
||||
var/assets = list()
|
||||
var/verify = FALSE
|
||||
|
||||
/datum/asset/rpd/register()
|
||||
for(var/state in icon_states('icons/obj/pipe-item.dmi'))
|
||||
if(!(state in list("cap", "connector", "dtvalve", "dvalve", "filter", "he", "heunary", "injector", "junction", "manifold", "mixer", "tvalve", "mvalve", "passive vent", "passivegate", "pump", "scrubber", "simple", "universal", "uvent", "volumepump"))) //Basically all the pipes we want sprites for
|
||||
continue
|
||||
if(state in list("he", "simple"))
|
||||
for(var/D in GLOB.alldirs)
|
||||
assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipe-item.dmi', state, D)
|
||||
for(var/D in GLOB.cardinal)
|
||||
assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipe-item.dmi', state, D)
|
||||
for(var/state in icon_states('icons/obj/pipes/disposal.dmi'))
|
||||
if(!(state in list("pipe-c", "pipe-j1", "pipe-s", "pipe-t", "pipe-y", "intake", "outlet", "pipe-j1s"))) //Pipes we want sprites for
|
||||
continue
|
||||
for(var/D in GLOB.cardinal)
|
||||
assets["[state]-[dir2text(D)].png"] = icon('icons/obj/pipes/disposal.dmi', state, D)
|
||||
for(var/asset_name in assets)
|
||||
register_asset(asset_name, assets[asset_name])
|
||||
|
||||
/datum/asset/rpd/send(client)
|
||||
send_asset_list(client, assets, verify)
|
||||
|
||||
//Mob Hunt sprites for UIs
|
||||
/datum/asset/mob_hunt
|
||||
var/assets = list()
|
||||
var/verify = FALSE
|
||||
|
||||
/datum/asset/mob_hunt/register()
|
||||
for(var/state in icon_states('icons/effects/mob_hunt.dmi'))
|
||||
if(state == "Placeholder")
|
||||
continue
|
||||
assets["[state].png"] = icon('icons/effects/mob_hunt.dmi', state)
|
||||
for(var/asset_name in assets)
|
||||
register_asset(asset_name, assets[asset_name])
|
||||
|
||||
/datum/asset/mob_hunt/send(client)
|
||||
send_asset_list(client, assets, verify)
|
||||
|
||||
// Fontawesome
|
||||
/datum/asset/simple/fontawesome
|
||||
verify = FALSE
|
||||
assets = list(
|
||||
"fa-regular-400.eot" = 'html/font-awesome/webfonts/fa-regular-400.eot',
|
||||
"fa-regular-400.woff" = 'html/font-awesome/webfonts/fa-regular-400.woff',
|
||||
"fa-solid-900.eot" = 'html/font-awesome/webfonts/fa-solid-900.eot',
|
||||
"fa-solid-900.woff" = 'html/font-awesome/webfonts/fa-solid-900.woff',
|
||||
"font-awesome.css" = 'html/font-awesome/css/all.min.css',
|
||||
"v4shim.css" = 'html/font-awesome/css/v4-shims.min.css'
|
||||
)
|
||||
|
||||
// Nanomaps
|
||||
/datum/asset/simple/nanomaps
|
||||
// It REALLY doesnt matter too much if these arent up to date
|
||||
// They are relatively big
|
||||
verify = FALSE
|
||||
assets = list(
|
||||
"Cyberiad_nanomap_z1.png" = 'icons/_nanomaps/Cyberiad_nanomap_z1.png',
|
||||
"Delta_nanomap_z1.png" = 'icons/_nanomaps/Delta_nanomap_z1.png',
|
||||
"MetaStation_nanomap_z1.png" = 'icons/_nanomaps/MetaStation_nanomap_z1.png',
|
||||
"CereStation_nanomap_z1.png" = 'icons/_nanomaps/CereStation_nanomap_z1.png',
|
||||
)
|
||||
|
||||
/datum/asset/simple/safe
|
||||
verify = FALSE
|
||||
assets = list(
|
||||
"safe_dial.png" = 'icons/safe_dial.png'
|
||||
)
|
||||
|
||||
// Materials (metal, glass...)
|
||||
/datum/asset/simple/materials
|
||||
verify = FALSE
|
||||
|
||||
/datum/asset/simple/materials/register()
|
||||
for(var/n in list("metal", "glass", "silver", "gold", "diamond", "uranium", "plasma", "bananium", "tranquillite", "titanium", "plastic",
|
||||
"rglass", "plasteel", "plastitanium", "plasmaglass", "titaniumglass", "plastitaniumglass"))
|
||||
assets["sheet-[n].png"] = icon('icons/obj/stacks/minerals.dmi', "sheet-[n]")
|
||||
assets["sheet-bluespace.png"] = icon('icons/obj/stacks/minerals.dmi', "bluespace_crystal")
|
||||
..()
|
||||
@@ -71,10 +71,6 @@
|
||||
/// Persistent storage for the flavour text of examined atoms.
|
||||
var/list/description_holders = list()
|
||||
|
||||
// Their chat window, sort of important.
|
||||
// See /goon/code/datums/browserOutput.dm
|
||||
var/datum/chatOutput/chatOutput
|
||||
|
||||
// Donator stuff.
|
||||
var/donator_level = 0
|
||||
|
||||
@@ -103,6 +99,9 @@
|
||||
/// Last world/time that a PM was sent to the player by an admin
|
||||
var/received_discord_pm = -99999 // Yes this super low number is intentional
|
||||
|
||||
///world.time they connected
|
||||
var/connection_time
|
||||
|
||||
/// Has the client accepted the TOS about data collection and other stuff
|
||||
var/tos_consent = FALSE
|
||||
|
||||
|
||||
@@ -50,13 +50,12 @@
|
||||
stack_trace("Got \\ref-based src in topic from [src] for [hsrc_info], should be UID: [href]")
|
||||
|
||||
|
||||
// asset_cache
|
||||
var/asset_cache_job
|
||||
if(href_list["asset_cache_confirm_arrival"])
|
||||
var/job = text2num(href_list["asset_cache_confirm_arrival"])
|
||||
completed_asset_jobs += job
|
||||
return
|
||||
|
||||
if(href_list["_src_"] == "chat")
|
||||
return chatOutput.Topic(href, href_list)
|
||||
asset_cache_job = asset_cache_confirm_arrival(href_list["asset_cache_confirm_arrival"])
|
||||
if(!asset_cache_job)
|
||||
return
|
||||
|
||||
// Rate limiting
|
||||
var/mtl = 100 // 100 topics per minute
|
||||
@@ -156,19 +155,22 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(href_list["__keydown"])
|
||||
var/keycode = href_list["__keydown"]
|
||||
if(keycode)
|
||||
Key_Down(keycode)
|
||||
// Tgui Topic middleware
|
||||
if(tgui_Topic(href_list))
|
||||
return
|
||||
if(href_list["reload_tguipanel"])
|
||||
nuke_chat()
|
||||
|
||||
//byond bug ID:2256651
|
||||
if(asset_cache_job && (asset_cache_job in completed_asset_jobs))
|
||||
to_chat(src, "<span class='danger'> An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)</span>")
|
||||
src << browse("...", "window=asset_cache_browser")
|
||||
return
|
||||
|
||||
if(href_list["__keyup"])
|
||||
var/keycode = href_list["__keyup"]
|
||||
if(keycode)
|
||||
Key_Up(keycode)
|
||||
if(href_list["asset_cache_preload_data"])
|
||||
asset_cache_preload_data(href_list["asset_cache_preload_data"])
|
||||
return
|
||||
|
||||
|
||||
switch(href_list["action"])
|
||||
if("openLink")
|
||||
src << link(href_list["link"])
|
||||
@@ -252,7 +254,7 @@
|
||||
///////////
|
||||
/client/New(TopicData)
|
||||
var/tdata = TopicData //save this for later use
|
||||
chatOutput = new /datum/chatOutput(src) // Right off the bat.
|
||||
tgui_panel = new(src)
|
||||
TopicData = null //Prevent calls to client.Topic from connect
|
||||
|
||||
if(connection != "seeker") //Invalid connection type.
|
||||
@@ -276,7 +278,7 @@
|
||||
to_chat(src, "<span class='warning'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
|
||||
|
||||
GLOB.directory[ckey] = src
|
||||
//Admin Authorisation
|
||||
// Admin Authorisation
|
||||
// Automatically makes localhost connection an admin
|
||||
try_localhost_autoadmin()
|
||||
|
||||
@@ -345,10 +347,7 @@
|
||||
// DO NOT STUFF RANDOM SQL QUERIES BELOW THIS POINT WITHOUT USING `INVOKE_ASYNC()` OR SIMILAR
|
||||
// YOU WILL BREAK STUFF. SERIOUSLY. -aa07
|
||||
GLOB.clients += src
|
||||
|
||||
|
||||
spawn() // Goonchat does some non-instant checks in start()
|
||||
chatOutput.start()
|
||||
connection_time = world.time
|
||||
|
||||
var/_2fa_alert = FALSE // This is so we can display the message where it will be seen
|
||||
if(holder)
|
||||
@@ -361,7 +360,6 @@
|
||||
GLOB.de_admins += ckey
|
||||
|
||||
else
|
||||
on_holder_add()
|
||||
add_admin_verbs()
|
||||
// Must be async because any sleeps (happen in sql queries) will break connectings clients
|
||||
INVOKE_ASYNC(src, PROC_REF(admin_memo_output), "Show", FALSE, TRUE)
|
||||
@@ -391,15 +389,12 @@
|
||||
if(SSinput.initialized)
|
||||
set_macros()
|
||||
|
||||
// Initialize tgui panel
|
||||
tgui_panel.initialize()
|
||||
|
||||
check_ip_intel()
|
||||
send_resources()
|
||||
|
||||
if(prefs.toggles & PREFTOGGLE_UI_DARKMODE) // activates dark mode if its flagged. -AA07
|
||||
activate_darkmode()
|
||||
|
||||
else
|
||||
// activate_darkmode() calls the CL update button proc, so we dont want it double called
|
||||
SSchangelog.UpdatePlayerChangelogButton(src)
|
||||
SSchangelog.UpdatePlayerChangelogButton(src)
|
||||
|
||||
if(show_update_prompt)
|
||||
show_update_notice()
|
||||
@@ -467,7 +462,6 @@
|
||||
#ifdef MULTIINSTANCE
|
||||
SSinstancing.update_playercache() // Clear us out
|
||||
#endif
|
||||
QDEL_NULL(chatOutput)
|
||||
QDEL_NULL(pai_save)
|
||||
|
||||
if(movingmob)
|
||||
@@ -476,6 +470,7 @@
|
||||
|
||||
SSambience.ambience_listening_clients -= src
|
||||
SSinput.processing -= src
|
||||
SSping.current_run -= src
|
||||
Master.UpdateTickRate()
|
||||
..() //Even though we're going to be hard deleted there are still some things that want to know the destroy is happening
|
||||
return QDEL_HINT_HARDDEL_NOW
|
||||
@@ -906,19 +901,17 @@
|
||||
// Change the way they should download resources.
|
||||
if(length(GLOB.configuration.url.rsc_urls))
|
||||
preload_rsc = pick(GLOB.configuration.url.rsc_urls)
|
||||
|
||||
else
|
||||
preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
||||
|
||||
// Most assets are now handled through global_cache.dm
|
||||
getFiles(
|
||||
'html/search.js', // Used in various non-TGUI HTML windows for search functionality
|
||||
'html/panels.css' // Used for styling certain panels, such as in the new player panel
|
||||
)
|
||||
|
||||
spawn (10) //removing this spawn causes all clients to not get verbs.
|
||||
|
||||
//load info on what assets the client has
|
||||
src << browse('code/modules/asset_cache/validate_assets.html', "window=asset_cache_browser")
|
||||
|
||||
//Precache the client with all other assets slowly, so as to not block other browse() calls
|
||||
getFilesSlow(src, SSassets.preload, register_asset = FALSE)
|
||||
if(GLOB.configuration.asset_cache.asset_simple_preload)
|
||||
addtimer(CALLBACK(SSassets.transport, TYPE_PROC_REF(/datum/asset_transport, send_assets_slow), src, SSassets.transport.preload), 5 SECONDS)
|
||||
|
||||
//For debugging purposes
|
||||
/client/proc/list_all_languages()
|
||||
@@ -937,72 +930,6 @@
|
||||
/client/proc/on_varedit()
|
||||
var_edited = TRUE
|
||||
|
||||
/////////////////
|
||||
// DARKMODE UI //
|
||||
/////////////////
|
||||
// IF YOU CHANGE ANYTHING IN ACTIVATE, MAKE SURE IT HAS A DEACTIVATE METHOD, -AA07
|
||||
/client/proc/activate_darkmode()
|
||||
///// BUTTONS /////
|
||||
SSchangelog.UpdatePlayerChangelogButton(src)
|
||||
/* Rpane */
|
||||
winset(src, "rpane.textb", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.infob", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.wikib", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.forumb", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.rulesb", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.githubb", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "rpane.webmap", "background-color=#494949;text-color=#a4bad6")
|
||||
/* Outputwindow */
|
||||
winset(src, "outputwindow.saybutton", "background-color=#494949;text-color=#a4bad6")
|
||||
winset(src, "outputwindow.mebutton", "background-color=#494949;text-color=#a4bad6")
|
||||
///// UI ELEMENTS /////
|
||||
/* Mainwindow */
|
||||
winset(src, "mainwindow", "background-color=#171717")
|
||||
winset(src, "mainwindow.mainvsplit", "background-color=#202020")
|
||||
winset(src, "mainwindow.tooltip", "background-color=#171717")
|
||||
/* Outputwindow */
|
||||
winset(src, "outputwindow", "background-color=#202020")
|
||||
winset(src, "outputwindow.browseroutput", "background-color=#202020")
|
||||
/* Rpane */
|
||||
winset(src, "rpane", "background-color=#202020")
|
||||
winset(src, "rpane.rpanewindow", "background-color=#202020")
|
||||
/* Infowindow */
|
||||
winset(src, "infowindow", "background-color=#202020;text-color=#a4bad6")
|
||||
winset(src, "infowindow.info", "background-color=#171717;text-color=#a4bad6;highlight-color=#009900;tab-text-color=#a4bad6;tab-background-color=#202020")
|
||||
// NOTIFY USER
|
||||
to_chat(src, "<span class='notice'>Darkmode Enabled</span>")
|
||||
|
||||
/client/proc/deactivate_darkmode()
|
||||
///// BUTTONS /////
|
||||
SSchangelog.UpdatePlayerChangelogButton(src)
|
||||
/* Rpane */
|
||||
winset(src, "rpane.textb", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.infob", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.wikib", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.forumb", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.rulesb", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.githubb", "background-color=none;text-color=#000000")
|
||||
winset(src, "rpane.webmap", "background-color=none;text-color=#000000")
|
||||
/* Outputwindow */
|
||||
winset(src, "outputwindow.saybutton", "background-color=none;text-color=#000000")
|
||||
winset(src, "outputwindow.mebutton", "background-color=none;text-color=#000000")
|
||||
///// UI ELEMENTS /////
|
||||
/* Mainwindow */
|
||||
winset(src, "mainwindow", "background-color=none")
|
||||
winset(src, "mainwindow.mainvsplit", "background-color=none")
|
||||
winset(src, "mainwindow.tooltip", "background-color=none")
|
||||
/* Outputwindow */
|
||||
winset(src, "outputwindow", "background-color=none")
|
||||
winset(src, "outputwindow.browseroutput", "background-color=none")
|
||||
/* Rpane */
|
||||
winset(src, "rpane", "background-color=none")
|
||||
winset(src, "rpane.rpanewindow", "background-color=none")
|
||||
/* Infowindow */
|
||||
winset(src, "infowindow", "background-color=none;text-color=#000000")
|
||||
winset(src, "infowindow.info", "background-color=none;text-color=#000000;highlight-color=#007700;tab-text-color=#000000;tab-background-color=none")
|
||||
///// NOTIFY USER /////
|
||||
to_chat(src, "<span class='notice'>Darkmode Disabled</span>") // what a sick fuck
|
||||
|
||||
/client/proc/generate_clickcatcher()
|
||||
if(!void)
|
||||
void = new()
|
||||
@@ -1028,6 +955,8 @@
|
||||
|
||||
#undef SSD_WARNING_TIMER
|
||||
|
||||
|
||||
//
|
||||
/client/verb/resend_ui_resources()
|
||||
set name = "Reload UI Resources"
|
||||
set desc = "Reload your UI assets if they are not working"
|
||||
@@ -1037,7 +966,7 @@
|
||||
to_chat(usr, "<span class='warning'>You requested your UI resource files too quickly. Please try again in [(last_ui_resource_send - world.time)/10] seconds.</span>")
|
||||
return
|
||||
|
||||
var/choice = alert(usr, "This will reload your TGUI resources. If you have any open UIs this may break them. Are you sure?", "Resource Reloading", "Yes", "No")
|
||||
var/choice = alert(usr, "This will reload your TGUI resources. If you have any open UIs, they will be closed. Are you sure?", "Resource Reloading", "Yes", "No")
|
||||
if(choice == "Yes")
|
||||
// 600 deciseconds = 1 minute
|
||||
last_ui_resource_send = world.time + 60 SECONDS
|
||||
@@ -1045,18 +974,9 @@
|
||||
// Close their open UIs
|
||||
SStgui.close_user_uis(usr)
|
||||
|
||||
// Resend the resources
|
||||
|
||||
var/datum/asset/tgui_assets = get_asset_datum(/datum/asset/simple/tgui)
|
||||
tgui_assets.register()
|
||||
|
||||
var/datum/asset/nanomaps = get_asset_datum(/datum/asset/simple/nanomaps)
|
||||
nanomaps.register()
|
||||
|
||||
// Clear the user's cache so they get resent.
|
||||
// This is not fully clearing their BYOND cache, just their assets sent from the server this round
|
||||
cache = list()
|
||||
|
||||
sent_assets = list()
|
||||
to_chat(usr, "<span class='notice'>UI resource files resent successfully. If you are still having issues, please try manually clearing your BYOND cache. <b>This can be achieved by opening your BYOND launcher, pressing the cog in the top right, selecting preferences, going to the Games tab, and pressing 'Clear Cache'.</b></span>")
|
||||
|
||||
|
||||
|
||||
@@ -254,18 +254,6 @@
|
||||
prefs.current_tab = 1
|
||||
prefs.ShowChoices(usr)
|
||||
|
||||
/client/verb/toggle_darkmode()
|
||||
set name = "Toggle Darkmode"
|
||||
set category = "Preferences"
|
||||
set desc = "Toggles UI style between dark and light"
|
||||
prefs.toggles ^= PREFTOGGLE_UI_DARKMODE
|
||||
prefs.save_preferences(src)
|
||||
if(prefs.toggles & PREFTOGGLE_UI_DARKMODE)
|
||||
activate_darkmode()
|
||||
else
|
||||
deactivate_darkmode()
|
||||
SSblackbox.record_feedback("tally", "toggle_verbs", 1, "Toggle Darkmode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/verb/toggle_popup_limiter()
|
||||
set name = "Toggle Text Popup Limiter"
|
||||
set category = "Preferences"
|
||||
|
||||
Reference in New Issue
Block a user