Applying PDA overhaul Upstream (#30613)

* Applying PDA overhaul Upstream

Yeet?

* Used lordpidey's change

Like this?

* The build failed so I'm changing it back

* Update PDA.dm

* Update PDA.dm

* Make the settings visible only on the main screen

mode 0 is the hub, and the hub is the main menu. I think it'd be a lot more convenient for players to always have these options on the main menu if they need them. Makes it really easy to swap colors and fonts at the beginning of the round. I can put it in a settings menu if everyone really thinks it's necessary, but then someone would have to help me actually make the damn icons show up.

* Update PDA.dm

* Update PDA.dm

* Wait, I'm an idiot. I was editing the wrong thing.

* Here's your switch statements boi

* Declare font_index at the "Toggle_Font" code

I declared it exactly where it's relevant, but I think this looks unclean. I also redefined it which I actually needed to do.

* Replaced it where it was

cuz the build broke

* Make the color changer a picker instead of a field

An attempt

* Made these defines

@optimumtact @Cyberboss Like this?
This commit is contained in:
Tungsten
2017-09-28 22:43:22 -04:00
committed by CitadelStationBot
parent d25894447e
commit c6c6f67d03
33 changed files with 34 additions and 1 deletions
+34 -1
View File
@@ -26,6 +26,14 @@ GLOBAL_LIST_EMPTY(PDAs)
var/obj/item/cartridge/cartridge = null //current cartridge
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/background_color = "#808000" //The currently selected background color.
#define FONT_VT 0
#define FONT_SHARE 1
#define FONT_ORBITRON 2
#define FONT_MONO 3
//Secondary variables
var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner.
@@ -121,7 +129,8 @@ GLOBAL_LIST_EMPTY(PDAs)
hidden_uplink.interact(user)
return
var/dat = "<html><head><title>Personal Data Assistant</title></head><body bgcolor=\"#808000\"><style>a, a:link, a:visited, a:active, a:hover { color: #000000; }img {border-style:none;}</style>"
var/dat = "<!DOCTYPE html><html><head><title>Personal Data Assistant</title><link href=\"https://fonts.googleapis.com/css?family=Orbitron|Share+Tech+Mono|VT323\" rel=\"stylesheet\"></head><body bgcolor=\"" + background_color + "\"><style>body{" + font_mode + "}ul,ol{list-style-type: none;}a, a:link, a:visited, a:active, a:hover { color: #000000;text-decoration:none; }img {border-style:none;}</style>"
dat += "<a href='byond://?src=\ref[src];choice=Refresh'><img src=pda_refresh.png> Refresh</a>"
@@ -130,6 +139,12 @@ GLOBAL_LIST_EMPTY(PDAs)
if (mode)
dat += " | <a href='byond://?src=\ref[src];choice=Return'><img src=pda_menu.png> Return</a>"
if (mode == 0)
dat += "<div align=\"center\">"
dat += "<br><a href='byond://?src=\ref[src];choice=Toggle_Font'>Toggle Font</a>"
dat += " | <a href='byond://?src=\ref[src];choice=Change_Color'>Change Color</a>"
dat += "</div>"
dat += "<br>"
if (!owner)
@@ -307,6 +322,24 @@ GLOBAL_LIST_EMPTY(PDAs)
//BASIC FUNCTIONS===================================
if("Refresh")//Refresh, goes to the end of the proc.
if ("Toggle_Font")
//CODE REVISION 2
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 ("Change_Color")
var/new_color = input("Please enter a color name or hex value (Default is \'#808000\').")as color
background_color = new_color
if("Return")//Return
if(mode<=9)
mode = 0