Custom HUD colors

This commit is contained in:
ZomgPonies
2013-11-30 18:30:18 -05:00
parent d14866c354
commit ebb29c625e
7 changed files with 128 additions and 13 deletions
+2 -3
View File
@@ -269,6 +269,5 @@ proc/tg_list2text(list/list, glue=",")
/proc/ui_style2icon(ui_style)
switch(ui_style)
if("old") return 'icons/mob/screen1_old.dmi'
if("Orange") return 'icons/mob/screen1_Orange.dmi'
else return 'icons/mob/screen1_Midnight.dmi'
if("Midnight") return 'icons/mob/screen1_Midnight.dmi'
else return 'icons/mob/screen1_White.dmi'
+3 -1
View File
@@ -169,9 +169,11 @@ datum/hud/New(mob/owner)
if(!ismob(mymob)) return 0
if(!mymob.client) return 0
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
var/ui_color = mymob.client.prefs.UI_style_color
var/ui_alpha = mymob.client.prefs.UI_style_alpha
if(ishuman(mymob))
human_hud(ui_style) // Pass the player the UI style chosen in preferences
human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences
else if(ismonkey(mymob))
monkey_hud(ui_style)
else if(isbrain(mymob))
+55 -1
View File
@@ -1,4 +1,4 @@
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_old.dmi')
/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255)
src.adding = list()
src.other = list()
@@ -73,6 +73,8 @@
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
move_intent = using
@@ -82,6 +84,8 @@
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.hotkeybuttons += using
inv_box = new /obj/screen/inventory()
@@ -92,6 +96,8 @@
inv_box.icon_state = "center"
inv_box.screen_loc = ui_iclothing
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -101,6 +107,8 @@
inv_box.slot_id = slot_wear_suit
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_oclothing
inv_box.color = ui_color
inv_box.alpha = ui_alpha
inv_box.layer = 19
src.other += inv_box
@@ -114,6 +122,8 @@
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.r_hand_hud_object = inv_box
src.adding += inv_box
@@ -127,6 +137,8 @@
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.l_hand_hud_object = inv_box
src.adding += inv_box
@@ -137,6 +149,8 @@
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
using = new /obj/screen/inventory()
@@ -146,6 +160,8 @@
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
inv_box = new /obj/screen/inventory()
@@ -156,6 +172,8 @@
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_wear_id
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
@@ -166,6 +184,8 @@
inv_box.screen_loc = ui_pda
inv_box.slot_id = slot_wear_pda
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
@@ -176,6 +196,8 @@
inv_box.screen_loc = ui_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -186,6 +208,8 @@
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
@@ -195,6 +219,8 @@
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
@@ -204,6 +230,8 @@
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
inv_box = new /obj/screen/inventory()
@@ -214,6 +242,8 @@
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = slot_s_store
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
using = new /obj/screen()
@@ -222,6 +252,8 @@
using.icon_state = "act_resist"
using.screen_loc = ui_pull_resist
using.layer = 19
using.color = ui_color
using.alpha = ui_alpha
src.hotkeybuttons += using
using = new /obj/screen()
@@ -230,6 +262,8 @@
using.icon_state = "other"
using.screen_loc = ui_inventory
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
using = new /obj/screen()
@@ -238,6 +272,8 @@
using.icon_state = "act_equip"
using.screen_loc = ui_equip
using.layer = 20
using.color = ui_color
using.alpha = ui_alpha
src.adding += using
inv_box = new /obj/screen/inventory()
@@ -247,6 +283,8 @@
inv_box.screen_loc = ui_gloves
inv_box.slot_id = slot_gloves
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -256,6 +294,8 @@
inv_box.screen_loc = ui_glasses
inv_box.slot_id = slot_glasses
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -265,6 +305,8 @@
inv_box.screen_loc = ui_l_ear
inv_box.slot_id = slot_l_ear
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -274,6 +316,8 @@
inv_box.screen_loc = ui_r_ear
inv_box.slot_id = slot_r_ear
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -283,6 +327,8 @@
inv_box.screen_loc = ui_head
inv_box.slot_id = slot_head
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -292,6 +338,8 @@
inv_box.screen_loc = ui_shoes
inv_box.slot_id = slot_shoes
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.other += inv_box
inv_box = new /obj/screen/inventory()
@@ -301,6 +349,8 @@
inv_box.screen_loc = ui_belt
inv_box.slot_id = slot_belt
inv_box.layer = 19
inv_box.color = ui_color
inv_box.alpha = ui_alpha
src.adding += inv_box
mymob.throw_icon = new /obj/screen()
@@ -308,6 +358,8 @@
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.throw_icon.color = ui_color
mymob.throw_icon.alpha = ui_alpha
src.hotkeybuttons += mymob.throw_icon
mymob.oxygen = new /obj/screen()
@@ -392,6 +444,8 @@
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.icon = ui_style
mymob.zone_sel.color = ui_color
mymob.zone_sel.alpha = ui_alpha
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
+20 -6
View File
@@ -44,6 +44,9 @@ datum/preferences
var/be_special = 0 //Special role selection
var/UI_style = "Midnight"
var/toggles = TOGGLES_DEFAULT
var/UI_style_color = "#ffffff"
var/UI_style_alpha = 255
//character preferences
var/real_name //our character's name
@@ -258,7 +261,10 @@ datum/preferences
if (1) // General Preferences
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>UI Style:</b> <a href='?_src_=prefs;preference=ui'><b>[UI_style]</b></a><br>"
dat += "<b>Custom UI</b>(recommended for White UI):<br>"
dat += "-Color: <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 += "-Alpha(transparence): <a href='?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
dat += "<b>Play admin midis:</b> <a href='?_src_=prefs;preference=hear_midis'><b>[(toggles & SOUND_MIDI) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Play lobby music:</b> <a href='?_src_=prefs;preference=lobby_music'><b>[(toggles & SOUND_LOBBY) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Ghost ears:</b> <a href='?_src_=prefs;preference=ghost_ears'><b>[(toggles & CHAT_GHOSTEARS) ? "Nearest Creatures" : "All Speech"]</b></a><br>"
@@ -1117,16 +1123,24 @@ datum/preferences
if("hear_adminhelps")
toggles ^= SOUND_ADMINHELP
/*
if("ui")
switch(UI_style)
if("Midnight")
UI_style = "Orange"
if("Orange")
UI_style = "old"
UI_style = "White"
else
UI_style = "Midnight"
*/
if("UIcolor")
var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!") as color|null
if(!UI_style_color_new) return
UI_style_color = UI_style_color_new
if("UIalpha")
var/UI_style_alpha_new = input(user, "Select a new alpha(transparence) parametr for UI, between 50 and 255") as num
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
UI_style_alpha = UI_style_alpha_new
if("be_special")
var/num = text2num(href_list["num"])
be_special ^= (1<<num)
+10 -1
View File
@@ -54,14 +54,20 @@
S["be_special"] >> be_special
S["default_slot"] >> default_slot
S["toggles"] >> toggles
S["UI_style_color"] >> UI_style_color
S["UI_style_alpha"] >> UI_style_alpha
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("Midnight","Orange","old"), initial(UI_style))
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
default_slot = sanitize_integer(default_slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color))
UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha))
return 1
@@ -80,6 +86,9 @@
S["be_special"] << be_special
S["default_slot"] << default_slot
S["toggles"] << toggles
S["UI_style_color"] << UI_style_color
S["UI_style_alpha"] << UI_style_alpha
return 1
+38 -1
View File
@@ -135,4 +135,41 @@
prefs.be_special ^= role_flag
prefs.save_preferences()
src << "You will [(prefs.be_special & role_flag) ? "now" : "no longer"] be considered for [role] events (where possible)."
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/change_ui()
set name = "Change UI"
set category = "Preferences"
set desc = "Configure your user interface"
if(!ishuman(usr))
usr << "This only for human"
return
var/UI_style_new = input(usr, "Select a style, we recommend White for customization") in list("White", "Midnight", "Orange", "old")
if(!UI_style_new) return
var/UI_style_alpha_new = input(usr, "Select a new alpha(transparence) parametr for UI, between 50 and 255") as num
if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return
var/UI_style_color_new = input(usr, "Choose your UI color, dark colors are not recommended!") as color|null
if(!UI_style_color_new) return
//update UI
var/list/icons = usr.hud_used.adding + usr.hud_used.other +usr.hud_used.hotkeybuttons
icons.Add(usr.zone_sel)
for(var/obj/screen/I in icons)
if(I.color && I.alpha)
I.icon = ui_style2icon(UI_style_new)
I.color = UI_style_color_new
I.alpha = UI_style_alpha_new
if(alert("Like it? Save changes?",,"Yes", "No") == "Yes")
prefs.UI_style = UI_style_new
prefs.UI_style_alpha = UI_style_alpha_new
prefs.UI_style_color = UI_style_color_new
prefs.save_preferences()
usr << "UI was saved"
Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB