mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Modular Computer Themes and PDA theme game preference option (#15735)
* themes and stuff * theme app cleanup * that should be it * i said commit * readability * comment cleanup * mooglecode * moog spacing Co-authored-by: Redmoogle <dakotamew@gmail.com> * Bibby * there actual names * not needed Co-authored-by: Redmoogle <dakotamew@gmail.com>
This commit is contained in:
@@ -1,24 +1,32 @@
|
||||
// This is the base type that does all the hardware stuff.
|
||||
// Other types expand it - tablets use a direct subtypes, and
|
||||
// consoles and laptops use "procssor" item that is held inside machinery piece
|
||||
/** This is the base type that does all the hardware stuff.
|
||||
* Other types expand it - tablets use a direct subtypes, and
|
||||
* consoles and laptops use "procssor" item that is held inside machinery piece
|
||||
*/
|
||||
/obj/item/modular_computer
|
||||
name = "modular microcomputer"
|
||||
desc = "A small portable microcomputer."
|
||||
|
||||
flags_1 = RAD_PROTECT_CONTENTS_1
|
||||
|
||||
var/enabled = FALSE // Whether the computer is turned on.
|
||||
var/screen_on = TRUE // Whether the computer is active/opened/it's screen is on.
|
||||
var/device_theme = "ntos" // Sets the theme for the main menu, hardware config, and file browser apps. Overridden by certain non-NT devices.
|
||||
var/datum/computer_file/program/active_program = null // A currently active program running on the computer.
|
||||
var/hardware_flag = 0 // A flag that describes this device type
|
||||
/// Whether the computer is turned on.
|
||||
var/enabled = FALSE
|
||||
/// Whether the computer is active/opened/it's screen is on.
|
||||
var/screen_on = TRUE
|
||||
/// Sets the theme for the main menu, hardware config, and file browser apps. Overridden by certain non-NT devices.
|
||||
var/device_theme = "ntos"
|
||||
/// A currently active program running on the computer.
|
||||
var/datum/computer_file/program/active_program = null
|
||||
// A flag that describes this device type
|
||||
var/hardware_flag = 0
|
||||
var/last_power_usage = 0
|
||||
var/last_battery_percent = 0 // Used for deciding if battery percentage has chandged
|
||||
// Used for deciding if battery percentage has changed
|
||||
var/last_battery_percent = 0
|
||||
var/last_world_time = "00:00"
|
||||
var/list/last_header_icons
|
||||
|
||||
var/base_active_power_usage = 50 // Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
|
||||
var/base_idle_power_usage = 5 // Power usage when the computer is idle and screen is off (currently only applies to laptops)
|
||||
/// Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
|
||||
var/base_active_power_usage = 50
|
||||
/// Power usage when the computer is idle and screen is off (currently only applies to laptops)
|
||||
var/base_idle_power_usage = 5
|
||||
|
||||
// Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..)
|
||||
// must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently
|
||||
@@ -26,14 +34,22 @@
|
||||
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "laptop-open"
|
||||
var/icon_state_unpowered = null // Icon state when the computer is turned off.
|
||||
var/icon_state_powered = null // Icon state when the computer is turned on.
|
||||
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
|
||||
var/id_rename = FALSE // If we should update the name of the computer with the name and job of the stored ID.
|
||||
var/icon_state_screensaver = "standby" // Icon state overlay when the computer is turned off, but not out of power.
|
||||
var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
|
||||
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
var/overlay_skin = null // What set of icons should be used for program overlays.
|
||||
/// Icon state when the computer is turned off.
|
||||
var/icon_state_unpowered = null
|
||||
/// Icon state when the computer is turned on.
|
||||
var/icon_state_powered = null
|
||||
/// Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
|
||||
var/icon_state_menu = "menu"
|
||||
/// If we should update the name of the computer with the name and job of the stored ID.
|
||||
var/id_rename = FALSE
|
||||
/// Icon state overlay when the computer is turned off, but not out of power.
|
||||
var/icon_state_screensaver = "standby"
|
||||
/// Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
|
||||
var/max_hardware_size = 0
|
||||
/// Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
var/steel_sheet_cost = 5
|
||||
/// What set of icons should be used for program overlays.
|
||||
var/overlay_skin = null
|
||||
|
||||
integrity_failure = 50
|
||||
max_integrity = 100
|
||||
@@ -45,13 +61,18 @@
|
||||
var/list/expansion_bays
|
||||
/// Number of total expansion bays this computer has available.
|
||||
var/max_bays = 0
|
||||
|
||||
var/list/idle_threads // Idle programs on background. They still receive process calls but can't be interacted with.
|
||||
var/obj/physical = null // Object that represents our computer. It's used for Adjacent() and UI visibility checks.
|
||||
var/has_light = FALSE //If the computer has a flashlight/LED light/what-have-you installed
|
||||
var/light_on = FALSE //If that light is enabled
|
||||
var/comp_light_luminosity = 3 //The brightness of that light
|
||||
var/comp_light_color //The color of that light
|
||||
/// Idle programs on background. They still receive process calls but can't be interacted with.
|
||||
var/list/idle_threads
|
||||
/// Object that represents our computer. It's used for Adjacent() and UI visibility checks.
|
||||
var/obj/physical = null
|
||||
///If the computer has a flashlight/LED light/what-have-you installed
|
||||
var/has_light = FALSE
|
||||
///If that light is enabled
|
||||
var/light_on = FALSE
|
||||
///The brightness of that light
|
||||
var/comp_light_luminosity = 3
|
||||
///The color of that light
|
||||
var/comp_light_color
|
||||
|
||||
// Preset Stuff
|
||||
var/list/starting_components = list()
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//this is the program that lets you change the theme of your device
|
||||
|
||||
/datum/computer_file/program/themeify
|
||||
filename = "themeify"
|
||||
filedesc = "Themeify"
|
||||
extended_desc = "This program allows configuration of your device's theme."
|
||||
program_icon_state = "generic"
|
||||
unsendable = TRUE
|
||||
undeletable = FALSE
|
||||
size = 2
|
||||
available_on_ntnet = TRUE
|
||||
requires_ntnet = FALSE
|
||||
tgui_id = "NtosThemeConfigure"
|
||||
program_icon="paint-roller"
|
||||
|
||||
|
||||
/datum/computer_file/program/themeify/ui_data(mob/user)
|
||||
var/list/data = get_header_data()
|
||||
var/list/theme_collection = list()
|
||||
for(var/theme_key in GLOB.pda_themes)
|
||||
theme_collection += list(list("theme_name" = theme_key, "theme_file" = GLOB.pda_themes[theme_key]))
|
||||
data["theme_collection"] = theme_collection
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/themeify/ui_act(action,params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("PRG_change_theme")
|
||||
computer.device_theme = GLOB.pda_themes[sanitize_inlist(params["theme_title"], GLOB.pda_themes, PDA_THEME_TITLE_NTOS)]
|
||||
@@ -187,6 +187,7 @@
|
||||
/obj/item/computer_hardware/hard_drive/small/pda
|
||||
/obj/item/computer_hardware/hard_drive/small/pda/install_default_programs()
|
||||
..()
|
||||
store_file(new/datum/computer_file/program/themeify(src))
|
||||
store_file(new/datum/computer_file/program/pdamessager(src))
|
||||
store_file(new/datum/computer_file/program/chatclient(src))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user