diff --git a/code/__DEFINES/mode.dm b/code/__DEFINES/mode.dm index dd3cbc80cee0..4398c375bb77 100644 --- a/code/__DEFINES/mode.dm +++ b/code/__DEFINES/mode.dm @@ -86,6 +86,13 @@ #define FLASH_OVERLAY_DARK 1 //Flashes your screen a dark grey. //================================================= +#define NV_COLOR_GREEN "#39FF14" +#define NV_COLOR_WHITE "#D3D3D3" +#define NV_COLOR_ORANGE "#FFCC66" +#define NV_COLOR_YELLOW "#FFFF66" //crazy ? i was crazy once +#define NV_COLOR_RED "#FF3333" +#define NV_COLOR_BLUE "#66CCFF" + //================================================= #define CRIT_OVERLAY_WHITE 0 //Overlays your screen white. #define CRIT_OVERLAY_DARK 1 //Overlays your screen a dark grey. diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index a26b5b4a9520..9b241b007d16 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -249,6 +249,9 @@ GLOBAL_REFERENCE_LIST_INDEXED(yautja_hair_styles_list, /datum/sprite_accessory/y //Backpacks GLOBAL_LIST_INIT(backbaglist, list("Backpack", "Satchel")) + + //NVG colors +GLOBAL_LIST_INIT(nvg_color_list, list("Green", "White", "Yellow", "Orange", "Red", "Blue")) //Armor styles GLOBAL_LIST_INIT(armor_style_list, list("Padded" = 1, "Padless" = 2, "Ridged" = 3, "Carrier" = 4, "Skull" = 5, "Smooth" = 6, "Random")) diff --git a/code/game/cas_manager/datums/cas_fire_envelope.dm b/code/game/cas_manager/datums/cas_fire_envelope.dm index 864d7f23a3e8..29790ca6ce8d 100644 --- a/code/game/cas_manager/datums/cas_fire_envelope.dm +++ b/code/game/cas_manager/datums/cas_fire_envelope.dm @@ -199,7 +199,7 @@ var/mob/M = user if(linked_console.upgraded == MATRIX_NVG) if(linked_console.power <= 8) - M.add_client_color_matrix("matrix_nvg", 99, color_matrix_multiply(color_matrix_saturation(1), color_matrix_rotate_x(-1*(20.8571-1.57143*linked_console.power)), color_matrix_from_string(linked_console.matrixcol))) // (20.8571-1.57143*linked_console.power) is an equation so we can make low level properties look bad + M.add_client_color_matrix("matrix_nvg", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string(linked_console.matrix_color))) M.overlay_fullscreen("matrix_blur", /atom/movable/screen/fullscreen/brute/nvg, 3) M.overlay_fullscreen("matrix", /atom/movable/screen/fullscreen/flash/noise/nvg) M.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE diff --git a/code/game/machinery/computer/dropship_weapons.dm b/code/game/machinery/computer/dropship_weapons.dm index dd63df154582..3aa6fff72b9a 100644 --- a/code/game/machinery/computer/dropship_weapons.dm +++ b/code/game/machinery/computer/dropship_weapons.dm @@ -18,7 +18,7 @@ var/firemission_signal //id of the signal var/in_firemission_mode = FALSE var/upgraded = MATRIX_DEFAULT // we transport upgrade var from matrixdm - var/matrixcol //color of matrix, only used when we upgrade to nv + var/matrix_color = NV_COLOR_GREEN //color of matrix, only used when we upgrade to nv var/power //level of the property var/datum/cas_signal/selected_cas_signal var/datum/simulator/simulation @@ -92,7 +92,6 @@ W.forceMove(src) to_chat(user, SPAN_NOTICE("You swap the matrix in the dropship guidance camera system, destroying the older part in the process")) upgraded = matrix.upgrade - matrixcol = matrix.matrixcol power = matrix.power else @@ -441,7 +440,9 @@ if(upgraded != MATRIX_NVG) to_chat(user, SPAN_WARNING("The matrix is not upgraded with night vision.")) return FALSE - SEND_SIGNAL(src, COMSIG_CAMERA_SET_NVG, 5, "#7aff7a") + if(user.client?.prefs?.night_vision_preference) + matrix_color = user.client.prefs.nv_color_list[user.client.prefs.night_vision_preference] + SEND_SIGNAL(src, COMSIG_CAMERA_SET_NVG, 5, matrix_color) return TRUE if("nvg-disable") diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm index 40e9b9bd5995..e819b1ca2b1c 100644 --- a/code/game/objects/items/devices/helmet_visors.dm +++ b/code/game/objects/items/devices/helmet_visors.dm @@ -197,6 +197,7 @@ helmet_overlay = "nvg_sight_right" toggle_on_sound = 'sound/handling/toggle_nv1.ogg' toggle_off_sound = 'sound/handling/toggle_nv2.ogg' + var/matrix_color = NV_COLOR_GREEN /// The internal battery for the visor var/obj/item/cell/super/power_cell @@ -228,8 +229,9 @@ /obj/item/device/helmet_visor/night_vision/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) RegisterSignal(user, COMSIG_HUMAN_POST_UPDATE_SIGHT, PROC_REF(on_update_sight)) - - user.add_client_color_matrix("nvg_visor", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string("#7aff7a"))) + if(user.client?.prefs?.night_vision_preference) + matrix_color = user.client.prefs.nv_color_list[user.client.prefs.night_vision_preference] + user.add_client_color_matrix("nvg_visor", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string(matrix_color))) user.overlay_fullscreen("nvg_visor", /atom/movable/screen/fullscreen/flash/noise/nvg) user.overlay_fullscreen("nvg_visor_blur", /atom/movable/screen/fullscreen/brute/nvg, 3) user.update_sight() diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 4b11fd69e6f9..5c05fc56e8c5 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -147,6 +147,7 @@ var/obj/item/clothing/head/attached_item var/mob/living/attached_mob var/lighting_alpha = 100 + var/matrix_color = NV_COLOR_GREEN /obj/item/prop/helmetgarb/helmet_nvg/Initialize(mapload, ...) . = ..() @@ -330,7 +331,9 @@ RegisterSignal(user, COMSIG_HUMAN_POST_UPDATE_SIGHT, PROC_REF(update_sight)) - user.add_client_color_matrix("nvg", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string("#7aff7a"))) + if(user.client?.prefs?.night_vision_preference) + matrix_color = user.client.prefs.nv_color_list[user.client.prefs.night_vision_preference] + user.add_client_color_matrix("nvg", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string(matrix_color))) user.overlay_fullscreen("nvg", /atom/movable/screen/fullscreen/flash/noise/nvg) user.overlay_fullscreen("nvg_blur", /atom/movable/screen/fullscreen/brute/nvg, 3) playsound(user, 'sound/handling/toggle_nv1.ogg', 25) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 66e97667ba7b..464ff4d6812f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -184,7 +184,15 @@ GLOBAL_LIST_INIT(bgstate_options, list( var/language = "None" //Secondary language var/list/gear //Custom/fluff item loadout. var/preferred_squad = "None" - + var/night_vision_preference = "Green" + var/list/nv_color_list = list( + "Green" = NV_COLOR_GREEN, + "White" = NV_COLOR_WHITE, + "Yellow" = NV_COLOR_YELLOW, + "Orange" = NV_COLOR_ORANGE, + "Red" = NV_COLOR_RED, + "Blue" = NV_COLOR_BLUE + ) //Some faction information. var/origin = ORIGIN_USCM var/faction = "None" //Antag faction/general associated faction. @@ -415,6 +423,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( dat += "Show Job Gear: [show_job_gear ? "True" : "False"]
" dat += "Background: Cycle Background

" + dat += "Night Vision Color: [night_vision_preference]
" dat += "Custom Loadout: " var/total_cost = 0 @@ -1550,6 +1559,12 @@ GLOBAL_LIST_INIT(bgstate_options, list( if(new_pref_squad) preferred_squad = new_pref_squad + if("prefnvg") + var/new_nvg_color = tgui_input_list(user, "Choose the color of your night-vision", "Character Preferences", GLOB.nvg_color_list) + if(!new_nvg_color) + return + night_vision_preference = new_nvg_color + if("prefarmor") var/new_pref_armor = tgui_input_list(user, "Choose your character's default style of armor:", "Character Preferences", GLOB.armor_style_list) if(new_pref_armor) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 0aeb589e48f5..02d5598b0bcb 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -643,6 +643,7 @@ S["preferred_squad"] >> preferred_squad S["preferred_armor"] >> preferred_armor + S["night_vision_preference"] >> night_vision_preference S["weyland_yutani_relation"] >> weyland_yutani_relation //S["skin_style"] >> skin_style @@ -695,6 +696,7 @@ undershirt = sanitize_inlist(undershirt, gender == MALE ? GLOB.undershirt_m : GLOB.undershirt_f, initial(undershirt)) backbag = sanitize_integer(backbag, 1, length(GLOB.backbaglist), initial(backbag)) preferred_armor = sanitize_inlist(preferred_armor, GLOB.armor_style_list, "Random") + night_vision_preference = sanitize_inlist(night_vision_preference, GLOB.nvg_color_list, "Green") //b_type = sanitize_text(b_type, initial(b_type)) alternate_option = sanitize_integer(alternate_option, 0, 3, initial(alternate_option)) @@ -794,6 +796,7 @@ S["weyland_yutani_relation"] << weyland_yutani_relation S["preferred_squad"] << preferred_squad S["preferred_armor"] << preferred_armor + S["night_vision_preference"] << night_vision_preference //S["skin_style"] << skin_style S["uplinklocation"] << uplinklocation