mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
Browser/TGUI Stat Panels (#24065)
* initial commit (broken)
* load the html
* fix this
* Fix various issues with browser statpanel
* Fix Alt Clicking opening up a window and Add back some object verbs to the browser stat panel
* Optimize stat panel and fix guardian verbs
* Restyles Stat Panel, Adds Subpanel Sub-Categories
* Use better layout for verbs in stat panel
* Updates statpanel verb widths to be more dynamic at higher screen resolutions.
* Adjust stat panel grid item widths and breakpoints
* refactors statpanel to use tgui API
* CI moment
* more CI
* this stupid thing
* Apply suggestions from code review
Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
* Update code/modules/client/client_procs.dm
* ci fix
* emergency mc debug view
* temp revert some code change suggestions due to massive runtiming
* proper atom click topic implementation
* optimise
* mob clicking in stat panels work
* yeet spell tab thingy
* yeet simple stat panel pref
* allow insertion of html into MC tab content
* tidy up status tab
* Apply suggestions from code review
* fix this
* fix CI
* oops
* fix index runtime
* fixes MC tab showing up for mentors, fixes runtime
* safeties!
* Return of theme support
* more fixes
* fix view range pref, tidy prefs tab
* Remove old stat panel from themes
* fixes
* make sure verbs don't go missing
* fix ooc/looc breaking
* Revert "make sure verbs don't go missing"
This reverts commit 7d07ad45ed.
* fix this properly
* fix stat panel hitting rate limiters
* fix borg status tab
* Object Window Niceties
* Adds file cycling for icon2base64
* optimizes icon2html() for icon files known to be in the rsc at compile time
* CI moment
* remove dupe emergency shuttle timers
* more robust verb updates
* statpanel tweaks
* zip archived changelog to avoid search results
* optimise
* fix mentor chat wonkyness when disabled
* debug log moment
* i am very smart
* reintroduce this because it was needed
* better time listings
* less jank
* stops telling admins they arent mentors
* returns MC tab pref for admins
* Update code/controllers/subsystem/SSstatpanel.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
* lewcc
* OD typemaker prep
---------
Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Aylong <alexanderkitsa@gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
co-authored by
GDN
Burzah
Luc
Aylong
parent
19a3f768c8
commit
91660824fa
@@ -0,0 +1,59 @@
|
||||
/// This component behaves similar to connect_loc_behalf, but working off clients and mobs instead of loc
|
||||
/// To be clear, we hook into a signal on a tracked client's mob
|
||||
/// We retain the ability to react to that signal on a seperate listener, which makes this quite powerful
|
||||
/datum/component/connect_mob_behalf
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
|
||||
/// An assoc list of signal -> procpath to register to the mob our client "owns"
|
||||
var/list/connections
|
||||
/// The master client we're working with
|
||||
var/client/tracked
|
||||
/// The mob we're currently tracking
|
||||
var/mob/tracked_mob
|
||||
|
||||
/datum/component/connect_mob_behalf/Initialize(client/tracked, list/connections)
|
||||
. = ..()
|
||||
if(!istype(tracked))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
src.connections = connections
|
||||
src.tracked = tracked
|
||||
|
||||
/datum/component/connect_mob_behalf/RegisterWithParent()
|
||||
RegisterSignal(tracked, COMSIG_PARENT_QDELETING, PROC_REF(handle_tracked_qdel))
|
||||
update_signals()
|
||||
|
||||
/datum/component/connect_mob_behalf/UnregisterFromParent()
|
||||
unregister_signals()
|
||||
UnregisterSignal(tracked, COMSIG_PARENT_QDELETING)
|
||||
|
||||
tracked = null
|
||||
tracked_mob = null
|
||||
|
||||
/datum/component/connect_mob_behalf/proc/handle_tracked_qdel()
|
||||
SIGNAL_HANDLER
|
||||
qdel(src)
|
||||
|
||||
/datum/component/connect_mob_behalf/proc/update_signals()
|
||||
unregister_signals()
|
||||
// Yes this is a runtime silencer
|
||||
// We could be in a position where logout is sent to two things, one thing intercepts it, then deletes the client's new mob
|
||||
// It's rare, and the same check in connect_loc_behalf is more fruitful, but it's still worth doing
|
||||
if(QDELETED(tracked?.mob))
|
||||
return
|
||||
tracked_mob = tracked.mob
|
||||
RegisterSignal(tracked_mob, COMSIG_MOB_LOGOUT, PROC_REF(on_logout))
|
||||
for(var/signal in connections)
|
||||
parent.RegisterSignal(tracked_mob, signal, connections[signal])
|
||||
|
||||
/datum/component/connect_mob_behalf/proc/unregister_signals()
|
||||
if(isnull(tracked_mob))
|
||||
return
|
||||
|
||||
parent.UnregisterSignal(tracked_mob, connections)
|
||||
UnregisterSignal(tracked_mob, COMSIG_MOB_LOGOUT)
|
||||
|
||||
tracked_mob = null
|
||||
|
||||
/datum/component/connect_mob_behalf/proc/on_logout(mob/source)
|
||||
SIGNAL_HANDLER
|
||||
update_signals()
|
||||
@@ -91,7 +91,6 @@
|
||||
. += "---"
|
||||
|
||||
/client/proc/debug_variables(datum/D in world)
|
||||
set category = "Debug"
|
||||
set name = "\[Admin\] View Variables"
|
||||
|
||||
var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round.
|
||||
@@ -1097,7 +1096,7 @@
|
||||
if(!verb || verb == "Cancel")
|
||||
return
|
||||
else
|
||||
H.verbs += verb
|
||||
add_verb(H, verb)
|
||||
message_admins("[key_name_admin(usr)] has given [key_name_admin(H)] the verb [verb]")
|
||||
log_admin("[key_name(usr)] has given [key_name(H)] the verb [verb]")
|
||||
|
||||
@@ -1116,7 +1115,7 @@
|
||||
if(!verb)
|
||||
return
|
||||
else
|
||||
H.verbs -= verb
|
||||
remove_verb(H, verb)
|
||||
message_admins("[key_name_admin(usr)] has removed verb [verb] from [key_name_admin(H)]")
|
||||
log_admin("[key_name(usr)] has removed verb [verb] from [key_name(H)]")
|
||||
|
||||
|
||||
@@ -52,18 +52,18 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
//MIND TRANSFER BEGIN
|
||||
if(caster.mind.special_verbs.len)//If the caster had any special verbs, remove them from the mob verb list.
|
||||
for(var/V in caster.mind.special_verbs)//Since the caster is using an object spell system, this is mostly moot.
|
||||
caster.verbs -= V//But a safety nontheless.
|
||||
remove_verb(caster, V) //But a safety nontheless.
|
||||
|
||||
if(victim.mind.special_verbs.len)//Now remove all of the victim's verbs.
|
||||
for(var/V in victim.mind.special_verbs)
|
||||
victim.verbs -= V
|
||||
remove_verb(victim, V)
|
||||
|
||||
var/mob/dead/observer/ghost = victim.ghostize(0)
|
||||
caster.mind.transfer_to(victim)
|
||||
|
||||
if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster.
|
||||
for(var/V in caster.mind.special_verbs)//Not too important but could come into play.
|
||||
caster.verbs += V
|
||||
add_verb(caster, V)
|
||||
|
||||
ghost.mind.transfer_to(caster)
|
||||
if(ghost.key)
|
||||
@@ -73,7 +73,7 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
|
||||
if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here.
|
||||
for(var/V in caster.mind.special_verbs)
|
||||
caster.verbs += V
|
||||
add_verb(caster, V)
|
||||
//MIND TRANSFER END
|
||||
|
||||
//Here we paralyze both mobs and knock them out for a time.
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// Clickable stat() button
|
||||
/obj/effect/statclick
|
||||
flags = NO_SCREENTIPS
|
||||
var/target
|
||||
|
||||
INITIALIZE_IMMEDIATE(/obj/effect/statclick)
|
||||
|
||||
/obj/effect/statclick/Initialize(mapload, text, target)
|
||||
. = ..()
|
||||
name = text
|
||||
src.target = target
|
||||
|
||||
/obj/effect/statclick/proc/update(text)
|
||||
name = text
|
||||
return src
|
||||
|
||||
/obj/effect/statclick/debug
|
||||
var/class
|
||||
|
||||
/obj/effect/statclick/debug/Click()
|
||||
if(!check_rights(R_DEBUG|R_VIEWRUNTIMES) || !target)
|
||||
return
|
||||
if(!class)
|
||||
if(istype(target, /datum/controller/subsystem))
|
||||
class = "subsystem"
|
||||
else if(istype(target, /datum/controller))
|
||||
class = "controller"
|
||||
else if(istype(target, /datum))
|
||||
class = "datum"
|
||||
else
|
||||
class = "unknown"
|
||||
|
||||
usr.client.debug_variables(target)
|
||||
message_admins("Admin [key_name_admin(usr)] is debugging the [target] [class].")
|
||||
Reference in New Issue
Block a user