mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Refactors how circuit size is calculated. Fixed module circuit size not taking up capacity equal to the amount of circuit components inside of it. (#61554)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
f109d9d654
commit
1a507d23ed
@@ -45,12 +45,15 @@
|
||||
/// The power usage whenever this component receives an input
|
||||
var/power_usage_per_input = 1
|
||||
|
||||
// Whether the component is removable or not. Only affects user UI
|
||||
/// Whether the component is removable or not. Only affects user UI
|
||||
var/removable = TRUE
|
||||
|
||||
// Defines which shells support this component. Only used as an informational guide, does not restrict placing these components in circuits.
|
||||
/// Defines which shells support this component. Only used as an informational guide, does not restrict placing these components in circuits.
|
||||
var/required_shells = null
|
||||
|
||||
/// Determines the amount of space this circuit occupies in an integrated circuit.
|
||||
var/circuit_size = 1
|
||||
|
||||
/// The UI buttons of this circuit component. An assoc list that has this format: "button_icon" = "action_name"
|
||||
var/ui_buttons = null
|
||||
|
||||
@@ -216,6 +219,14 @@
|
||||
trigger_output.set_output(COMPONENT_SIGNAL)
|
||||
return TRUE
|
||||
|
||||
/obj/item/circuit_component/proc/set_circuit_size(new_size)
|
||||
if(parent)
|
||||
parent.current_size -= circuit_size
|
||||
|
||||
circuit_size = new_size
|
||||
|
||||
if(parent)
|
||||
parent.current_size += circuit_size
|
||||
|
||||
/**
|
||||
* Called whether this circuit component should receive an input.
|
||||
|
||||
Reference in New Issue
Block a user