Skip to content

Commit

Permalink
name refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusLarsson421 committed Sep 20, 2024
1 parent 9bd933b commit 934fbb2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
var/list/part_overlays
var/panel_attachment = "right"
var/note_attachment = "left"
var/maintenance = FALSE //whether or not the door should be affected by emergency maintenance mode
var/is_maint_emergency = FALSE //whether or not the door should be affected by emergency maintenance mode

var/cyclelinkeddir = 0
var/obj/machinery/door/airlock/cyclelinkedairlock
Expand Down Expand Up @@ -1461,7 +1461,7 @@
if(!electronics)
ae = new/obj/item/electronics/airlock(loc)
gen_access()
ae.maintenance = maintenance
ae.is_maint_emergency = is_maint_emergency
if(req_one_access.len)
ae.one_access = 1
ae.accesses = req_one_access
Expand Down Expand Up @@ -1527,7 +1527,7 @@
data["shock"] = secondsElectrified == MACHINE_NOT_ELECTRIFIED ? 2 : 0
data["shock_timeleft"] = secondsElectrified
data["id_scanner"] = !aiDisabledIdScanner
data["emergency"] = emergency // access
data["is_maint_emergency"] = is_maint_emergency // access
data["locked"] = locked // bolted
data["lights"] = lights // bolt lights
data["safe"] = safe // safeties
Expand Down Expand Up @@ -1667,13 +1667,13 @@
return new /datum/wires/airlock(src, wire_security_level)

/obj/machinery/door/airlock/proc/set_door_to_all_access()
if(maintenance && is_station_level(src.z))
if(is_maint_emergency && is_station_level(src.z))
emergency = TRUE
update_icon()
wires.ui_update()

/obj/machinery/door/airlock/proc/remove_door_from_all_access()
if(maintenance && is_station_level(src.z))
if(is_maint_emergency && is_station_level(src.z))
emergency = FALSE
update_icon()
wires.ui_update()
10 changes: 5 additions & 5 deletions code/game/machinery/doors/airlock_electronics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// If the airlock should require ALL or only ONE of the listed accesses
var/one_access = 0
// decides if the airlock should be affected by emergency maintenance acccess or not
var/maintenance = 0
var/is_maint_emergency = 0
/// Unrestricted sides, or sides of the airlock that will open regardless of access
var/unres_sides = 0
///what name are we passing to the finished airlock
Expand Down Expand Up @@ -56,7 +56,7 @@
var/list/data = list()
data["accesses"] = accesses
data["oneAccess"] = one_access
data["maintenance"] = maintenance
data["is_maint_emergency"] = is_maint_emergency
data["unres_direction"] = unres_sides
data["passedName"] = passed_name
data["passedCycleId"] = passed_cycle_id
Expand All @@ -69,16 +69,16 @@
if("clear_all")
accesses = list()
one_access = 0
maintenance = TRUE
is_maint_emergency = TRUE
. = TRUE
if("grant_all")
accesses = get_all_accesses()
. = TRUE
if("one_access")
one_access = !one_access
. = TRUE
if("maintenance")
maintenance = !maintenance
if("toggle_maints_emergency")
is_maint_emergency = !is_maint_emergency
. = TRUE
if("set")
var/access = text2num(params["access"])
Expand Down
8 changes: 4 additions & 4 deletions tgui/packages/tgui/interfaces/AirlockElectronics.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccessList } from './common/AccessList';

export const AirlockElectronics = (props, context) => {
const { act, data } = useBackend(context);
const { oneAccess, maintenance, unres_direction, passedName, passedCycleId } = data;
const { oneAccess, toggle_maints_emergency, unres_direction, passedName, passedCycleId } = data;
const regions = data.regions || [];
const accesses = data.accesses || [];
return (
Expand All @@ -22,9 +22,9 @@ export const AirlockElectronics = (props, context) => {
</LabeledList.Item>
<LabeledList.Item label="Maintenance">
<Button
icon={maintenance ? 'unlock' : 'lock'}
content={maintenance ? 'Yes' : 'No'}
onClick={() => act('maintenance')}
icon={is_maint_emergency ? 'unlock' : 'lock'}
content={is_maint_emergency ? 'Yes' : 'No'}
onClick={() => act('toggle_maints_emergency')}
/>
</LabeledList.Item>
<LabeledList.Item label="Unrestricted Access">
Expand Down

0 comments on commit 934fbb2

Please sign in to comment.