Skip to content

Commit

Permalink
Makes lobby art use config
Browse files Browse the repository at this point in the history
  • Loading branch information
spookydonut committed Dec 14, 2020
1 parent c07d53a commit cc4f87d
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 29 deletions.
1 change: 1 addition & 0 deletions ColonialMarinesALPHA.dme
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
#include "code\controllers\subsystem\xenocon.dm"
#include "code\controllers\subsystem\init\landmarks.dm"
#include "code\controllers\subsystem\init\law.dm"
#include "code\controllers\subsystem\init\lobby_art.dm"
#include "code\controllers\subsystem\init\mapview.dm"
#include "code\controllers\subsystem\processing\objects.dm"
#include "code\controllers\subsystem\processing\processing.dm"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#define SS_INIT_PLAYTIME -27
#define SS_INIT_OBJECTIVES -31
#define SS_INIT_MAPVIEW -32
#define SS_INIT_LOBBYART -33

#define SS_PRIORITY_TIMER 700
#define SS_PRIORITY_CHAT 300
Expand Down
14 changes: 14 additions & 0 deletions code/controllers/configuration/config_entry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@
config_entry_value = text2num(trim(str_val)) != 0
return TRUE

/// List config entry, used for configuring a list of strings
/datum/config_entry/str_list
abstract_type = /datum/config_entry/str_list
config_entry_value = list()
dupes_allowed = TRUE

/datum/config_entry/str_list/ValidateAndSet(str_val)
if (!VASProcCallGuard(str_val))
return FALSE
str_val = trim(str_val)
if (str_val != "")
config_entry_value += str_val
return TRUE

/datum/config_entry/number_list
abstract_type = /datum/config_entry/number_list
config_entry_value = list()
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,7 @@ This maintains a list of ip addresses that are able to bypass topic filtering.
/datum/config_entry/flag/report_runtimes

/datum/config_entry/flag/record_rounds

/datum/config_entry/str_list/lobby_art_images

/datum/config_entry/str_list/lobby_art_authors
10 changes: 10 additions & 0 deletions code/controllers/subsystem/init/lobby_art.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SUBSYSTEM_DEF(lobby_art)
name = "Lobby Art"
init_order = SS_INIT_LOBBYART
flags = SS_NO_FIRE

/datum/controller/subsystem/lobby_art/Initialize()
. = ..()
var/list/lobby_arts = CONFIG_GET(str_list/lobby_art_images)
if(length(lobby_arts))
force_lobby_art(rand(1,length(lobby_arts)))
16 changes: 6 additions & 10 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
/turf/closed/wall/indestructible/splashscreen
name = "Lobby Art"
desc = "Assorted artworks."
icon_state = "lobbyart1"
icon_state = ""
// icon_state = "title_holiday"
layer = FLY_LAYER
special_icon = 1
Expand All @@ -232,21 +232,17 @@
. = ..()
icon = get_icon_from_source(CONFIG_GET(string/lobby_art))
tag = "LOBBYART"
if(icon_state == "lobbyart1") // default
// Only pick lobby art that credits the author
displayed_lobby_art = rand(1,length(lobby_art_authors))
icon_state = "lobbyart[displayed_lobby_art]"

desc = "Artwork by [lobby_art_authors[displayed_lobby_art]]"

/proc/force_lobby_art(art_id)
displayed_lobby_art = art_id
var/turf/closed/wall/indestructible/splashscreen/SS = locate("LOBBYART")
SS.icon_state = "lobbyart[displayed_lobby_art]"
SS.desc = "Artwork by [lobby_art_authors[displayed_lobby_art]]"
var/list/lobby_arts = CONFIG_GET(str_list/lobby_art_images)
var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors)
SS.icon_state = lobby_arts[displayed_lobby_art]
SS.desc = "Artwork by [lobby_authors[displayed_lobby_art]]"
for(var/client/C in GLOB.clients)
if(displayed_lobby_art != -1)
var/author = "[lobby_art_authors[displayed_lobby_art]]"
var/author = lobby_authors[displayed_lobby_art]
if(author != "Unknown")
to_chat_forced(C, SPAN_ROUNDBODY("<hr>This round's lobby art is brought to you by [author]<hr>"))

Expand Down
18 changes: 0 additions & 18 deletions code/global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,6 @@ var/global/obfs_y = 0 //A number between -500 and 500
// Which lobby art is on display
// This is updated by the lobby art turf when it initializes
var/displayed_lobby_art = -1
// Authors for the lobby art. In order.
// You MUST credit the author here when adding new lobby art, or it will not show up in-game
// If you legitimately don't know, write "Unknown" and it'll show up regardless
var/list/lobby_art_authors = list(
"NicBoone",
"NicBoone",
"NicBoone",
"NicBoone",
"NicBoone",
"Triiodine",
"Triiodine",
"Triiodine",
"Unknown",
"LightCrabPress", // originally for TGMC, asked author if we could use it too
"Redsting", // originally drawing for discord banner
"Substance20", // commissioned by Neth
"Substance20", // commissioned by Neth
)

// Last global ID that was assigned to a mob (for round recording purposes)
var/last_mob_gid = 0
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/new_player/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
client.change_view(16)
// Credit the lobby art author
if(displayed_lobby_art != -1)
var/author = "[lobby_art_authors[displayed_lobby_art]]"
var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors)
var/author = lobby_authors[displayed_lobby_art]
if(author != "Unknown")
to_chat(src, SPAN_ROUNDBODY("<hr>This round's lobby art is brought to you by [author]<hr>"))
if(join_motd)
Expand Down
34 changes: 34 additions & 0 deletions config/example/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,37 @@ AUTOOOCMUTE
# LOBBY_MUSIC 3 path/to/sound.ogg
# LOBBY_MUSIC 4 path/to/sound.ogg
# LOBBY_MUSIC 5 path/to/sound.ogg

## LOBBY ART IMAGES
## LOBBY_ART_IMAGES <icon_state>
## LOBBY_ART_AUTHORS <author>
#LOBBY_ART_IMAGES lobbyart1
#LOBBY_ART_AUTHORS NicBoone
#LOBBY_ART_IMAGES lobbyart2
#LOBBY_ART_AUTHORS NicBoone
#LOBBY_ART_IMAGES lobbyart3
#LOBBY_ART_AUTHORS NicBoone
#LOBBY_ART_IMAGES lobbyart4
#LOBBY_ART_AUTHORS NicBoone
#LOBBY_ART_IMAGES lobbyart5
#LOBBY_ART_AUTHORS NicBoone
#LOBBY_ART_IMAGES lobbyart6
#LOBBY_ART_AUTHORS Triiodine
#LOBBY_ART_IMAGES lobbyart7
#LOBBY_ART_AUTHORS Triiodine
#LOBBY_ART_IMAGES lobbyart8
#LOBBY_ART_AUTHORS Triiodine
#LOBBY_ART_IMAGES lobbyart9
#LOBBY_ART_AUTHORS Unknown
# originally for TGMC, asked author if we could use it too
#LOBBY_ART_IMAGES lobbyart10
#LOBBY_ART_AUTHORS LightCrabPress
# originally drawing for discord banner
#LOBBY_ART_IMAGES lobbyart11
#LOBBY_ART_AUTHORS Redsting
# commissioned by Neth
#LOBBY_ART_IMAGES lobbyart12
#LOBBY_ART_AUTHORS Substance20
# commissioned by Neth
#LOBBY_ART_IMAGES lobbyart13
#LOBBY_ART_AUTHORS Substance20

0 comments on commit cc4f87d

Please sign in to comment.