Revert new lobby ui. (#21494)

Reverts #20467

For some reason, if you put a png into icon() and then show that to a
client, it uses a colossal amount of GPU. No idea.

Reverts to our older lobby system pending TGUI update.

Fixes #21489
This commit is contained in:
Wildkins
2025-10-14 23:04:18 +00:00
committed by GitHub
parent 73a6e43c5f
commit bad60b2f67
36 changed files with 160 additions and 182 deletions
@@ -102,13 +102,11 @@
starlight_color = "#50b7bb"
starlight_power = 2
starlight_range = 4
lobby_icon_image_paths = list(
list('icons/misc/titlescreens/tajara/taj1.png', 'icons/misc/titlescreens/tajara/taj2.png', 'icons/misc/titlescreens/tajara/taj3.png', 'icons/misc/titlescreens/tajara/taj4.png', 'icons/misc/titlescreens/tajara/Ghostsofwar.png', 'icons/misc/titlescreens/tajara/crack.png', 'icons/misc/titlescreens/tajara/blind_eye.png', 'icons/misc/titlescreens/tajara/RoyalGrenadier.png', 'icons/misc/titlescreens/tajara/For_the_King.png'),
list('icons/misc/titlescreens/synths/baseline.png', 'icons/misc/titlescreens/synths/bishop.png', 'icons/misc/titlescreens/synths/g2.png', 'icons/misc/titlescreens/synths/shell.png', 'icons/misc/titlescreens/synths/zenghu.png', 'icons/misc/titlescreens/synths/hazelchibi.png'),
list('icons/misc/titlescreens/vaurca/cthur.png', 'icons/misc/titlescreens/vaurca/klax.png', 'icons/misc/titlescreens/vaurca/liidra.png', 'icons/misc/titlescreens/vaurca/zora.png'),
list('icons/misc/titlescreens/space/odin.png', 'icons/misc/titlescreens/space/starmap.png', 'icons/misc/titlescreens/space/undocking.png', 'icons/misc/titlescreens/space/voyage.png')
)
sector_lobby_art = list('icons/misc/titlescreens/lore/cold_dawn.dmi')
sector_lobby_transitions = 0
sector_welcome_message = 'sound/AI/adhomai_welcome.ogg'
sector_hud_menu = 'icons/misc/hudmenu/tajara_hud.dmi'
sector_hud_menu_sound = 'sound/effects/menu_click_heavy.ogg'
sector_hud_arrow = "menu_arrow"
lore_radio_stations = list(
@@ -9,6 +9,7 @@
starlight_power = 2
starlight_range = 4
sector_welcome_message = 'sound/AI/welcome_coalition.ogg'
sector_hud_menu = 'icons/misc/hudmenu/coalition_hud.dmi'
sector_hud_arrow = "menu_arrow"
/datum/space_sector/weeping_stars
@@ -37,6 +38,7 @@
starlight_power = 2
starlight_range = 4
sector_welcome_message = 'sound/AI/welcome_weeping.ogg'
sector_hud_menu = 'icons/misc/hudmenu/coalition_hud.dmi'
sector_hud_arrow = "menu_arrow"
/datum/space_sector/arusha
@@ -121,6 +123,7 @@
starlight_power = 2
starlight_range = 4
sector_welcome_message = 'sound/AI/welcome_weeping.ogg'
sector_hud_menu = 'icons/misc/hudmenu/coalition_hud.dmi'
sector_hud_arrow = "menu_arrow"
/datum/space_sector/haneunim
@@ -148,13 +151,10 @@
starlight_color = "#e2719b"
starlight_power = 2//placeholder
starlight_range = 4//placeholder
lobby_icon_image_paths = list(
list('icons/misc/titlescreens/tajara/taj1.png', 'icons/misc/titlescreens/tajara/taj2.png', 'icons/misc/titlescreens/tajara/taj3.png', 'icons/misc/titlescreens/tajara/taj4.png', 'icons/misc/titlescreens/tajara/Ghostsofwar.png', 'icons/misc/titlescreens/tajara/crack.png', 'icons/misc/titlescreens/tajara/blind_eye.png', 'icons/misc/titlescreens/tajara/RoyalGrenadier.png', 'icons/misc/titlescreens/tajara/For_the_King.png'),
list('icons/misc/titlescreens/synths/baseline.png', 'icons/misc/titlescreens/synths/bishop.png', 'icons/misc/titlescreens/synths/g2.png', 'icons/misc/titlescreens/synths/shell.png', 'icons/misc/titlescreens/synths/zenghu.png', 'icons/misc/titlescreens/synths/hazelchibi.png'),
list('icons/misc/titlescreens/vaurca/cthur.png', 'icons/misc/titlescreens/vaurca/klax.png', 'icons/misc/titlescreens/vaurca/liidra.png', 'icons/misc/titlescreens/vaurca/zora.png'),
list('icons/misc/titlescreens/space/odin.png', 'icons/misc/titlescreens/space/starmap.png', 'icons/misc/titlescreens/space/undocking.png', 'icons/misc/titlescreens/space/voyage.png')
)
sector_lobby_art = list('icons/misc/titlescreens/lore/silicon_nightmares.dmi')
sector_lobby_transitions = 0
sector_welcome_message = 'sound/AI/welcome_konyang.ogg'
sector_hud_menu = 'icons/misc/hudmenu/konyang_hud.dmi'
sector_hud_arrow = "menu_arrow"
lobby_tracks = list(
@@ -35,19 +35,12 @@
/// This gets converted into a formatted list after initialization like so: list(RADIO_BROADCASTS = list("stuff"), RADIO_NEXT_BROADCAST = world.time, RADIO_BROADCAST_INDEX = the entry in the list that will be broadcasted)
var/list/lore_radio_stations = null //what radio stations can be heard by the lore radio item here
/// A list of paths to rotate for the lobby image, png/bmp/jpg/gif only
/// if this is set, it will override the map ones
var/list/lobby_icon_image_paths = null
var/list/sector_lobby_art = null //if this is set, it will override the map lobby icons
var/sector_lobby_transitions = null //if this is set, it will override the map lobby transition
var/sector_hud_menu = null //if this is set, it will override the hud menu icons
var/sector_welcome_message = null ///if this is set, it will override welcome audio message
/**
* The hud menu icons folder path, it **must** end with a slash
*
* The folder **must** contain all the PNGs/JPGs/GIFs for the menu
*/
var/sector_hud_menu = "icons/misc/hudmenu/default/"
var/sector_hud_menu_sound = null //if this is set, it will override the hud menu click sound
var/sector_hud_arrow = null //if this is set, it will use an overlay instead of the animation that makes the button bigger
+116 -90
View File
@@ -48,19 +48,25 @@
using.name = "Current Lore Summary"
adding += using
using = new /atom/movable/screen/new_player/selection/server_logo(src)
using.name = "Aurora"
adding += using
// using = new /atom/movable/screen/new_player/selection/server_logo(src)
// using.name = "Aurora"
// adding += using
mymob.client.screen = list()
mymob.client.screen += adding
src.adding += using
ABSTRACT_TYPE(/atom/movable/screen/new_player)
icon = null
icon_state = null
icon = 'icons/misc/hudmenu/hudmenu.dmi'
layer = HUD_BASE_LAYER
/atom/movable/screen/new_player/Initialize(mapload, ...)
set_sector_things()
. = ..()
/atom/movable/screen/new_player/proc/set_sector_things()
if(SSatlas.current_sector.sector_hud_menu)
icon = SSatlas.current_sector.sector_hud_menu
/**
* # Title screen
@@ -72,26 +78,51 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player)
name = "Title"
screen_loc = "WEST,SOUTH"
layer = UNDER_HUD_LAYER
icon = 'icons/misc/titlescreens/title.dmi'
icon_state = "loading"
///An index used to rotate along the lobby icons
var/lobby_icons_index = 1
var/lobby_screen_index = 1
/atom/movable/screen/new_player/title/Initialize()
. = ..()
setup_icon() //THIS CAN SLEEP AND MUST NOT BE WAITED FOR
/atom/movable/screen/new_player/title/set_sector_things()
return
/**
* Sets up the icon for the title screen, wait until SSAtlas made them for us then setup the update cycle after picking one
*/
/atom/movable/screen/new_player/title/proc/setup_icon()
set waitfor = FALSE
UNTIL((SSatlas.lobby_icons))
UNTIL((SSatlas.current_map))
icon = pick(SSatlas.lobby_icons)
if(SSatlas.current_sector.sector_lobby_art)
SSatlas.current_map.lobby_icon = pick(SSatlas.current_sector.sector_lobby_art)
else if(!SSatlas.current_map.lobby_icon)
SSatlas.current_map.lobby_icon = pick(SSatlas.current_map.lobby_icons)
addtimer(CALLBACK(src, PROC_REF(update_icon)), SSatlas.current_map.lobby_transitions, TIMER_UNIQUE | TIMER_OVERRIDE)
if(!LAZYLEN(SSatlas.current_map.lobby_screens))
var/list/known_icon_states = icon_states(SSatlas.current_map.lobby_icon)
for(var/screen in known_icon_states)
if(!LAZYISIN(SSatlas.current_map.lobby_screens, screen))
LAZYADD(SSatlas.current_map.lobby_screens, screen)
icon = SSatlas.current_map.lobby_icon
if(!LAZYLEN(SSatlas.current_map.lobby_screens))
CRASH("No lobby screens found!")
if(SSatlas.current_map.lobby_transitions && isnum(SSatlas.current_map.lobby_transitions))
icon_state = SSatlas.current_map.lobby_screens[lobby_screen_index]
if(!MC_RUNNING())
spawn(SSatlas.current_map.lobby_transitions)
update_icon()
else
addtimer(CALLBACK(src, PROC_REF(update_icon)), SSatlas.current_map.lobby_transitions, TIMER_UNIQUE | TIMER_OVERRIDE)
else
icon_state = pick(SSatlas.current_map.lobby_screens)
/atom/movable/screen/new_player/title/update_icon()
..()
@@ -102,16 +133,24 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player)
if(!istype(hud) || !isnewplayer(hud.mymob))
return
//No point fading if there's only one icon, but we keep the update running in case admins want to add icons on the fly
if(length(SSatlas.lobby_icons) >= 2)
if(!SSatlas.current_map.lobby_transitions)
if(!icon_state)
icon_state = pick(SSatlas.current_map.lobby_screens)
return
if(length(SSatlas.current_map.lobby_screens) >= 2)
//Advance to the next icon
lobby_icons_index = max(++lobby_icons_index % length(SSatlas.lobby_icons), 1)
lobby_screen_index = max(++lobby_screen_index % length(SSatlas.current_map.lobby_screens), 1)
animate(src, alpha = 0, time = 1 SECOND)
animate(alpha = 255, icon = SSatlas.lobby_icons[lobby_icons_index], time = 1 SECOND)
animate(alpha = 255, icon_state = SSatlas.current_map.lobby_screens[lobby_screen_index], time = 1 SECOND)
addtimer(CALLBACK(src, PROC_REF(update_icon)), SSatlas.current_map.lobby_transitions, TIMER_UNIQUE | TIMER_OVERRIDE)
if(!MC_RUNNING())
spawn(SSatlas.current_map.lobby_transitions)
update_icon()
else
addtimer(CALLBACK(src, PROC_REF(update_icon)), SSatlas.current_map.lobby_transitions, TIMER_UNIQUE | TIMER_OVERRIDE)
/**
@@ -123,8 +162,7 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
icon_state = null
mouse_opacity = MOUSE_OPACITY_OPAQUE
var/click_sound = 'sound/effects/menu_click.ogg'
var/does_matrix_scale = TRUE
var/uses_hud_arrow = TRUE
var/hud_arrow
/atom/movable/screen/new_player/selection/New(datum/hud/H)
color = null
@@ -135,55 +173,41 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
hud = null
. = ..()
/atom/movable/screen/new_player/selection/update_icon()
/atom/movable/screen/new_player/selection/set_sector_things()
. = ..()
var/icon_path = "[SSatlas.current_sector.sector_hud_menu][get_button_icon_filename()].png"
icon = icon(icon_path)
/**
* Returns the filename of the icon to use for the button, at every refresh
*/
/atom/movable/screen/new_player/selection/proc/get_button_icon_filename()
SHOULD_NOT_SLEEP(TRUE)
var/regex/regex_screen_name = new(@'.*\/(.*)$')
if(!regex_screen_name.Find("[type]"))
CRASH("Something went terribly wrong with extracting the button icon filename with the regex!")
return regex_screen_name.group[1]
if(SSatlas.current_sector.sector_hud_menu_sound)
click_sound = SSatlas.current_sector.sector_hud_menu_sound
if(SSatlas.current_sector.sector_hud_arrow)
hud_arrow = SSatlas.current_sector.sector_hud_arrow
animate(src, color = null, transform = null, time = 3, easing = CUBIC_EASING)
/atom/movable/screen/new_player/selection/Initialize()
. = ..()
update_icon()
if(SSatlas.current_sector)
if(SSatlas.current_sector.sector_hud_menu_sound)
click_sound = SSatlas.current_sector.sector_hud_menu_sound
if(SSatlas.current_sector.sector_hud_arrow)
// We'll reset the animation just so it doesn't get stuck
animate(src, color = null, transform = null, time = 3, easing = CUBIC_EASING)
animate(src, alpha = 255, time = 3, easing = CUBIC_EASING, loop = 3)
animate(alpha = 60, time = 3, easing = CUBIC_EASING, loop = 3, flags = ANIMATION_CONTINUE)
set_sector_things()
/atom/movable/screen/new_player/selection/MouseEntered(location, control, params)
if(SSatlas.current_sector?.sector_hud_arrow && uses_hud_arrow)
AddOverlays(SSatlas.current_sector.sector_hud_arrow)
var/matrix/M = matrix()
if(does_matrix_scale)
if(hud_arrow)
AddOverlays(hud_arrow)
UpdateOverlays() // force this so it appears before MC is done
else
var/matrix/M = matrix()
M.Scale(1.1, 1)
M.Translate(40, 0)
animate(src, color = null, transform = M, time = 3, easing = CUBIC_EASING)
animate(src, alpha = 255, time = 3, easing = CUBIC_EASING)
animate(src, color = color_rotation(30), transform = M, time = 3, easing = CUBIC_EASING)
return ..()
/atom/movable/screen/new_player/selection/MouseExited(location, control, params)
if(SSatlas.current_sector?.sector_hud_arrow && uses_hud_arrow)
ClearOverlays()
animate(src, color = null, transform = null, time = 3, easing = CUBIC_EASING)
animate(src, alpha = 60, time = 3, easing = CUBIC_EASING)
if(hud_arrow)
CutOverlays(hud_arrow)
UpdateOverlays()
else
animate(src, color = null, transform = null, time = 3, easing = CUBIC_EASING)
return ..()
/atom/movable/screen/new_player/selection/Click()
var/mob/abstract/new_player/player = hud.mymob
if(player && click_sound)
sound_to(player, click_sound)
/**
* # Join Game
@@ -192,7 +216,12 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/join_game
name = "Join Game"
screen_loc = "LEFT+0.5,CENTER+17"
icon_state = "unready"
screen_loc = "LEFT+0.1,CENTER-1"
/atom/movable/screen/new_player/selection/join_game/Initialize()
. = ..()
update_icon()
/atom/movable/screen/new_player/selection/join_game/Click(location, control, params)
var/mob/abstract/new_player/player = hud.mymob
@@ -200,28 +229,24 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
tgui_alert(player, "You may not unready during Odyssey setup!", "Odyssey")
return
..()
if(SSticker.current_state <= GAME_STATE_SETTING_UP)
if(player.ready)
sound_to(player, 'sound/weapons/laser_safetyoff.ogg')
player.ready(FALSE)
else
sound_to(player, 'sound/weapons/laser_safetyon.ogg')
player.ready(TRUE)
player.ready(!player.ready)
else
sound_to(player, click_sound)
player.join_game()
update_icon()
/atom/movable/screen/new_player/selection/join_game/get_button_icon_filename()
/atom/movable/screen/new_player/selection/join_game/update_icon()
. = ..()
var/mob/abstract/new_player/player = hud.mymob
if(SSticker.current_state <= GAME_STATE_SETTING_UP)
if(player.ready)
. += "_ready"
else
. += "_unready"
icon_state = player.ready ? "ready" : "unready"
else
icon_state = "joingame"
// Why on earth is this in MENU.DM ???
/mob/abstract/new_player/proc/ready(readying = TRUE)
if(SSticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started
// Cannot join without a saved character, if we're on SQL saves.
@@ -257,11 +282,12 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/manifest
name = "Crew Manifest"
screen_loc = "LEFT+0.5,CENTER+13"
screen_loc = "LEFT+0.1,CENTER-3"
icon_state = "manifest"
/atom/movable/screen/new_player/selection/manifest/Click()
var/mob/abstract/new_player/player = usr
sound_to(player, click_sound)
. = ..()
var/mob/abstract/new_player/player = hud.mymob
if(SSticker.current_state < GAME_STATE_PLAYING)
to_chat(player, SPAN_WARNING("The game hasn't started yet!"))
return
@@ -275,7 +301,8 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/observe
name = "Observe"
screen_loc = "LEFT+0.5,CENTER+9"
screen_loc = "LEFT+0.1,CENTER-4"
icon_state = "observe"
/atom/movable/screen/new_player/selection/observe/Click()
var/mob/abstract/new_player/player = usr
@@ -338,22 +365,16 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/settings
name = "Setup"
screen_loc = "LEFT+0.5,CENTER+5"
icon_state = "setup"
screen_loc = "LEFT+0.1,CENTER-2"
/atom/movable/screen/new_player/selection/settings/Click()
var/mob/abstract/new_player/player = usr
sound_to(player, click_sound)
. = ..()
var/mob/abstract/new_player/player = hud.mymob
player.setupcharacter()
/atom/movable/screen/new_player/selection/changelog/Click()
var/mob/abstract/new_player/player = usr
sound_to(player, click_sound)
player.client.changes()
/mob/abstract/new_player/proc/setupcharacter()
client.prefs.ShowChoices(src)
return TRUE
/**
* # Changelog
@@ -362,7 +383,13 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/changelog
name = "Changelog"
screen_loc = "LEFT+0.5,CENTER+1"
icon_state = "changelog"
screen_loc = "LEFT+0.1,CENTER-5"
/atom/movable/screen/new_player/selection/changelog/Click()
. = ..()
var/mob/abstract/new_player/player = hud.mymob
player.client.changes()
/**
@@ -372,7 +399,8 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/polls
name = "Polls"
screen_loc = "LEFT+0.5,CENTER-3"
icon_state = "polls"
screen_loc = "LEFT+0.1,CENTER-6"
var/new_polls = FALSE
/atom/movable/screen/new_player/selection/polls/Initialize()
@@ -387,11 +415,6 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
if(newpoll)
new_polls = TRUE
/atom/movable/screen/new_player/selection/polls/get_button_icon_filename()
. = ..()
if(new_polls)
. += "_new"
/atom/movable/screen/new_player/selection/polls/Click()
var/mob/abstract/new_player/player = usr
sound_to(player, click_sound)
@@ -405,7 +428,8 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
*/
/atom/movable/screen/new_player/selection/lore_summary
name = "Current Lore Summary"
screen_loc = "LEFT+0.5,CENTER-7"
icon_state = "lore_summary"
screen_loc = "LEFT+0.1,CENTER-7"
/atom/movable/screen/new_player/selection/lore_summary/Click()
var/mob/abstract/new_player/player = usr
@@ -426,8 +450,7 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
/atom/movable/screen/new_player/selection/server_logo
name = "Aurora"
screen_loc = "LEFT+0.5,CENTER+42"
uses_hud_arrow = FALSE
does_matrix_scale = FALSE
hud_arrow = null
/atom/movable/screen/new_player/selection/server_logo/Click()
var/mob/abstract/new_player/player = usr
@@ -439,3 +462,6 @@ ABSTRACT_TYPE(/atom/movable/screen/new_player/selection)
else
to_chat(player, SPAN_WARNING("The Aurora website URL is not set in the server configuration."))
return
/atom/movable/screen/new_player/selection/server_logo/set_sector_things()
return