Skip to content

Commit

Permalink
[MODULAR] Fixing unconnected modular consoles and not dir 2 any conso…
Browse files Browse the repository at this point in the history
…les (#1900)

* modular_computer/console doesn't exist anymore

* update appearance if our dir changed (due ingame building for example)

* wrong proc ref

* Update port_tarkon.dmm

* fixes from commit suggestion

* Update modular_nova/modules/connecting_computer/code/connectable_component.dm

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 11, 2024
1 parent d5c1962 commit 97ffd1b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
8 changes: 4 additions & 4 deletions _maps/RandomRuins/SpaceRuins/nova/port_tarkon.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
/turf/open/floor/iron,
/area/ruin/space/has_grav/port_tarkon/power1)
"bS" = (
/obj/machinery/modular_computer/console{
/obj/machinery/modular_computer{
dir = 4
},
/obj/effect/turf_decal/tile/blue/anticorner{
Expand Down Expand Up @@ -1160,7 +1160,7 @@
/turf/open/floor/iron,
/area/ruin/space/has_grav/port_tarkon/centerhall)
"ig" = (
/obj/machinery/modular_computer/console{
/obj/machinery/modular_computer{
dir = 8
},
/obj/effect/turf_decal/tile/brown/anticorner{
Expand Down Expand Up @@ -5902,7 +5902,7 @@
/obj/effect/turf_decal/tile/purple/half{
dir = 1
},
/obj/machinery/modular_computer/console,
/obj/machinery/modular_computer,
/turf/open/floor/iron/dark,
/area/ruin/space/has_grav/port_tarkon/developement)
"NS" = (
Expand Down Expand Up @@ -6885,7 +6885,7 @@
/turf/open/floor/iron,
/area/ruin/space/has_grav/port_tarkon/forehall)
"Uk" = (
/obj/machinery/modular_computer/console{
/obj/machinery/modular_computer{
dir = 1
},
/obj/effect/turf_decal/tile/blue/anticorner{
Expand Down
2 changes: 1 addition & 1 deletion modular_nova/modules/connecting_computer/code/_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if(connectable)
AddComponent(/datum/component/connectable_computer)

/obj/machinery/modular_computer/console/Initialize(mapload)
/obj/machinery/modular_computer/Initialize(mapload)
. = ..()

// Modular consoles all have the same case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

/datum/component/connectable_computer/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_update_overlays))
RegisterSignal(parent, COMSIG_ATOM_POST_DIR_CHANGE, PROC_REF(on_dir_change))

update_neighbors()

/datum/component/connectable_computer/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS)
UnregisterSignal(parent, COMSIG_ATOM_POST_DIR_CHANGE)

update_neighbors()

Expand Down Expand Up @@ -43,6 +45,28 @@

return null

/**
* Handles COMSIG_ATOM_POST_DIR_CHANGE for machines.
*
* Because ingame construction sets dir after Initialize and LateInitialize
* And changing dir doesn't trigger appearance updates
*
* Arguments:
* * source - The parent we're manipulating
* * old_dir - old dir
* * new_dir - new dir
*/
/datum/component/connectable_computer/proc/on_dir_change(datum/source, old_dir, new_dir)
SIGNAL_HANDLER

if (old_dir == new_dir)
return

// Call appearance update on us and our neighbors
var/obj/machinery/parent_machine = parent
parent_machine.update_appearance()
update_neighbors()

/**
* Handles COMSIG_ATOM_UPDATE_OVERLAYS for machines.
*
Expand Down

0 comments on commit 97ffd1b

Please sign in to comment.