mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 11:05:16 +01:00
Makes integrated circuit nodes more colorful (#89360)
## About The Pull Request Makes it so nodes in an integrated circuit are colored depending on their category in the component menu. Before:  After:  All categories (BCI has been changed to solid black since this for contrast purposes)  If I was some sort of tgui magician I'd try to implement a way to add comment fields, but since I'm nowhere near that, I figured this was the least I could do. ## Why It's Good For The Game This makes it far easier to read integrated circuits and remember what they do. While there's still inherently some amount of confusion due to the nature of how node-based programming visually works, hopefully having it so nodes aren't all the same color helps a bit. ## Changelog 🆑 Wallem qol: Integrated Circuit nodes are now colored depending on their type. /🆑
This commit is contained in:
@@ -64,6 +64,10 @@
|
||||
/// The UI buttons of this circuit component. An assoc list that has this format: "button_icon" = "action_name"
|
||||
var/ui_buttons = null
|
||||
|
||||
/// The "important" UI tooltips of this circuit component. Used for important things like instant & disabled circuits, they're drawn next to the default tooltip icon.
|
||||
/// An assoc list with the format ui_alerts["alert_icon"] = "alert_name".
|
||||
var/ui_alerts = list()
|
||||
|
||||
/// Called when the option ports should be set up
|
||||
/obj/item/circuit_component/proc/populate_options()
|
||||
return
|
||||
@@ -86,8 +90,7 @@
|
||||
trigger_input = add_input_port("Trigger", PORT_TYPE_SIGNAL, order = 2)
|
||||
if((circuit_flags & CIRCUIT_FLAG_OUTPUT_SIGNAL) && !trigger_output)
|
||||
trigger_output = add_output_port("Triggered", PORT_TYPE_SIGNAL, order = 2)
|
||||
if(circuit_flags & CIRCUIT_FLAG_INSTANT)
|
||||
ui_color = "orange"
|
||||
update_ui_alerts()
|
||||
|
||||
/obj/item/circuit_component/Destroy()
|
||||
if(parent)
|
||||
@@ -113,6 +116,21 @@
|
||||
if(circuit_flags & CIRCUIT_FLAG_REFUSE_MODULE)
|
||||
. += span_notice("It's incompatible with module components.")
|
||||
|
||||
/// updates the ui alerts in the given component. new_flag adds flags, remove_flag removes them
|
||||
/obj/item/circuit_component/proc/update_ui_alerts(new_flag, remove_flag)
|
||||
if(new_flag)
|
||||
circuit_flags |= new_flag
|
||||
if(remove_flag)
|
||||
circuit_flags &= ~remove_flag
|
||||
if(circuit_flags & CIRCUIT_FLAG_INSTANT)
|
||||
ui_alerts["tachometer-alt"] = "Instant"
|
||||
else
|
||||
ui_alerts -= "tachometer-alt"
|
||||
if(circuit_flags & CIRCUIT_FLAG_DISABLED)
|
||||
ui_alerts["exclamation"] = "Non-functional"
|
||||
else
|
||||
ui_alerts -= "exclamation"
|
||||
|
||||
/**
|
||||
* Called when a shell is registered from the component/the component is added to a circuit.
|
||||
*
|
||||
|
||||
@@ -380,6 +380,8 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
|
||||
component_data["y"] = component.rel_y
|
||||
component_data["removable"] = component.removable
|
||||
component_data["color"] = component.ui_color
|
||||
component_data["category"] = component.category
|
||||
component_data["ui_alerts"] = component.ui_alerts
|
||||
component_data["ui_buttons"] = component.ui_buttons
|
||||
.["components"] += list(component_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user