Hub refresh - Cleans up update_status(), adds more hub-related config options, and more!

This commit is contained in:
deathride58
2022-05-05 14:52:53 -04:00
parent bb1a7a61a2
commit 40730237f2
5 changed files with 51 additions and 48 deletions

View File

@@ -292,6 +292,8 @@ GLOBAL_LIST_INIT(station_names, world.file2list("strings/station_names.txt" + ""
GLOBAL_LIST_INIT(station_suffixes, world.file2list("strings/station_suffixes.txt"))
GLOBAL_LIST_INIT(server_taglines, world.file2list("strings/server_taglines.txt"))
GLOBAL_LIST_INIT(greek_letters, world.file2list("strings/greek_letters.txt"))
GLOBAL_LIST_INIT(phonetic_alphabet, world.file2list("strings/phonetic_alphabet.txt"))

View File

@@ -2,9 +2,15 @@
/datum/config_entry/string/servername // server name (the name of the game window)
/datum/config_entry/string/communityshortname // short name of the server's community
/datum/config_entry/string/communitylink // link to the server's website
/datum/config_entry/string/servertagline
config_entry_value = "We forgot to set the server's tagline in config.txt"
/datum/config_entry/flag/usetaglinestrings
/datum/config_entry/string/serversqlname // short form server name used for the DB
/datum/config_entry/string/stationname // station name (the name of the station in-game)

View File

@@ -285,63 +285,47 @@ GLOBAL_LIST(topic_status_cache)
..()
/world/proc/update_status()
. = ""
if(!config)
status = "<b>SERVER LOADING OR BROKEN.</b> (18+)"
return
var/list/features = list()
game_state = (CONFIG_GET(number/extreme_popcap) && GLOB.clients.len >= CONFIG_GET(number/extreme_popcap))
// if(GLOB.master_mode)
// features += GLOB.master_mode
// ---Hub title---
var/servername = CONFIG_GET(string/servername)
var/stationname = station_name()
var/defaultstation = CONFIG_GET(string/stationname)
if(servername || stationname != defaultstation)
. += (servername ? "<b>[servername] - " : "<b>")
. += (stationname != defaultstation ? "[stationname]</b>\] " : "</b>\] ")
// if (!GLOB.enter_allowed)
// features += "closed"
var/communityname = CONFIG_GET(string/communityshortname)
var/communitylink = CONFIG_GET(string/communitylink)
if(communityname)
. += (communitylink ? "(<a href=\"[communitylink]\">[communityname]</a>) " : "([communityname]) ")
var/s = ""
var/hostedby
if(config)
var/server_name = CONFIG_GET(string/servername)
if (server_name)
s += "<b>[server_name]</b> &#8212; "
// features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn"
// if(CONFIG_GET(flag/allow_vote_mode))
// features += "vote"
// if(CONFIG_GET(flag/allow_ai))
// features += "AI allowed"
hostedby = CONFIG_GET(string/hostedby)
s += "<b>[station_name()]</b>";
s += " ("
s += "<a href=\"https://citadel-station.net/home\">" //Change this to wherever you want the hub to link to.
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version.
s += "</a>"
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
s += "<br>[CONFIG_GET(string/servertagline)]<br>" //CIT CHANGE - adds a tagline!
var/players = GLOB.clients.len
if(SSmapping.config) // this just stops the runtime, honk.
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
if(NUM2SECLEVEL(GLOB.security_level))//CIT CHANGE - makes the hub entry show the security level
features += "[NUM2SECLEVEL(GLOB.security_level)] alert"
var/popcaptext = ""
var/popcap = max(CONFIG_GET(number/extreme_popcap), CONFIG_GET(number/hard_popcap), CONFIG_GET(number/soft_popcap))
if(popcap)
popcaptext = "/[popcap]"
. += "([GLOB.clients.len]/[popcap]) "
if (players > 1)
features += "[players][popcaptext] players"
else if (players > 0)
features += "[players][popcaptext] player"
. += "(18+)<br>" //This is obligatory forr obvious reasons.
game_state = (CONFIG_GET(number/extreme_popcap) && players >= CONFIG_GET(number/extreme_popcap)) //tells the hub if we are full
// ---Hub body---
var/tagline = (CONFIG_GET(flag/usetaglinestrings) ? pick(GLOB.server_taglines) : CONFIG_GET(string/servertagline))
if(tagline)
. += "[tagline]<br>"
if (!host && hostedby)
features += "hosted by <b>[hostedby]</b>"
// ---Hub footer---
. += "\["
if(SSmapping.config)
. += "[SSmapping.config.map_name], "
if(NUM2SECLEVEL(GLOB.security_level))
. += "[NUM2SECLEVEL(GLOB.security_level)] alert, "
if (features)
s += "\[[jointext(features, ", ")]"
. += "[get_active_player_count(afk_check = TRUE)] playing"
status = s
status = .
/world/proc/update_hub_visibility(new_visibility)
if(new_visibility == GLOB.hub_visibility)

View File

@@ -4,9 +4,19 @@
## Server name: This appears at the top of the screen in-game and in the BYOND hub. Uncomment and replace 'tgstation' with the name of your choice.
# SERVERNAME tgstation
## Community short-name: This appears in parentheses after the server's active station name
# COMMUNITYSHORTNAME tg???
## Community link: Requires a community short-name defined. Attaches a link to the community's shortname, and requires a short-name defined.
## You could alternatively just add raw HTML to the above, but this is more newbie-friendly
# COMMUNITYLINK http://crouton.net
## Server tagline: This will appear right below the server's title.
# SERVERTAGLINE A generic TG-based server
## Use tagline strings: Uncomment to have the server's tagline be randomly selected from taglines.txt
# USETAGLINESTRINGS
## Server SQL name: This is the name used to identify the server to the SQL DB, distinct from SERVERNAME as it must be at most 32 characters.
# SERVERSQLNAME tgstation

View File

@@ -0,0 +1 @@
Fill in your own community quotes and memery here!