From 03982074c57bffe617c7fb227f05472279ecd025 Mon Sep 17 00:00:00 2001 From: Dax Dupont Date: Mon, 1 Jan 2018 23:23:02 +0100 Subject: [PATCH] PDA Interface color is now an option --- code/game/objects/items/devices/PDA/PDA.dm | 3 ++- code/modules/client/preferences.dm | 16 +++++++++++----- code/modules/client/preferences_savefile.dm | 7 ++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 5a910282616..b4434a20e26 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -96,6 +96,7 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/device/pda/equipped(mob/user, slot) if(!equipped) if(user.client) + background_color = user.client.prefs.pda_color switch(user.client.prefs.pda_style) if(MONO) font_index = MODE_MONO @@ -112,7 +113,7 @@ GLOBAL_LIST_EMPTY(PDAs) else font_index = MODE_MONO font_mode = FONT_MONO - equipped = TRUE + equipped = TRUE /obj/item/device/pda/proc/update_label() name = "PDA-[owner] ([ownjob])" //Name generalisation diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f0588a4d3d7..cae46a051d8 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -47,6 +47,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/allow_midround_antag = 1 var/preferred_map = null var/pda_style = MONO + var/pda_color = "#808000" var/uses_glasses_colour = 0 @@ -370,7 +371,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Keybindings: [(hotkeys) ? "Hotkeys" : "Default"]
" dat += "Action Buttons: [(buttons_locked) ? "Locked In Place" : "Unlocked"]
" dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" - dat += "PDA Style: [pda_style]
" + dat += "PDA Style: [pda_style]
" + dat += "PDA Color:     Change
" dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" dat += "Window Flashing: [(windowflashing) ? "Yes" : "No"]
" dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" @@ -1141,10 +1143,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/pickedui = input(user, "Choose your UI style.", "Character Preference") as null|anything in list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative", "Clockwork") if(pickedui) UI_style = pickedui - if("PDA") - var/pickedPDA = input(user, "Choose your PDA style.", "Character Preference") as null|anything in list(MONO, SHARE, ORBITRON, VT) - if(pickedPDA) - pda_style = pickedPDA + if("pda_style") + var/pickedPDAStyle = input(user, "Choose your PDA style.", "Character Preference") as null|anything in list(MONO, SHARE, ORBITRON, VT) + if(pickedPDAStyle) + pda_style = pickedPDAStyle + if("pda_color") + var/pickedPDAColor = input(user, "Choose your PDA Interface color.", "Character Preference") as null|color + if(pickedPDAColor) + pda_color = pickedPDAColor else switch(href_list["preference"]) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 1317228c1a4..2b13f6953a2 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -2,7 +2,7 @@ #define SAVEFILE_VERSION_MIN 15 //This is the current version, anything below this will attempt to update (if it's not obsolete) -#define SAVEFILE_VERSION_MAX 19 +#define SAVEFILE_VERSION_MAX 20 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn This proc checks if the current directory of the savefile S needs updating @@ -109,6 +109,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["legs"] = "Normal Legs" if(current_version < 19) pda_style = "mono" + if(current_version < 20) + pda_color = "#808000" /datum/preferences/proc/load_path(ckey,filename="preferences.sav") @@ -160,6 +162,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["enable_tips"] >> enable_tips S["tip_delay"] >> tip_delay S["pda_style"] >> pda_style + S["pda_color"] >> pda_color //try to fix any outdated data if necessary if(needs_update >= 0) @@ -185,6 +188,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car menuoptions = SANITIZE_LIST(menuoptions) be_special = SANITIZE_LIST(be_special) pda_style = sanitize_inlist(MONO, VT, SHARE, ORBITRON) + pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color)) return 1 @@ -225,6 +229,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["enable_tips"], enable_tips) WRITE_FILE(S["tip_delay"], tip_delay) WRITE_FILE(S["pda_style"], pda_style) + WRITE_FILE(S["pda_color"], pda_color) return 1