Makes the pda font a prefernce

This commit is contained in:
Supermichael777
2017-10-04 20:28:44 -04:00
committed by CitadelStationBot
parent 2d27df3adc
commit 63aa1c7153
4 changed files with 74 additions and 14 deletions
+39 -13
View File
@@ -27,13 +27,17 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mode = 0 //Controls what menu the PDA will display. 0 is hub; the rest are either built in or based on cartridge.
var/icon_alert = "pda-r" //Icon to be overlayed for message alerts. Taken from the pda icon file.
var/font_index = 0 //This int tells DM which font is currently selected and lets DM know when the last font has been selected so that it can cycle back to the first font when "toggle font" is pressed again.
var/font_mode = "font-family:\"VT323\", monospace;letter-spacing:1px;" //The currently selected font.
var/font_mode = "font-family:monospace;" //The currently selected font.
var/background_color = "#808000" //The currently selected background color.
#define FONT_VT 0
#define FONT_SHARE 1
#define FONT_ORBITRON 2
#define FONT_MONO 3
#define FONT_MONO "font-family:monospace;"
#define FONT_SHARE "font-family:\"Share Tech Mono\", monospace;letter-spacing:0px;"
#define FONT_ORBITRON "font-family:\"Orbitron\", monospace;letter-spacing:0px; font-size:15px"
#define FONT_VT "font-family:\"VT323\", monospace;letter-spacing:1px;"
#define MODE_MONO 0
#define MODE_SHARE 1
#define MODE_ORBITRON 2
#define MODE_VT 3
//Secondary variables
var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner.
@@ -54,6 +58,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/detonatable = TRUE // Can the PDA be blown up?
var/hidden = 0 // Is the PDA hidden from the PDA list?
var/emped = 0
var/equipped = FALSE //used here to determine if this is the first time its been picked up
var/obj/item/card/id/id = null //Making it possible to slot an ID card into the PDA so it can function as both.
var/ownjob = null //related to above
@@ -87,6 +92,27 @@ GLOBAL_LIST_EMPTY(PDAs)
inserted_item = new /obj/item/pen(src)
update_icon()
/obj/item/device/pda/equipped(mob/user, slot)
if(!equipped)
if(user.client)
switch(user.client.prefs.pda_style)
if(MONO)
font_index = MODE_MONO
font_mode = FONT_MONO
if(SHARE)
font_index = MODE_SHARE
font_mode = FONT_SHARE
if(ORBITRON)
font_index = MODE_ORBITRON
font_mode = FONT_ORBITRON
if(VT)
font_index = MODE_VT
font_mode = FONT_VT
else
font_index = MODE_MONO
font_mode = FONT_MONO
equipped = TRUE
/obj/item/device/pda/proc/update_label()
name = "PDA-[owner] ([ownjob])" //Name generalisation
@@ -335,14 +361,14 @@ GLOBAL_LIST_EMPTY(PDAs)
font_index = (font_index + 1) % 4
switch(font_index)
if (FONT_VT)
font_mode = "font-family:\"VT323\", monospace;letter-spacing:1px;"
if (FONT_SHARE)
font_mode = "font-family:\"Share Tech Mono\", monospace;letter-spacing:0px;"
if (FONT_ORBITRON)
font_mode = "font-family:\"Orbitron\", monospace;letter-spacing:0px; font-size:15px"
if (FONT_MONO)
font_mode = "font-family:monospace;"
if (MODE_MONO)
font_mode = FONT_MONO
if (MODE_SHARE)
font_mode = FONT_SHARE
if (MODE_ORBITRON)
font_mode = FONT_ORBITRON
if (MODE_VT)
font_mode = FONT_VT
if ("Change_Color")
var/new_color = input("Please enter a color name or hex value (Default is \'#808000\').")as color
background_color = new_color