Files
SyncIt21 2424103245 Replacing objects with their mapping directional helpers Part 2 (#94181)
## About The Pull Request
Continuation of #94059. Replaces the following signs with their
directional helpers

- `/obj/structure/sign/warning ->
/obj/structure/sign/warning/directional`
- `/obj/structure/sign/warning/radiation ->
/obj/structure/sign/warning/radiation/directional`
- `/obj/structure/sign/warning/secure_area ->
/obj/structure/sign/warning/secure_area/directional`

Depends on #94076 for diagonal wall mounts

## Changelog
🆑
qol: added mapping directional helper for warning, radiation & secure
area sign allowing them to interact with fire/acid on their mounted turf
qol: adds mapping helper to create diagonally shifted objects
/🆑
2025-12-02 23:46:53 +00:00

70 lines
1.8 KiB
Plaintext

// Byond direction defines, because I want to put them somewhere.
// #define NORTH 1
// #define SOUTH 2
// #define EAST 4
// #define WEST 8
/// North direction as a string "[1]"
#define TEXT_NORTH "[NORTH]"
/// South direction as a string "[2]"
#define TEXT_SOUTH "[SOUTH]"
/// East direction as a string "[4]"
#define TEXT_EAST "[EAST]"
/// West direction as a string "[8]"
#define TEXT_WEST "[WEST]"
//dir macros
///Returns true if the dir is diagonal, false otherwise
#define ISDIAGONALDIR(d) (d&(d-1))
///True if the dir is north or south, false therwise
#define NSCOMPONENT(d) (d&(NORTH|SOUTH))
///True if the dir is east/west, false otherwise
#define EWCOMPONENT(d) (d&(EAST|WEST))
///Flips the dir for north/south directions
#define NSDIRFLIP(d) (d^(NORTH|SOUTH))
///Flips the dir for east/west directions
#define EWDIRFLIP(d) (d^(EAST|WEST))
/// Inverse direction, taking into account UP|DOWN if necessary.
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
/// Create directional subtypes for a path to simplify mapping.
#define MAPPING_DIRECTIONAL_HELPERS(path, offset) ##path/directional/north {\
dir = NORTH; \
pixel_y = offset; \
} \
##path/directional/south {\
dir = SOUTH; \
pixel_y = -offset; \
} \
##path/directional/east {\
dir = EAST; \
pixel_x = offset; \
} \
##path/directional/west {\
dir = WEST; \
pixel_x = -offset; \
}
/// Create diagonal subtypes for a path to simplify mapping.
#define MAPPING_DIAGONAL_HELPERS(path, offset) ##path/directional/northeast {\
dir = NORTHEAST; \
pixel_x = offset; \
pixel_y = offset; \
} \
##path/directional/northwest {\
dir = NORTHWEST; \
pixel_x = -offset; \
pixel_y = offset; \
} \
##path/directional/southeast {\
dir = SOUTHEAST; \
pixel_x = offset; \
pixel_y = -offset; \
} \
##path/directional/southwest {\
dir = SOUTHWEST; \
pixel_x = -offset; \
pixel_y = -offset; \
}