mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Adds buttons in the UI for specific components (#61622)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
b463e0417e
commit
390f60f571
@@ -20,6 +20,11 @@
|
||||
var/min_size = 1
|
||||
var/max_size = 20
|
||||
|
||||
ui_buttons = list(
|
||||
"plus" = "increase",
|
||||
"minus" = "decrease"
|
||||
)
|
||||
|
||||
/obj/item/circuit_component/list_literal/save_data_to_list(list/component_data)
|
||||
. = ..()
|
||||
component_data["length"] = length
|
||||
@@ -60,16 +65,12 @@
|
||||
return ..()
|
||||
|
||||
// Increases list length
|
||||
/obj/item/circuit_component/list_literal/attack_self(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
set_list_size(min(length + 1, max_size))
|
||||
balloon_alert(user, "new size is now [length]")
|
||||
|
||||
// Decreases list length
|
||||
/obj/item/circuit_component/list_literal/attack_self_secondary(mob/user, list/modifiers)
|
||||
. = ..()
|
||||
set_list_size(max(length - 1, min_size))
|
||||
balloon_alert(user, "new size is now [length]")
|
||||
/obj/item/circuit_component/list_literal/ui_perform_action(mob/user, action)
|
||||
switch(action)
|
||||
if("increase")
|
||||
set_list_size(min(length + 1, max_size))
|
||||
if("decrease")
|
||||
set_list_size(max(length - 1, min_size))
|
||||
|
||||
/obj/item/circuit_component/list_literal/input_received(datum/port/input/port)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user