From 513a5f1bc963780d8a5cfd4bb82520b3cb0d56cd Mon Sep 17 00:00:00 2001 From: Ling Date: Sun, 3 Jun 2018 09:33:10 +0200 Subject: [PATCH] Fixes pda style loading (#38238) * Fixes pda style saving * Make the input call use the global pda styles list --- code/__DEFINES/misc.dm | 2 ++ code/modules/client/preferences.dm | 2 +- code/modules/client/preferences_savefile.dm | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 40b897007c0..498e020cefe 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -249,6 +249,8 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define ORBITRON "Orbitron" #define SHARE "Share Tech Mono" +GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE)) + //Color Defines #define OOC_COLOR "#002eb8" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 91435170252..e78a71ba15e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1390,7 +1390,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if (parent && parent.mob && parent.mob.hud_used) parent.mob.hud_used.update_ui_style(ui_style2icon(UI_style)) if("pda_style") - var/pickedPDAStyle = input(user, "Choose your PDA style.", "Character Preference", pda_style) as null|anything in list(MONO, SHARE, ORBITRON, VT) + var/pickedPDAStyle = input(user, "Choose your PDA style.", "Character Preference", pda_style) as null|anything in GLOB.pda_styles if(pickedPDAStyle) pda_style = pickedPDAStyle if("pda_color") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 85eeac4b8bd..8c92e59f767 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -128,7 +128,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION) menuoptions = SANITIZE_LIST(menuoptions) be_special = SANITIZE_LIST(be_special) - pda_style = sanitize_inlist(MONO, VT, SHARE, ORBITRON) + pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style)) pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color)) return 1