[MIRROR] Action button refactor/rework: Enhanced Dragging [MDB IGNORE] (#12423)

* Action button refactor/rework: Enhanced Dragging

* PHEW

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-04-01 02:38:57 +02:00
committed by GitHub
parent 2f25875974
commit cec72761ac
79 changed files with 1334 additions and 721 deletions
@@ -226,12 +226,16 @@
src.circuit_component = circuit_component
button.maptext_x = 2
button.maptext_y = 0
update_maptext()
UpdateButtons()
START_PROCESSING(SSobj, src)
/datum/action/innate/bci_charge_action/CreateButton()
var/atom/movable/screen/movable/action_button/button = ..()
button.maptext_x = 2
button.maptext_y = 0
return button
/datum/action/innate/bci_charge_action/Destroy()
circuit_component.charge_action = null
circuit_component = null
@@ -250,9 +254,14 @@
to_chat(owner, span_info("You can recharge it by using a cyborg recharging station."))
/datum/action/innate/bci_charge_action/process(delta_time)
update_maptext()
UpdateButtons()
/datum/action/innate/bci_charge_action/proc/update_maptext()
/datum/action/innate/bci_charge_action/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE)
. = ..()
if(!.)
return
if(status_only)
return
var/obj/item/stock_parts/cell/cell = circuit_component.parent.cell
button.maptext = cell ? MAPTEXT("[cell.percent()]%") : ""