dark skin for reals (#7084)

This passed review with (#7035) let's get this.
This commit is contained in:
Karolis
2019-09-28 23:09:01 +03:00
committed by Erki
parent 80052b3a5e
commit c540d9d021
13 changed files with 1663 additions and 78 deletions
@@ -8,34 +8,9 @@ Byond Vue UI framework's management subsystem
flags = 0
init_order = SS_INIT_MISC_FIRST
priority = SS_PRIORITY_NANOUI
init_order = SS_INIT_MISC_FIRST
stat_tag = "O"
var/list/open_uis
var/list/available_html_themes = list(
"Nano" = list(
"name" = "Nano Dark",
"class" = "theme-nano",
"type" = THEME_TYPE_DARK
),
"Nano Light" = list(
"name" = "Nano Light",
"class" = "theme-nano-light",
"type" = THEME_TYPE_LIGHT
),
"Basic" = list(
"name" = "Basic Light",
"class" = "theme-basic",
"type" = THEME_TYPE_LIGHT
),
"Basic Dark" = list(
"name" = "Basic Dark",
"class" = "theme-basic-dark",
"type" = THEME_TYPE_DARK
)
)
var/list/var_monitor_map
/datum/controller/subsystem/processing/vueui/New()
@@ -47,14 +22,8 @@ Byond Vue UI framework's management subsystem
for (var/path in subtypesof(/datum/vueui_var_monitor))
var/datum/vueui_var_monitor/VM = new path()
var_monitor_map[VM.subject_type] = VM
..()
for(var/mob/M in mob_list)
var/mob/abstract/new_player/np = M
if(istype(np))
np.new_player_panel_proc()
/**
* Gets a vueui_var_monitor associated with the given source type.
*
@@ -227,48 +196,4 @@ Byond Vue UI framework's management subsystem
if (!LAZYLEN(open_uis[old_object_key]))
open_uis -= old_object_key
/datum/controller/subsystem/processing/vueui/proc/get_html_theme(var/mob/user)
var/client/cl = null
if(istype(user))
cl = user.client
else
if(istype(user, /client))
cl = user
if(!cl)
return
var/style = cl.prefs.html_UI_style
if(!(style in available_html_themes))
style = "Nano"
return available_html_themes[style]
/datum/controller/subsystem/processing/vueui/proc/get_html_theme_class(var/mob/user)
var/list/theme = get_html_theme(user)
if(!theme)
return FALLBACK_HTML_THEME
var/class = ""
class += "[theme["class"]]"
if(theme["type"] == THEME_TYPE_DARK)
class += " dark-theme"
return class
/proc/send_theme_resources(var/user)
#ifdef UIDEBUG
user << browse_rsc(file("vueui/dist/app.js"), "vueui.js")
user << browse_rsc(file("vueui/dist/app.css"), "vueui.css")
#else
simple_asset_ensure_is_sent(user, /datum/asset/simple/vueui)
#endif
/proc/get_html_theme_header(var/themeclass, var/extra_header = "")
return {"<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"><link rel="stylesheet" type="text/css" href="vueui.css">[extra_header]</head><body class="[themeclass]">"}
/proc/get_html_theme_footer()
return {"</body></html>"}
/proc/enable_ui_theme(var/user, var/contents, var/extra_header = "")
var/theme_class = FALLBACK_HTML_THEME
if(SSvueui)
theme_class = SSvueui.get_html_theme_class(user)
return get_html_theme_header(theme_class, extra_header) + contents + get_html_theme_footer()
#undef NULL_OR_EQUAL