Skip to content

Commit

Permalink
TGS Test Merge (#7766)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Dec 11, 2024
2 parents 79b862c + af1d002 commit 05a4d88
Show file tree
Hide file tree
Showing 30 changed files with 2,131 additions and 1,425 deletions.
4 changes: 0 additions & 4 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ GLOBAL_LIST_INIT(nato_phonetic_alphabet, list("Alpha", "Bravo", "Charlie", "Delt
GLOBAL_VAR_INIT(distress_cancel, FALSE)
GLOBAL_VAR_INIT(destroy_cancel, FALSE)

// Which lobby art is on display
// This is updated by the lobby art turf when it initializes
GLOBAL_VAR_INIT(displayed_lobby_art, -1)

// Last global ID that was assigned to a mob (for round recording purposes)
GLOBAL_VAR_INIT(last_mob_gid, 0)

Expand Down
29 changes: 26 additions & 3 deletions code/controllers/subsystem/init/lobby_art.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
SUBSYSTEM_DEF(lobby_art)
name = "Lobby Art"
init_order = SS_INIT_LOBBYART
flags = SS_NO_FIRE
flags = SS_NO_FIRE

var/selected_file_name
var/author

/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)))
if(!length(lobby_arts))
return SS_INIT_SUCCESS

var/index = rand(1, length(lobby_arts))
selected_file_name = lobby_arts[index]

var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors)
if(length(lobby_authors) && length(lobby_authors) > index)
author = lobby_authors[index]

for(var/client/client as anything in GLOB.clients)
var/mob/new_player/player = client.mob // if something is no longer a new player this early, i'm happy with a runtime

var/datum/tgui/ui = SStgui.get_open_ui(player, player)
if(!ui)
continue

ui.refresh_cooldown = FALSE
ui.send_full_update(force = TRUE)

player.lobby_window.send_asset(get_asset_datum(/datum/asset/simple/lobby_art))

return SS_INIT_SUCCESS
2 changes: 1 addition & 1 deletion code/controllers/subsystem/tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ SUBSYSTEM_DEF(tgui)
if(length(user?.tgui_open_uis) == 0)
return count
for(var/datum/tgui/ui in user.tgui_open_uis)
if(isnull(src_object) || ui.src_object == src_object)
if((isnull(src_object) || ui.src_object == src_object) && ui.closeable)
ui.close()
count++
return count
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ SUBSYSTEM_DEF(ticker)
CHECK_TICK

for(var/mob/new_player/np in GLOB.new_player_list)
INVOKE_ASYNC(np, TYPE_PROC_REF(/mob/new_player, new_player_panel_proc), TRUE)
np.tgui_interact(np)

setup_economy()

Expand Down
9 changes: 0 additions & 9 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,14 @@ Additional game mode variables.
var/list/options = get_fax_responder_slots(responder_candidate)
if(!options || !options.len)
to_chat(responder_candidate, SPAN_WARNING("No Available Slot!"))
if(from_lobby)
var/mob/new_player/lobbied = responder_candidate
lobbied.new_player_panel()
return FALSE

var/choice = tgui_input_list(responder_candidate, "What Fax Responder do you want to join as?", "Which Responder?", options, 30 SECONDS)
if(!(choice in FAX_RESPONDER_JOB_LIST))
to_chat(responder_candidate, SPAN_WARNING("Error: No valid responder selected."))
if(from_lobby)
var/mob/new_player/lobbied = responder_candidate
lobbied.new_player_panel()
return FALSE

if(!transform_fax_responder(responder_candidate, choice))
if(from_lobby)
var/mob/new_player/lobbied = responder_candidate
lobbied.new_player_panel()
return FALSE

if(responder_candidate)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/extended.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/datum/game_mode/extended/post_setup()
initialize_post_marine_gear_list()
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
np.tgui_interact(np)
round_time_lobby = world.time
return ..()

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/extended_nospawn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

/datum/game_mode/extended/nospawn/post_setup()
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
np.tgui_interact(np)
round_time_lobby = world.time
return ..()
2 changes: 1 addition & 1 deletion code/game/gamemodes/extended/infection.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
initialize_post_survivor_list()
initialize_post_marine_gear_list()
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
np.tgui_interact(np)

addtimer(CALLBACK(src, PROC_REF(ares_online)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(map_announcement)), 20 SECONDS)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(display_roundstart_logout_report)), ROUNDSTART_LOGOUT_REPORT_TIME)

for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
np.tgui_interact(np)
round_time_lobby = world.time
log_game("Round started at [time2text(world.realtime)]")
log_game("Operation time at round start is [worldtime2text()]")
Expand Down
30 changes: 0 additions & 30 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,36 +293,6 @@
icon_state = "fakewindows"
opacity = FALSE

INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen)

/turf/closed/wall/indestructible/splashscreen
name = "Lobby Art"
desc = "Assorted artworks."
icon = 'icons/lobby/title_loading.dmi'
icon_state = "title"
layer = FLY_LAYER
special_icon = TRUE

/turf/closed/wall/indestructible/splashscreen/Initialize()
. = ..()
tag = "LOBBYART"

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

/turf/closed/wall/indestructible/other
icon_state = "r_wall"

Expand Down
4 changes: 4 additions & 0 deletions code/game/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@
if(!mob)
return

if(istype(mob, /mob/new_player))
var/mob/new_player/new_player = mob
new_player.initialize_lobby_screen()

for(var/I in mob.open_uis)
var/datum/nanoui/ui = I
if(!QDELETED(ui))
Expand Down
5 changes: 4 additions & 1 deletion code/modules/asset_cache/asset_list.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ GLOBAL_LIST_EMPTY(asset_datums)

//get an assetdatum or make a new one
/proc/get_asset_datum(type)
RETURN_TYPE(/datum/asset)

return GLOB.asset_datums[type] || new type()

/datum/asset
Expand Down Expand Up @@ -261,11 +263,12 @@ GLOBAL_LIST_EMPTY(asset_datums)
continue
asset = fcopy_rsc(asset) //dedupe
var/prefix2 = (length(directions) > 1) ? "[dir2text(direction)]." : ""
var/asset_name = sanitize_filename("[prefix].[prefix2][icon_state_name].png")
var/asset_name = sanitize_filename("[prefix ? "[prefix]." : ""][prefix2][icon_state_name].png")
if (generic_icon_names)
asset_name = "[generate_asset_name(asset)].png"

SSassets.transport.register_asset(asset_name, asset)
assets[asset_name] = asset

/datum/asset/simple/icon_states/multiple_icons
_abstract = /datum/asset/simple/icon_states/multiple_icons
Expand Down
24 changes: 24 additions & 0 deletions code/modules/asset_cache/assets/lobby.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/datum/asset/simple/icon_states/lobby
icon = 'icons/lobby/icon.dmi'
prefix = FALSE

/datum/asset/simple/lobby_art/register()
var/icon = SSlobby_art.selected_file_name

if(!icon)
return

var/asset = icon("config/lobby_art/[icon].png")
if (!asset)
return

asset = fcopy_rsc(asset) //dedupe
var/asset_name = sanitize_filename("[icon].png")

SSassets.transport.register_asset(asset_name, asset)
assets[asset_name] = asset

/datum/asset/simple/lobby_sound
assets = list(
"load" = file('sound/lobby/lobby_load.mp3'),
)
4 changes: 2 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ GLOBAL_LIST_INIT(bgstate_options, list(
save_cooldown = world.time + 50
var/mob/new_player/np = user
if(istype(np))
np.new_player_panel_proc()
np.tgui_interact(np)

if("reload")
if(reload_cooldown > world.time)
Expand All @@ -1890,7 +1890,7 @@ GLOBAL_LIST_INIT(bgstate_options, list(
close_load_dialog(user)
var/mob/new_player/np = user
if(istype(np))
np.new_player_panel_proc()
np.tgui_interact(np)

update_all_pickers(user)

Expand Down
Loading

0 comments on commit 05a4d88

Please sign in to comment.