Ports action button refactor from /tg/ (#24482)

* add the new stuff

* guh

* add the brunt of it

* action button stuff

* adds a lot of other stuff

* careful find and replace

* it loads

* so many huds

* ehh yeah this kinda works

* fixes this runtime

* hacks in some DMI stuff, we'll fix it later

* Adds better mouse pointer for dragging buttons

* gets dragging into place working again, updates DMI

* moves define

* remove extra hud defines, now it compiles

* CHECK GREP

* owww

* rename action defines

* ticks

* are we good

* let's try that again

* renames mob vars

* renames

* fixes some hud issues with huds getting the wrong variable

* fixes some alignment issues

* Adds mouse-wheel scroll support

* left -> right

* I am the entire circus

* first self-review pass

* Another review pass -- just realized I need to fix keybinds

* more testing

* update icons

* oops

* Fix spell icons not appearing properly

* fixes some outstanding issues
- Action button backgrounds now work properly
- Fixes some runtimes on dropping
- Fixes some misplaced icons

* hmm

* weh

* again?

* nah?

* maybe this?

* asdf

* should finally fix CI

* add client check

* move the ?

* add missing override causing runtimes

* shift-clicking now doesn't trigger the button

* better docs
This commit is contained in:
Luc
2024-03-24 17:38:53 +00:00
committed by GitHub
parent d5684cd59c
commit 1fe7819c1b
117 changed files with 1328 additions and 501 deletions
+7 -1
View File
@@ -179,7 +179,13 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
if(ismob(loc))
var/mob/m = loc
m.unEquip(src, 1)
QDEL_LIST_CONTENTS(actions)
// actions clear themselves from the list on cut
if(islist(actions))
for(var/datum/action/A as anything in actions)
qdel(A)
if(!isnull(actions))
actions.Cut()
master = null
return ..()
@@ -39,7 +39,7 @@
update_brightness()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
return TRUE
/obj/item/flashlight/attack(mob/living/M as mob, mob/living/user as mob)
@@ -28,7 +28,7 @@
else
GLOB.active_jammers -= src
for(var/datum/action/item_action/toggle_radio_jammer/A in actions)
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/teleporter
name = "syndicate teleporter"
@@ -31,7 +31,7 @@
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/voice_changer/proc/set_voice(mob/user)
var/chosen_voice = clean_input("What voice would you like to mimic? Leave this empty to use the voice on your ID card.", "Set Voice Changer", voice, user)
@@ -202,7 +202,7 @@
icon_state = "selfrepair_[on ? "on" : "off"]"
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
else
icon_state = "cyborg_upgrade5"
@@ -63,11 +63,11 @@
SIGNAL_HANDLER
on_cooldown = TRUE
addtimer(CALLBACK(src, PROC_REF(end_cooldown)), 10 SECONDS)
UpdateButtonIcon()
UpdateButtons()
/datum/action/item_action/agent_box/proc/end_cooldown()
on_cooldown = FALSE
UpdateButtonIcon()
UpdateButtons()
/datum/action/item_action/agent_box/IsAvailable()
if(..() && !on_cooldown)
+1 -1
View File
@@ -159,7 +159,7 @@
update_icon(UPDATE_OVERLAYS)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/defibrillator/equipped(mob/user, slot)
..()
@@ -375,9 +375,6 @@
melee_attack_chain(attacking_shade, attacking_atom)
force += 5
/mob/living/simple_animal/shade/sword/create_mob_hud()
hud_used = new /datum/hud/sword(src)
/datum/hud/sword/New(mob/user)
..()
@@ -52,7 +52,7 @@
to_chat(user, "<span class='notice'>You turn the jetpack off.</span>")
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/tank/jetpack/proc/turn_on(mob/user)
+1 -1
View File
@@ -448,7 +448,7 @@
user.update_inv_r_hand()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
A.UpdateButtons()
/obj/item/chainsaw/attack_hand(mob/user)
. = ..()