From e6ea3b7c5fa799c4859357b8976b4a9c41c5648a Mon Sep 17 00:00:00 2001 From: ririchiyo Date: Sat, 10 Jan 2015 14:58:14 -0500 Subject: [PATCH] adding the ability for the stylesheet to be modified on a live server + timestamps --- code/controllers/configuration.dm | 1 + code/modules/admin/admin_verbs.dm | 2 ++ code/modules/admin/verbs/adminhelp.dm | 4 +-- code/modules/admin/verbs/adminpm.dm | 9 ++++--- code/modules/admin/verbs/adminsay.dm | 2 +- code/modules/admin/verbs/debug.dm | 18 ++++++++++++++ code/modules/client/client procs.dm | 11 ++++++--- code/stylesheet.dm | 35 ++++----------------------- interface/skin.dmf | 2 +- 9 files changed, 44 insertions(+), 40 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index bade956545d..891ce465369 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -1,6 +1,7 @@ /datum/configuration var/server_name = null // server name (for world name / status) var/server_suffix = 0 // generate numeric suffix based on server port + var/world_style_config = world_style var/nudge_script_path = "nudge.py" // where the nudge.py script is located diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 244b2fadfe8..5b7262e8f50 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -156,6 +156,8 @@ var/list/admin_verbs_debug = list( /client/proc/qdel_toggle, // /vg/ /client/proc/cmd_admin_dump_instances, // /vg/ /client/proc/disable_bloodvirii, // /vg/ + /client/proc/reload_style_sheet, + /client/proc/reset_style_sheet, /client/proc/configFood, /client/proc/debug_reagents, /client/proc/make_invulnerable, diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 726246dd8ba..ac3faa0c41c 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -87,7 +87,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if(!mob) return //this doesn't happen var/ref_mob = "\ref[mob]" - msg = "\blue HELP: [key_name(src, 1)] (?) (PP) (VV) (SM) (JMP) (CA) [ai_found ? " (CL)" : ""]: [msg]" + msg = "\[[time_stamp()]] \blue HELP: [key_name(src, 1)] (?) (PP) (VV) (SM) (JMP) (CA) [ai_found ? " (CL)" : ""]: [msg]" //send this msg to all admins var/admin_number_afk = 0 @@ -104,7 +104,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," //show it to the person adminhelping too if(src.prefs.special_popup) - src << output("PM to - Admins: [original_msg]", "window1.msay_output") + src << output("\[[time_stamp()]] PM to - Admins: [original_msg]", "window1.msay_output") else src << "PM to-Admins: [original_msg]" diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index c442c66b850..f89748431a1 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -111,13 +111,13 @@ adminhelp(reply) //sender has left, adminhelp instead return - recieve_message = "[recieve_pm_type] PM from-[key_name(src, C, C.holder ? 1 : 0)]: [msg]" + recieve_message = "\[[time_stamp()]] [recieve_pm_type] PM from-[key_name(src, C, C.holder ? 1 : 0)]: [msg]" if(C.prefs.special_popup) C << output(recieve_message, "window1.msay_output") else C << recieve_message if(src.prefs.special_popup) - src << output("[send_pm_type]PM to-[key_name(C, src, holder ? 1 : 0)]: [msg]", "window1.msay_output") + src << output("\[[time_stamp()]] [send_pm_type]PM to-[key_name(C, src, holder ? 1 : 0)]: [msg]", "window1.msay_output") else src << "[send_pm_type]PM to-[key_name(C, src, holder ? 1 : 0)]: [msg]" @@ -189,4 +189,7 @@ if(X == C || X == src) continue if(X.key!=key && X.key!=C.key && (X.holder.rights & R_ADMIN) || (X.holder.rights & R_MOD) ) - X << "PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]: \blue [msg]" //inform X + if(X.prefs.special_popup) + X << output("\[[time_stamp()]] PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]: \blue [msg]", "window1.msay_output") //inform X + else + X << "PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]: \blue [msg]" //inform X diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index c5e64d54f07..3fafc155e05 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -43,6 +43,6 @@ for(var/client/C in admins) if((R_ADMIN|R_MOD) & C.holder.rights) if(C.prefs.special_popup) - C << output("[key_name(src,1)] (JMP): [msg]", "window1.msay_output") + C << output("\[[time_stamp()]] [key_name(src,1)] (JMP): [msg]", "window1.msay_output") else C << "MOD: [key_name(src,1)] (JMP): [msg]" \ No newline at end of file diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index accc0db96c8..a296d38082f 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1162,6 +1162,24 @@ var/global/blood_virus_spreading_disabled = 0 else message_admins("[src.ckey] enabled findAirborneVirii.") +/client/proc/reload_style_sheet() + set category = "Server" + set name = "Reload Style Sheet" + set desc = "Reload the Style Sheet (be careful)." + + for(var/client/C in clients) + winset(C, null, "outputwindow.output.style=[config.world_style_config];") + message_admins("The style sheet has been reloaded by [src.ckey]") + +/client/proc/reset_style_sheet() + set category = "Server" + set name = "Reset Style Sheet" + set desc = "Reset the Style Sheet (restore to default)." + + for(var/client/C in clients) + winset(C, null, "outputwindow.output.style=[world_style];") + message_admins("The style sheet has been reset by [src.ckey]") + /client/proc/cmd_admin_cluwneize(var/mob/M in mob_list) set category = "Fun" set name = "Make Cluwne" diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 8aa9c7880f1..59bc756b1f5 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -65,11 +65,11 @@ if(config.automute_on && !holder && src.last_message == message) src.last_message_count++ if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE) - src << "\red You have exceeded the spam filter limit for identical messages. An auto-mute was applied." + src << "You have exceeded the spam filter limit for identical messages. An auto-mute was applied." cmd_admin_mute(src.mob, mute_type, 1) return 1 if(src.last_message_count >= SPAM_TRIGGER_WARNING) - src << "\red You are nearing the spam filter limit for identical messages." + src << "You are nearing the spam filter limit for identical messages." return 0 else last_message = message @@ -95,6 +95,11 @@ //CONNECT// /////////// /client/New(TopicData) + if(config) + winset(src, null, "outputwindow.output.style=[config.world_style_config];") + winset(src, null, "window1.msay_output.style=[config.world_style_config];") // it isn't possible to set two window elements in the same winset so we need to call it for each element we're assigning a stylesheet. + else + src << "The stylesheet wasn't properly setup call an administrator to reload the stylesheet or relog." TopicData = null //Prevent calls to client.Topic from connect if(connection != "seeker") //Invalid connection type. @@ -112,7 +117,7 @@ src.preload_rsc = pick(config.resource_urls) else src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal. - src << "\red If the title screen is black, resources are still downloading. Please be patient until the title screen appears." + src << "If the title screen is black, resources are still downloading. Please be patient until the title screen appears." clients += src directory[ckey] = src diff --git a/code/stylesheet.dm b/code/stylesheet.dm index 41ab3384ab2..3f6e4c430b2 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -1,28 +1,19 @@ -client/script = {""} +.recruit {color: #5c00e6; font-weight: bold; font-style: italic;}\""} \ No newline at end of file diff --git a/interface/skin.dmf b/interface/skin.dmf index c51f9f8732e..ccca927deb1 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1352,7 +1352,7 @@ window "outputwindow" on-size = "" link-color = #0000ff visited-color = #ff00ff - style = ".system {color:#ff0000;}" + style = "" enable-http-images = false max-lines = 1000 image = ""