mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 10:35:41 +01:00
[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:
@@ -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()]%") : ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user