Skip to content

Commit

Permalink
Replaces overlay sprite for airlocks that indicates unrestricted acce…
Browse files Browse the repository at this point in the history
…ss from a specific direction (tgstation#85825)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
- Remember that white cone thing on medbay's outer doors? It's a blue
light now. The blue light indicates which side you can access from.
- Re-organized the overlay proc a bit. The blue light for unrestricted
access is done first, which means it'll be covered up by bolt or even
emergency lights. Those are more important, so we have unrestricted
access as the lowest priority indicator.
- Did you know that airlocks ran `hasPower()` *three times* when they
updated their overlays? They don't now.
- Fixes tgstation#85807 (Thanks Jac)
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Out with the old

![image](https://github.com/user-attachments/assets/f8eab20f-9aa0-4b75-9b11-f3e693ff26fb)

In with the new

![image](https://github.com/user-attachments/assets/4f82f5d5-d6d1-4de9-b337-51c20ebafb35)
(You can freely enter from the side with the blue light. So the four
airlocks here allow people to enter from the outside, but require access
to leave)
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
image: Airlocks have a better sprite for indicating which directions (if
any) you can pass through without ID access.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Ghom <[email protected]>
  • Loading branch information
zxaber and Ghommie authored Aug 16, 2024
1 parent 2064b78 commit 443c49b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

/obj/machinery/door/airlock
name = "Airlock"
icon = 'icons/obj/doors/airlocks/station/public.dmi'
icon = 'icons/obj/doors/airlocks/tall/maintenance.dmi'
icon_state = "closed"
max_integrity = 300
var/normal_integrity = AIRLOCK_INTEGRITY_N
Expand Down Expand Up @@ -581,9 +581,6 @@
if(!greyscale_config)
. += get_airlock_overlay("[airlock_material]_opening", icon , src)

if(lights && hasPower())
. += get_airlock_overlay("lights_[light_state]", overlays_file, src, em_block = FALSE)

if(panel_open)
. += get_airlock_overlay("panel_[frame_state][security_level ? "_protected" : null]", overlays_file, src, em_block = TRUE)
if(frame_state == AIRLOCK_FRAME_CLOSED && welded)
Expand All @@ -592,7 +589,18 @@
if(airlock_state == AIRLOCK_EMAG)
. += get_airlock_overlay("sparks", overlays_file, src, em_block = FALSE)

if(hasPower())
if(hasPower()) //Indicator Lights section

if(unres_sides && airlock_state == AIRLOCK_CLOSED) //Unrestricted access side. This is the lowest priority light, so we do it first
for(var/heading in list(dir,turn(dir, 180))) //Only check the door's dir and the flip
if(!(unres_sides & heading))
continue
for(var/mutable_appearance/bluelight in get_airlock_overlay("lights_unres", overlays_file, src, em_block = FALSE))
. += make_mutable_appearance_directional(bluelight, heading)

if(lights) //bolt lights
. += get_airlock_overlay("lights_[light_state]", overlays_file, src, em_block = FALSE)

if(frame_state == AIRLOCK_FRAME_CLOSED)
if(atom_integrity < integrity_failure * max_integrity)
. += get_airlock_overlay("sparks_broken", overlays_file, src, em_block = FALSE)
Expand All @@ -608,21 +616,6 @@
if(frame_state == AIRLOCK_FRAME_CLOSED && seal)
. += get_airlock_overlay("sealed", overlays_file, src, em_block = TRUE)

if(hasPower() && unres_sides)
for(var/heading in list(NORTH,SOUTH,EAST,WEST))
if(!(unres_sides & heading))
continue
var/mutable_appearance/floorlight = mutable_appearance('icons/obj/doors/airlocks/station/overlays.dmi', "unres_[heading]", FLOAT_LAYER, src, ABOVE_LIGHTING_PLANE)
switch (heading)
if (NORTH)
floorlight.pixel_y = 32
if (SOUTH)
floorlight.pixel_y = -32
if (EAST)
floorlight.pixel_x = 28
if (WEST)
floorlight.pixel_x = -28
. += floorlight
update_greyscale()

// I HATE AIRLOCKS AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
Expand Down
Binary file modified icons/obj/doors/airlocks/tall/overlays.dmi
Binary file not shown.

0 comments on commit 443c49b

Please sign in to comment.