Merge pull request #34470 from Cyberboss/MoveMotd
Moves load_motd to config controller
This commit is contained in:
committed by
CitadelStationBot
parent
d2d1a063a7
commit
2dd1f1f799
@@ -3,7 +3,6 @@ GLOBAL_REAL(config, /datum/controller/configuration)
|
||||
GLOBAL_DATUM_INIT(revdata, /datum/getrev, new)
|
||||
|
||||
GLOBAL_VAR(host)
|
||||
GLOBAL_VAR(join_motd)
|
||||
GLOBAL_VAR(station_name)
|
||||
GLOBAL_VAR_INIT(game_version, "/tg/ Station 13")
|
||||
GLOBAL_VAR_INIT(changelog_hash, "")
|
||||
|
||||
@@ -18,6 +18,8 @@ GLOBAL_PROTECT(config_dir)
|
||||
var/list/mode_reports
|
||||
var/list/mode_false_report_weight
|
||||
|
||||
var/motd
|
||||
|
||||
/datum/controller/configuration/New()
|
||||
config = src
|
||||
InitEntries()
|
||||
@@ -28,6 +30,7 @@ GLOBAL_PROTECT(config_dir)
|
||||
LoadEntries("dbconfig.txt")
|
||||
LoadEntries("comms.txt")
|
||||
loadmaplist(CONFIG_MAPS_FILE)
|
||||
LoadMOTD()
|
||||
|
||||
/datum/controller/configuration/Destroy()
|
||||
entries_by_type.Cut()
|
||||
@@ -192,6 +195,12 @@ GLOBAL_PROTECT(config_dir)
|
||||
qdel(M)
|
||||
votable_modes += "secret"
|
||||
|
||||
/datum/controller/configuration/proc/LoadMOTD()
|
||||
motd = file2text("[GLOB.config_dir]/motd.txt")
|
||||
var/tm_info = GLOB.revdata.GetTestMergeInfo()
|
||||
if(motd || tm_info)
|
||||
motd = motd ? "[motd]<br>[tm_info]" : tm_info
|
||||
|
||||
/datum/controller/configuration/proc/loadmaplist(filename)
|
||||
log_config("Loading config file [filename]...")
|
||||
filename = "[GLOB.config_dir][filename]"
|
||||
|
||||
@@ -24,7 +24,6 @@ GLOBAL_PROTECT(security_mode)
|
||||
|
||||
SERVER_TOOLS_ON_NEW
|
||||
|
||||
load_motd()
|
||||
load_admins()
|
||||
LoadVerbs(/datum/verbs/menu)
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
@@ -195,9 +194,6 @@ GLOBAL_PROTECT(security_mode)
|
||||
log_world("World rebooted at [time_stamp()]")
|
||||
..()
|
||||
|
||||
/world/proc/load_motd()
|
||||
GLOB.join_motd = file2text("config/motd.txt") + "<br>" + GLOB.revdata.GetTestMergeInfo()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
|
||||
@@ -229,8 +229,9 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR)
|
||||
set category = "OOC"
|
||||
set desc ="Check the Message of the Day"
|
||||
|
||||
if(GLOB.join_motd)
|
||||
to_chat(src, "<div class=\"motd\">[GLOB.join_motd]</div>")
|
||||
var/motd = global.config.motd
|
||||
if(motd)
|
||||
to_chat(src, "<div class=\"motd\">[motd]</div>")
|
||||
else
|
||||
to_chat(src, "<span class='notice'>The Message of the Day has not been set.</span>")
|
||||
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
|
||||
..()
|
||||
|
||||
if(GLOB.join_motd)
|
||||
to_chat(src, "<div class=\"motd\">[GLOB.join_motd]</div>")
|
||||
var/motd = global.config.motd
|
||||
if(motd)
|
||||
to_chat(src, "<div class=\"motd\">[motd]</div>")
|
||||
|
||||
if(GLOB.admin_notice)
|
||||
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [GLOB.admin_notice]</span>")
|
||||
|
||||
Reference in New Issue
Block a user