Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Construction station Solar Control Computer starts out auto-tracking #63

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@
/obj/structure/cable{
icon_state = "0-2"
},
/obj/machinery/power/solar_control,
/obj/machinery/power/solar_control/auto_connect,
/turf/open/floor/plating,
/area/engine/storage_shared)
"Hr" = (
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@
///from base power_change() when power is restored
#define COMSIG_MACHINERY_POWER_RESTORED "machinery_power_restored"

// /obj/machinery/power signals

// Singulostation edit - powernet signal to machines on init
///from /datum/controller/subsystem/machines/proc/makepowernets()
#define COMSIG_MACHINE_POWERNET_ROUNDSTART_INIT "machine_powernet_roundstart_init"

// /obj/machinery/power/supermatter_crystal signals
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM delam reaches the point of sounding alarms
#define COMSIG_SUPERMATTER_DELAM_START_ALARM "sm_delam_start_alarm"
Expand Down
8 changes: 8 additions & 0 deletions code/controllers/subsystem/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ SUBSYSTEM_DEF(machines)
NewPN.add_cable(PC)
propagate_network(PC,PC.powernet)

// Singulostation edit - powernet signal to machines on init
for(var/obj/machinery/power/machine in NewPN.nodes)
SEND_SIGNAL(machine, COMSIG_MACHINE_POWERNET_ROUNDSTART_INIT)

/datum/controller/subsystem/machines/stat_entry(msg)
msg = "M:[length(processing)]|PN:[length(powernets)]"
return ..()
Expand Down Expand Up @@ -58,6 +62,10 @@ SUBSYSTEM_DEF(machines)
NewPN.add_cable(PC)
propagate_network(PC,PC.powernet)

// Singulostation edit - powernet signal to machines on init
for(var/obj/machinery/power/machine in NewPN.nodes)
SEND_SIGNAL(machine, COMSIG_MACHINE_POWERNET_ROUNDSTART_INIT)

/datum/controller/subsystem/machines/Recover()
if (istype(SSmachines.processing))
processing = SSmachines.processing
Expand Down
16 changes: 16 additions & 0 deletions singulostation/code/modules/power/solar.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Solar Control Computer that automatically connects to solar panels roundstart
//

/obj/machinery/power/solar_control/auto_connect/Initialize(mapload)
. = ..()
Urumasi marked this conversation as resolved.
Show resolved Hide resolved
if(connected_tracker)
track = SOLAR_TRACK_AUTO
if(mapload)
RegisterSignal(src, COMSIG_MACHINE_POWERNET_ROUNDSTART_INIT, .proc/auto_connect)

/obj/machinery/power/solar_control/auto_connect/proc/auto_connect()
SIGNAL_HANDLER
search_for_connected()
if(connected_tracker)
track = SOLAR_TRACK_AUTO
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,7 @@
#include "singulostation\code\modules\cargo\exports\tools.dm"
#include "singulostation\code\modules\mob\living\death.dm"
#include "singulostation\code\modules\mob\living\simple_animal\hostile\megafauna\colossus.dm"
#include "singulostation\code\modules\power\solar.dm"
#include "singulostation\code\modules\research\designs\machine_designs.dm"
#include "singulostation\code\modules\research\designs\tool_designs.dm"
#include "singulostation\code\modules\research\xenobiology\crossbreeding\_misc.dm"
Expand Down