mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 07:22:15 +00:00
Lobby Menu Improvements (#9246)
The lobby menu now fades in and out smoothly.
Removes the old background object which was left in by accident.
The buttons now get bigger when you mouse over them. Responsiveness!
This commit is contained in:
@@ -1,26 +1,3 @@
|
||||
/var/obj/effect/lobby_image
|
||||
|
||||
/obj/effect/lobby_image
|
||||
name = "Aurorastation"
|
||||
desc = "This shouldn't be read"
|
||||
icon = 'icons/misc/title.dmi'
|
||||
screen_loc = "WEST,SOUTH"
|
||||
|
||||
/obj/effect/lobby_image/New()
|
||||
..()
|
||||
if (current_map.lobby_icon)
|
||||
icon = current_map.lobby_icon
|
||||
var/list/known_icon_states = icon_states(icon)
|
||||
for(var/lobby_screen in current_map.lobby_screens)
|
||||
if(!(lobby_screen in known_icon_states))
|
||||
error("Lobby screen '[lobby_screen]' did not exist in the icon set [icon].")
|
||||
current_map.lobby_screens -= lobby_screen
|
||||
|
||||
if(current_map.lobby_screens.len)
|
||||
icon_state = pick(current_map.lobby_screens)
|
||||
else
|
||||
icon_state = known_icon_states[1]
|
||||
|
||||
/mob/abstract/new_player
|
||||
var/client/my_client // Need to keep track of this ourselves, since by the time Logout() is called the client has already been nulled
|
||||
|
||||
@@ -37,7 +14,6 @@
|
||||
mind.current = src
|
||||
|
||||
loc = null
|
||||
show_title()
|
||||
|
||||
my_client = client
|
||||
sight |= SEE_TURFS
|
||||
@@ -45,13 +21,4 @@
|
||||
|
||||
spawn(40)
|
||||
if(client)
|
||||
client.playtitlemusic()
|
||||
|
||||
/mob/abstract/new_player/proc/show_title()
|
||||
set waitfor = FALSE
|
||||
if (lobby_image)
|
||||
client.screen += lobby_image
|
||||
return
|
||||
|
||||
sleep(5)
|
||||
.()
|
||||
client.playtitlemusic()
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
// see login.dm
|
||||
if(my_client)
|
||||
my_client.screen -= lobby_image
|
||||
my_client = null
|
||||
|
||||
..()
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
/obj/screen/new_player/title
|
||||
name = "Title"
|
||||
screen_loc = "WEST,SOUTH"
|
||||
var/lobby_index = 1
|
||||
|
||||
/obj/screen/new_player/title/Initialize()
|
||||
icon = current_map.lobby_icon
|
||||
@@ -61,12 +62,32 @@
|
||||
current_map.lobby_screens -= lobby_screen
|
||||
|
||||
if(length(current_map.lobby_screens))
|
||||
icon_state = pick(current_map.lobby_screens)
|
||||
if(current_map.lobby_transitions && isnum(current_map.lobby_transitions))
|
||||
icon_state = current_map.lobby_screens[lobby_index]
|
||||
if(Master.initializing)
|
||||
spawn(current_map.lobby_transitions)
|
||||
Update()
|
||||
else
|
||||
addtimer(CALLBACK(src, .proc/Update), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE)
|
||||
else
|
||||
icon_state = pick(current_map.lobby_screens)
|
||||
else
|
||||
icon_state = known_icon_states[1]
|
||||
icon_state = LAZYACCESS(known_icon_states, 1)
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/screen/new_player/title/proc/Update()
|
||||
lobby_index += 1
|
||||
if (lobby_index > length(current_map.lobby_screens))
|
||||
lobby_index = 1
|
||||
animate(src, alpha = 0, time = 1 SECOND)
|
||||
animate(alpha = 255, icon_state = current_map.lobby_screens[lobby_index], time = 1 SECOND)
|
||||
if(Master.initializing)
|
||||
spawn(current_map.lobby_transitions)
|
||||
Update()
|
||||
else
|
||||
addtimer(CALLBACK(src, .proc/Update), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE)
|
||||
|
||||
/obj/screen/new_player/selection/join_game
|
||||
name = "Join Game"
|
||||
icon_state = "unready"
|
||||
@@ -105,10 +126,14 @@
|
||||
|
||||
/obj/screen/new_player/selection/MouseEntered(location,control,params) //Yellow color for the font
|
||||
color = "#ffb200"
|
||||
var/matrix/M = matrix()
|
||||
M.Scale(1.1, 1.1)
|
||||
animate(src, transform = M, time = 1, easing = CUBIC_EASING)
|
||||
return ..()
|
||||
|
||||
/obj/screen/new_player/selection/MouseExited(location,control,params)
|
||||
color = null
|
||||
animate(src, transform = null, time = 1, easing = CUBIC_EASING)
|
||||
return ..()
|
||||
|
||||
/obj/screen/new_player/selection/join_game/New(var/datum/hud/H)
|
||||
|
||||
Reference in New Issue
Block a user