From d28177e81a3b01733edcd376a9818d8db8d28d29 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 21 Mar 2023 04:05:18 +0100 Subject: [PATCH] [MIRROR] Define default tram length, light color [NO GBP] [MDB IGNORE] (#20001) * Define default tram length, light color [NO GBP] (#74125) ## About The Pull Request Removes magic number from tram crossing calculation, makes it a define instead. Uses standard light_color defines to better match other station lighting. ## Why It's Good For The Game Magic numbers bad. Consistency good. ## Changelog No CL required, it's just a slight fix for https://github.com/tgstation/tgstation/pull/74072 * Define default tram length, light color [NO GBP] * Update colors.dm * Update colors.dm --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Co-authored-by: lessthnthree --- code/__DEFINES/colors.dm | 20 ++++++++++++++++--- code/__DEFINES/tram.dm | 2 ++ .../industrial_lift/tram/tram_machinery.dm | 18 ++++++++--------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/colors.dm b/code/__DEFINES/colors.dm index 99e828e0c99..aa7c5e7a8eb 100644 --- a/code/__DEFINES/colors.dm +++ b/code/__DEFINES/colors.dm @@ -185,14 +185,20 @@ */ /// Bright but quickly dissipating neon green. rgb(100, 200, 100) #define LIGHT_COLOR_GREEN "#64C864" +/// Vivid, slightly blue green. rgb(60, 240, 70) +#define LIGHT_COLOR_VIVID_GREEN "#3CF046" /// Electric green. rgb(0, 255, 0) #define LIGHT_COLOR_ELECTRIC_GREEN "#00FF00" /// Cold, diluted blue. rgb(100, 150, 250) #define LIGHT_COLOR_BLUE "#6496FA" +/// Faint white blue. rgb(222, 239, 255) +#define LIGHT_COLOR_FAINT_BLUE "#DEEFFF" /// Light blueish green. rgb(125, 225, 175) #define LIGHT_COLOR_BLUEGREEN "#7DE1AF" /// Diluted cyan. rgb(125, 225, 225) #define LIGHT_COLOR_CYAN "#7DE1E1" +/// Baby Blue rgb(0, 170, 220) +#define LIGHT_COLOR_BABY_BLUE "#00AADC" /// Electric cyan rgb(0, 255, 255) #define LIGHT_COLOR_ELECTRIC_CYAN "#00FFFF" /// More-saturated cyan. rgb(64, 206, 255) @@ -202,7 +208,9 @@ /// Diluted, mid-warmth pink. rgb(225, 125, 225) #define LIGHT_COLOR_PINK "#E17DE1" /// Dimmed yellow, leaning kaki. rgb(225, 225, 125) -#define LIGHT_COLOR_YELLOW "#E1E17D" +#define LIGHT_COLOR_DIM_YELLOW "#E1E17D" +/// Bright yellow. rgb(255, 255, 150) +#define LIGHT_COLOR_BRIGHT_YELLOW "#FFFF99" /// Clear brown, mostly dim. rgb(150, 100, 50) #define LIGHT_COLOR_BROWN "#966432" /// Mostly pure orange. rgb(250, 150, 50) @@ -223,10 +231,12 @@ #define LIGHT_COLOR_LAVA "#C48A18" /// Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75) #define LIGHT_COLOR_FLARE "#FA644B" +/// Vivid red. Leans a bit darker to accentuate red colors and leave other channels a bit dry. rgb(200, 25, 25) +#define LIGHT_COLOR_INTENSE_RED "#C81919" /// Weird color, between yellow and green, very slimy. rgb(175, 200, 75) #define LIGHT_COLOR_SLIME_LAMP "#AFC84B" -/// Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175) -#define LIGHT_COLOR_TUNGSTEN "#FAE1AF" +/// Extremely diluted yellow, close to skin color (for some reason). rgb(255, 214, 170) +#define LIGHT_COLOR_TUNGSTEN "#FFD6AA" /// Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250) #define LIGHT_COLOR_HALOGEN "#F0FAFA" @@ -326,3 +336,7 @@ GLOBAL_LIST_INIT(cable_colors, list( CABLE_COLOR_YELLOW = CABLE_HEX_COLOR_YELLOW, CABLE_COLOR_BROWN = CABLE_HEX_COLOR_BROWN )) + +/* SKYRAT EDIT ADDITION BEGIN */ +#define LIGHT_COLOR_YELLOW "#E1E17D" +/* SKYRAT EDIT ADDITION END */ diff --git a/code/__DEFINES/tram.dm b/code/__DEFINES/tram.dm index 3717b289336..f70e000db0f 100644 --- a/code/__DEFINES/tram.dm +++ b/code/__DEFINES/tram.dm @@ -10,6 +10,8 @@ #define XING_SIGNAL_DIRECTION_WEST "west-" #define XING_SIGNAL_DIRECTION_EAST "east-" +#define XING_DEFAULT_TRAM_LENGTH 10 + /// Tram destinations/platforms #define TRAMSTATION_WEST 1 #define TRAMSTATION_CENTRAL 2 diff --git a/code/modules/industrial_lift/tram/tram_machinery.dm b/code/modules/industrial_lift/tram/tram_machinery.dm index fd187a646c8..d663dd64b50 100644 --- a/code/modules/industrial_lift/tram/tram_machinery.dm +++ b/code/modules/industrial_lift/tram/tram_machinery.dm @@ -143,7 +143,7 @@ GLOBAL_LIST_EMPTY(tram_doors) if(!tram_part.travelling) if(is_operational) for(var/obj/machinery/crossing_signal/xing as anything in GLOB.tram_signals) - xing.set_signal_state(XING_STATE_AMBER, TRUE) + xing.set_signal_state(XING_STATE_MALF, TRUE) for(var/obj/machinery/destination_sign/desto as anything in GLOB.tram_signs) desto.icon_state = "[desto.base_icon_state][DESTINATION_OFF]" desto.update_appearance() @@ -247,11 +247,11 @@ GLOBAL_LIST_EMPTY(tram_doors) subsystem_type = /datum/controller/subsystem/processing/fastprocess light_range = 1.5 light_power = 3 - light_color = COLOR_VIBRANT_LIME + light_color = LIGHT_COLOR_BABY_BLUE luminosity = 1 - /// green, amber, or red. - var/signal_state = XING_STATE_GREEN + /// green, amber, or red for tram, blue if it's emag, tram missing, etc. + var/signal_state = XING_STATE_MALF /// The ID of the tram we control var/tram_id = MAIN_STATION_TRAM /// Weakref to the tram piece we control @@ -468,7 +468,7 @@ GLOBAL_LIST_EMPTY(tram_doors) tram_velocity_sign = tram.travel_direction & EAST ? 1 : -1 // How far away are we? negative if already passed. - var/approach_distance = tram_velocity_sign * (signal_pos - (tram_pos + 5)) + var/approach_distance = tram_velocity_sign * (signal_pos - (tram_pos + (XING_DEFAULT_TRAM_LENGTH * 0.5))) // Check for stopped state. // Will kill the process since tram starting up will restart process. @@ -525,13 +525,13 @@ GLOBAL_LIST_EMPTY(tram_doors) var/new_color switch(signal_state) if(XING_STATE_MALF) - new_color = COLOR_BRIGHT_BLUE + new_color = LIGHT_COLOR_BABY_BLUE if(XING_STATE_GREEN) - new_color = COLOR_VIBRANT_LIME + new_color = LIGHT_COLOR_VIVID_GREEN if(XING_STATE_AMBER) - new_color = COLOR_YELLOW + new_color = LIGHT_COLOR_BRIGHT_YELLOW else - new_color = COLOR_RED + new_color = LIGHT_COLOR_FLARE set_light(l_on = TRUE, l_color = new_color)