Nano Obssession: Chromeless window, Styles

Does the following:
 - Adds 'chromeless' mode (NanoUI defaults to using this)
  - Window borders disappear, replaced by in-browser elements for
    minimize/close/move/resize.
  - You *must* move/resize slowly when using this mode, or it can have
    unexpected results, as the JavaScript cannot keep up as well as the
    native windows movement.
 - StatusGroups are now transparent: This looks nice. That's about it.
 - Body background switched to a .svg format for the NanoUI Logo.

 - Coder things:
  - Nano's JavaScript now has a new class, NanoWindow
   - NanoWindow handles all of the chromeless work. It'll be used to
     replace portions of NanoStateManager later.
This commit is contained in:
Tigercat2000
2016-01-18 09:47:12 -08:00
parent 5a88ea74f0
commit 48349a3d9e
22 changed files with 447 additions and 167 deletions
+5
View File
@@ -80,6 +80,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/ooccolor = "#b82e00"
var/be_special = list() //Special role selection
var/UI_style = "Midnight"
var/nanoui_fancy = TRUE
var/toggles = TOGGLES_DEFAULT
var/sound = SOUND_DEFAULT
var/UI_style_color = "#ffffff"
@@ -389,6 +390,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>General Settings</h2>"
dat += "<b>UI Style:</b> <a href='?_src_=prefs;preference=ui'><b>[UI_style]</b></a><br>"
dat += "<b>Fancy NanoUI:</b> <a href='?_src_=prefs;preference=nanoui'>[(nanoui_fancy) ? "Yes" : "No"]</a><br>"
dat += "<b>Custom UI settings:</b><br>"
dat += "<b>Color:</b> <a href='?_src_=prefs;preference=UIcolor'><b>[UI_style_color]</b></a> <table style='display:inline;' bgcolor='[UI_style_color]'><tr><td>__</td></tr></table><br>"
dat += "<b>Alpha (transparency):</b> <a href='?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
@@ -1488,6 +1490,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
else
UI_style = "Midnight"
if("nanoui")
nanoui_fancy = !nanoui_fancy
if("UIcolor")
var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!", UI_style_color) as color|null
if(!UI_style_color_new) return
+6 -2
View File
@@ -10,7 +10,8 @@
toggles,
sound,
randomslot,
volume
volume,
nanoui_fancy
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -34,6 +35,7 @@
sound = text2num(query.item[8])
randomslot = text2num(query.item[9])
volume = text2num(query.item[10])
nanoui_fancy = text2num(query.item[11])
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -46,6 +48,7 @@
UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha))
randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot))
volume = sanitize_integer(volume, 0, 100, initial(volume))
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -67,7 +70,8 @@
toggles='[toggles]',
sound='[sound]',
randomslot='[randomslot]',
volume='[volume]'
volume='[volume]',
nanoui_fancy='[nanoui_fancy]'
WHERE ckey='[C.ckey]'"}
)
+9 -2
View File
@@ -186,7 +186,15 @@ nanoui is used to open and update nano browser uis
"autoUpdateContent" = auto_update_content,
"showMap" = show_map,
"mapZLevel" = map_z_level,
"user" = list("name" = user.name)
"user" = list(
"name" = user.name,
"fancy" = user.client.prefs.nanoui_fancy
),
"window" = list(
"width" = width,
"height" = height,
"ref" = window_id
)
)
return config_data
@@ -334,7 +342,6 @@ nanoui is used to open and update nano browser uis
/datum/nanoui/proc/get_html()
// before the UI opens, add the layout files based on the layout key
add_stylesheet("layout_[layout_key].css")
add_template("layout", "layout_[layout_key].tmpl")
var/head_content = ""