diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 1760fe6b09ea..e636b2ecc94d 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -406,6 +406,12 @@ ///From base of datum/controller/subsystem/Initialize: (start_timeofday) #define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize" +///Called when the ticker enters the pre-game phase +#define COMSIG_TICKER_ENTER_PREGAME "comsig_ticker_enter_pregame" + +///Called when the ticker sets up the game for start +#define COMSIG_TICKER_ENTER_SETTING_UP "comsig_ticker_enter_setting_up" + /// called by datum/cinematic/play() : (datum/cinematic/new_cinematic) #define COMSIG_GLOB_PLAY_CINEMATIC "!play_cinematic" #define COMPONENT_GLOB_BLOCK_CINEMATIC (1<<0) diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 4e09a65c4c91..30a7c66d8b73 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -143,3 +143,6 @@ #define SPLASHSCREEN_LAYER 23 #define SPLASHSCREEN_PLANE 23 #define SPLASHSCREEN_RENDER_TARGET "SPLASHSCREEN_PLANE" + +#define LOBBY_BACKGROUND_LAYER 3 +#define LOBBY_BUTTON_LAYER 4 diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 9d544b09ffad..544979a66b0e 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -5,7 +5,6 @@ //Ready states at roundstart for mob/dead/new_player #define PLAYER_NOT_READY 0 #define PLAYER_READY_TO_PLAY 1 -#define PLAYER_READY_TO_OBSERVE 2 //Game mode list indexes #define CURRENT_LIVING_PLAYERS "living_players_list" diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm new file mode 100644 index 000000000000..4c9e2eddbbea --- /dev/null +++ b/code/_onclick/hud/new_player.dm @@ -0,0 +1,439 @@ +/datum/hud/new_player + +/datum/hud/new_player/New(mob/owner) + ..() + var/list/buttons = subtypesof(/atom/movable/screen/lobby) + for(var/button in buttons) + var/atom/movable/screen/lobbyscreen = new button() + lobbyscreen.hud = src + static_inventory += lobbyscreen + lobbyscreen.postInit() + +/* + Screen objects + Todo: improve/re-implement + + Screen objects are only used for the hud and should not appear anywhere "in-game". + They are used with the client/screen list and the screen_loc var. + For more information, see the byond documentation on the screen_loc and screen vars. +*/ +/atom/movable/screen + name = "" + plane = HUD_PLANE + animate_movement = SLIDE_STEPS + speech_span = SPAN_ROBOT + vis_flags = VIS_INHERIT_PLANE + appearance_flags = APPEARANCE_UI + /// A reference to the object in the slot. Grabs or items, generally. + var/obj/master = null + /// A reference to the owner HUD, if any. + var/datum/hud/hud = null + /** + * Map name assigned to this object. + * Automatically set by /client/proc/add_obj_to_map. + */ + var/assigned_map + /** + * Mark this object as garbage-collectible after you clean the map + * it was registered on. + * + * This could probably be changed to be a proc, for conditional removal. + * But for now, this works. + */ + var/del_on_map_removal = TRUE + +/atom/movable/screen/proc/postInit() + +/atom/movable/screen/Destroy() + master = null + hud = null + return ..() + +/atom/movable/screen/lobby + plane = SPLASHSCREEN_PLANE + layer = LOBBY_BUTTON_LAYER + screen_loc = "TOP,CENTER" + +/atom/movable/screen/lobby/background + layer = LOBBY_BACKGROUND_LAYER + icon = 'icons/hud/lobby/background.dmi' + icon_state = "background" + screen_loc = "TOP,CENTER:-61" + +/atom/movable/screen/lobby/button + ///Is the button currently enabled? + var/enabled = TRUE + ///Is the button currently being hovered over with the mouse? + var/highlighted = FALSE + +/atom/movable/screen/lobby/button/Click(location, control, params) + . = ..() + if(!enabled) + return + flick("[base_icon_state]_pressed", src) + update_icon() + return TRUE + +/atom/movable/screen/lobby/button/MouseEntered(location,control,params) + . = ..() + highlighted = TRUE + update_icon() + +/atom/movable/screen/lobby/button/MouseExited() + . = ..() + highlighted = FALSE + update_icon() + +/atom/movable/screen/lobby/button/proc/update_icon(updates) + if(!enabled) + icon_state = "[base_icon_state]_disabled" + return + else if(highlighted) + icon_state = "[base_icon_state]_highlighted" + return + icon_state = base_icon_state + +/atom/movable/screen/lobby/button/proc/set_button_status(status) + if(status == enabled) + return FALSE + enabled = status + update_icon() + return TRUE + +///Prefs menu +/atom/movable/screen/lobby/button/character_setup + screen_loc = "TOP:-70,CENTER:-54" + icon = 'icons/hud/lobby/character_setup.dmi' + icon_state = "character_setup" + base_icon_state = "character_setup" + +/atom/movable/screen/lobby/button/character_setup/Click(location, control, params) + . = ..() + if(!.) + return + hud.mymob.client.prefs.ShowChoices(hud.mymob) + +///Button that appears before the game has started +/atom/movable/screen/lobby/button/ready + screen_loc = "TOP:-8,CENTER:-65" + icon = 'icons/hud/lobby/ready.dmi' + icon_state = "not_ready" + base_icon_state = "not_ready" + var/ready = FALSE + +/atom/movable/screen/lobby/button/ready/Initialize(mapload) + . = ..() + if(SSticker.current_state > GAME_STATE_PREGAME) + set_button_status(FALSE) + else + RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/hide_ready_button) + +/atom/movable/screen/lobby/button/ready/proc/hide_ready_button() + set_button_status(FALSE) + UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP) + +/atom/movable/screen/lobby/button/ready/Click(location, control, params) + . = ..() + if(!.) + return + var/mob/dead/new_player/new_player = hud.mymob + ready = !ready + if(ready) + new_player.ready = PLAYER_READY_TO_PLAY + base_icon_state = "ready" + else + new_player.ready = PLAYER_NOT_READY + base_icon_state = "not_ready" + update_icon() + +///Shown when the game has started +/atom/movable/screen/lobby/button/join + screen_loc = "TOP:-13,CENTER:-58" + icon = 'icons/hud/lobby/join.dmi' + icon_state = "" //Default to not visible + base_icon_state = "join_game" + enabled = FALSE + +/atom/movable/screen/lobby/button/join/Initialize(mapload) + . = ..() + if(SSticker.current_state > GAME_STATE_PREGAME) + set_button_status(TRUE) + else + RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/show_join_button) + +/atom/movable/screen/lobby/button/join/Click(location, control, params) + . = ..() + if(!.) + return + if(!SSticker?.IsRoundInProgress()) + to_chat(hud.mymob, "The round is either not ready, or has already finished...") + return + + //Determines Relevent Population Cap + var/relevant_cap + var/hpc = CONFIG_GET(number/hard_popcap) + var/epc = CONFIG_GET(number/extreme_popcap) + if(hpc && epc) + relevant_cap = min(hpc, epc) + else + relevant_cap = max(hpc, epc) + + var/mob/dead/new_player/new_player = hud.mymob + + if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(new_player.key) in GLOB.admin_datums))) + to_chat(new_player, "[CONFIG_GET(string/hard_popcap_message)]") + + var/queue_position = SSticker.queued_players.Find(new_player) + if(queue_position == 1) + to_chat(new_player, "You are next in line to join the game. You will be notified when a slot opens up.") + else if(queue_position) + to_chat(new_player, "There are [queue_position-1] players in front of you in the queue to join the game.") + else + SSticker.queued_players += new_player + to_chat(new_player, "You have been added to the queue to join the game. Your position in queue is [SSticker.queued_players.len].") + return + new_player.LateChoices() + +/atom/movable/screen/lobby/button/join/proc/show_join_button(status) + set_button_status(TRUE) + UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP) + +/atom/movable/screen/lobby/button/observe + screen_loc = "TOP:-40,CENTER:-54" + icon = 'icons/hud/lobby/observe.dmi' + icon_state = "observe_disabled" + base_icon_state = "observe" + enabled = FALSE + +/atom/movable/screen/lobby/button/observe/Initialize(mapload) + . = ..() + if(SSticker.current_state > GAME_STATE_STARTUP) + set_button_status(TRUE) + else + RegisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/enable_observing) + +/atom/movable/screen/lobby/button/observe/Click(location, control, params) + . = ..() + if(!.) + return + var/mob/dead/new_player/new_player = hud.mymob + new_player.make_me_an_observer() + +/atom/movable/screen/lobby/button/observe/proc/enable_observing() + flick("[base_icon_state]_enabled", src) + set_button_status(TRUE) + UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/enable_observing) + + +/atom/movable/screen/lobby/button/changelog_button + icon = 'icons/hud/lobby/bottom_buttons.dmi' + icon_state = "changelog" + base_icon_state = "changelog" + screen_loc ="TOP:-122,CENTER:+58" + + +/atom/movable/screen/lobby/button/crew_manifest + icon = 'icons/hud/lobby/bottom_buttons.dmi' + icon_state = "crew_manifest" + base_icon_state = "crew_manifest" + screen_loc = "TOP:-122,CENTER:+30" + +/atom/movable/screen/lobby/button/crew_manifest/Click(location, control, params) + . = ..() + if(!.) + return + var/mob/dead/new_player/new_player = hud.mymob + new_player.ViewManifest() + +/atom/movable/screen/lobby/button/changelog_button/Click(location, control, params) + . = ..() + usr.client?.changelog() + +/atom/movable/screen/lobby/button/poll + icon = 'icons/hud/lobby/bottom_buttons.dmi' + icon_state = "poll" + base_icon_state = "poll" + screen_loc = "TOP:-122,CENTER:+2" + + var/new_poll = FALSE + +///Need to use New due to init +/atom/movable/screen/lobby/button/poll/New(loc, ...) + . = ..() + if(!usr) // + return + var/mob/dead/new_player/new_player = usr + if(IsGuestKey(new_player.key)) + set_button_status(FALSE) + return + if(!SSdbcore.Connect()) + set_button_status(FALSE) + return + var/isadmin = FALSE + if(new_player.client?.holder) + isadmin = TRUE + var/datum/DBQuery/query_get_new_polls = SSdbcore.NewQuery({" + SELECT id FROM [format_table_name("poll_question")] + WHERE (adminonly = 0 OR :isadmin = 1) + AND Now() BETWEEN starttime AND endtime + AND id NOT IN ( + SELECT pollid FROM [format_table_name("poll_vote")] + WHERE ckey = :ckey + ) + AND id NOT IN ( + SELECT pollid FROM [format_table_name("poll_textreply")] + WHERE ckey = :ckey + ) + "}, list("isadmin" = isadmin, "ckey" = new_player.ckey)) + if(query_get_new_polls.Execute()) + if(query_get_new_polls.NextRow()) + new_poll = TRUE + else + new_poll = FALSE + update_overlays() + qdel(query_get_new_polls) + if(QDELETED(new_player)) + set_button_status(FALSE) + return + +/atom/movable/screen/lobby/button/poll/proc/update_overlays() + cut_overlays() + if(new_poll) + add_overlay(mutable_appearance('icons/hud/lobby/poll_overlay.dmi', "new_poll")) + +/atom/movable/screen/lobby/button/poll/Click(location, control, params) + . = ..() + if(!.) + return + var/mob/dead/new_player/new_player = hud.mymob + new_player.handle_player_polling() + +/atom/movable/screen/lobby/timer + icon = 'icons/hud/lobby/countdown_background.dmi' + icon_state = "hidden" + screen_loc = "TOP,RIGHT" + + var/list/atom/movable/screen/lobby/display/displays = list() + + var/delayed = FALSE + var/active = FALSE + var/show_numbers = FALSE + + var/list/display_screen_locs = list( + "TOP:-7,RIGHT:-64", + "TOP:-7,RIGHT:-44", + "TOP:-7,RIGHT:-31" + ) + +GLOBAL_LIST_EMPTY(lobby_timers) + +/atom/movable/screen/lobby/timer/New(loc, ...) + . = ..() + for(var/screen_loc as anything in display_screen_locs) + var/atom/movable/screen/lobby/display/D = new() + D.screen_loc = screen_loc + displays += D + + if(SSticker.current_state > GAME_STATE_STARTUP) + set_active(TRUE) + else + RegisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME, .proc/activate) + +/atom/movable/screen/lobby/timer/proc/set_active(new_active) + if(new_active == active) + return + active = new_active + + if(active) + flick("show_[delayed ? "delayed" : "eta"]", src) + addtimer(VARSET_CALLBACK(src, show_numbers, 13)) + RegisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP, .proc/deactivate) + START_PROCESSING(SSlobbyprocess, src) + else + flick("hide_[delayed ? "delayed" : "eta"]", src) + show_numbers = FALSE + hide_numbers() + STOP_PROCESSING(SSlobbyprocess, src) + update_icon() + +/atom/movable/screen/lobby/timer/proc/activate() + UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_PREGAME) + set_active(TRUE) + +/atom/movable/screen/lobby/timer/proc/deactivate() + UnregisterSignal(SSticker, COMSIG_TICKER_ENTER_SETTING_UP) + set_active(FALSE) + +/atom/movable/screen/lobby/timer/Destroy() + . = ..() + GLOB.lobby_timers -= src + +/atom/movable/screen/lobby/timer/process() + + var/time = SSticker.GetTimeLeft() + if(time == -10) + if(!delayed) + delay() + return + if(delayed) + undelay() + + if(!show_numbers) + return + + if(time < 0) + time = 0 + + var/seconds = round(time/10) + if(seconds > 639) + seconds = 639 + + var/minutes = round(seconds/60) + if(minutes > 9) + minutes = 9 + seconds -= minutes * 60 + + var/tens_seconds = round(seconds/10) + var/single_seconds = seconds % 10 + + displays[1].icon_state = "[minutes]-green" + displays[2].icon_state = "[tens_seconds]-green" + displays[3].icon_state = "[single_seconds]-green" + +/atom/movable/screen/lobby/timer/postInit() + . = ..() + for(var/atom/movable/screen/lobby/display/D as anything in displays) + D.hud = hud + hud.static_inventory += D + GLOB.lobby_timers += src + +/atom/movable/screen/lobby/timer/proc/hide_numbers() + for(var/atom/movable/screen/lobby/display/D as anything in displays) + D.icon_state = "" + +/atom/movable/screen/lobby/timer/proc/delay() + if(delayed) return + delayed = TRUE + hide_numbers() + flick("eta_delay", src) + show_numbers = FALSE + update_icon() + +/atom/movable/screen/lobby/timer/proc/undelay() + if(!delayed) return + delayed = FALSE + flick("delay_eta", src) + addtimer(VARSET_CALLBACK(src, show_numbers, 6)) + update_icon() + +/atom/movable/screen/lobby/timer/proc/update_icon() + if(!active) + icon_state = "hidden" + return + if(delayed) + icon_state = "delayed" + else + icon_state = "eta" + +/atom/movable/screen/lobby/display + icon = 'icons/hud/lobby/countdown_letters.dmi' \ No newline at end of file diff --git a/code/controllers/subsystem/processing/fastlobbyprocess.dm b/code/controllers/subsystem/processing/fastlobbyprocess.dm new file mode 100644 index 000000000000..9cf2d2950e9e --- /dev/null +++ b/code/controllers/subsystem/processing/fastlobbyprocess.dm @@ -0,0 +1,6 @@ +//Fires five times every second. + +PROCESSING_SUBSYSTEM_DEF(lobbyprocess) + name = "Lobby Processing" + stat_tag = "LP" + runlevels = RUNLEVEL_LOBBY diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 4ba23dd4df3d..90dfdf49c97f 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -157,8 +157,8 @@ SUBSYSTEM_DEF(ticker) to_chat(world, span_boldnotice("Welcome to [station_name()]!")) send2chat("New round starting on [SSmapping.config.map_name]!", CONFIG_GET(string/chat_announce_new_game)) current_state = GAME_STATE_PREGAME - //Everyone who wants to be an observer is now spawned - create_observers() + SEND_SIGNAL(src, COMSIG_TICKER_ENTER_PREGAME) + fire() if(GAME_STATE_PREGAME) //lobby stats for statpanels @@ -184,6 +184,7 @@ SUBSYSTEM_DEF(ticker) tipped = TRUE if(timeLeft <= 0) + SEND_SIGNAL(src, COMSIG_TICKER_ENTER_SETTING_UP) current_state = GAME_STATE_SETTING_UP Master.SetRunLevel(RUNLEVEL_SETUP) if(start_immediately) @@ -361,8 +362,6 @@ SUBSYSTEM_DEF(ticker) if(player.ready == PLAYER_READY_TO_PLAY && player.mind) GLOB.joined_player_list += player.ckey player.create_character(FALSE) - else - player.new_player_panel() CHECK_TICK /datum/controller/subsystem/ticker/proc/collect_minds() @@ -610,13 +609,6 @@ SUBSYSTEM_DEF(ticker) else timeLeft = newtime -//Everyone who wanted to be an observer gets made one now -/datum/controller/subsystem/ticker/proc/create_observers() - for(var/mob/dead/new_player/player in GLOB.player_list) - if(player.ready == PLAYER_READY_TO_OBSERVE && player.mind) - //Break chain since this has a sleep input in it - addtimer(CALLBACK(player, /mob/dead/new_player.proc/make_me_an_observer), 1) - /datum/controller/subsystem/ticker/proc/load_mode() var/mode = trim(file2text("data/mode.txt")) if(mode) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e8d40ee44a69..e59fd552091d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -82,6 +82,9 @@ var/list/targeted_by var/atom/orbit_target //Reference to atom being orbited + + /// Used for changing icon state for different base sprites + var/base_icon_state /** * Called when an atom is created in byond (built in engine proc) * diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 74dadc5648de..4474251b09c5 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -18,7 +18,7 @@ req_access = list(ACCESS_SEC_DOORS) power_channel = EQUIP //drains power from the EQUIPMENT channel - var/base_icon_state = "standard" + base_icon_state = "standard" var/scan_range = 7 var/atom/base = null //for turrets inside other objects @@ -1080,4 +1080,4 @@ if(istype(P, /obj/item/projectile/beam/lasertag/bluetag)) on = FALSE spawn(100) - on = TRUE \ No newline at end of file + on = TRUE diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index e9f151fc1748..f9a604a8bb90 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -65,7 +65,7 @@ myseed.genes += G set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) setDir(CalcDir()) - var/base_icon_state = initial(icon_state) + base_icon_state = initial(icon_state) if(!floor) switch(dir) //offset to make it be on the wall rather than on the floor if(NORTH) diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index d132f1d62463..5a988345efe2 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -212,7 +212,7 @@ force = 3 throwforce = 3 throw_speed = 3 - var/base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted + base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted var/on_force = 10 var/on_throwforce = 8 var/on_throw_speed = 2 diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm index 900721370294..5e2132f88729 100644 --- a/code/modules/mob/dead/new_player/login.dm +++ b/code/modules/mob/dead/new_player/login.dm @@ -22,8 +22,11 @@ sight |= SEE_TURFS - new_player_panel() client.playtitlemusic() + + var/datum/asset/asset_datum = get_asset_datum(/datum/asset/simple/lobby) + asset_datum.send(client) + if(SSticker.current_state < GAME_STATE_SETTING_UP) var/tl = SSticker.GetTimeLeft() var/postfix diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 3ae04568fab3..5a132ae9eeea 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -1,19 +1,19 @@ -#define LINKIFY_READY(string, value) "[string]" - /mob/dead/new_player - var/ready = 0 - var/spawning = 0//Referenced when you want to delete the new_player later on in the code. - flags_1 = NONE invisibility = INVISIBILITY_ABSTRACT density = FALSE stat = DEAD - - var/mob/living/new_character //for instant transfer once the round is set up - - //Used to make sure someone doesn't get spammed with messages if they're ineligible for roles + hud_type = /datum/hud/new_player + hud_possible = list() + + var/ready = FALSE + /// Referenced when you want to delete the new_player later on in the code. + var/spawning = FALSE + /// For instant transfer once the round is set up + var/mob/living/new_character + ///Used to make sure someone doesn't get spammed with messages if they're ineligible for roles. var/ineligible_for_roles = FALSE /mob/dead/new_player/Initialize() @@ -39,64 +39,6 @@ /mob/dead/new_player/prepare_huds() return -/mob/dead/new_player/proc/new_player_panel() - var/datum/asset/asset_datum = get_asset_datum(/datum/asset/simple/lobby) - asset_datum.send(client) - var/output = "

Setup Character

" - - if(SSticker.current_state <= GAME_STATE_PREGAME) - switch(ready) - if(PLAYER_NOT_READY) - output += "

\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | Not Ready | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]

" - if(PLAYER_READY_TO_PLAY) - output += "

\[ Ready | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | [LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)] \]

" - if(PLAYER_READY_TO_OBSERVE) - output += "

\[ [LINKIFY_READY("Ready", PLAYER_READY_TO_PLAY)] | [LINKIFY_READY("Not Ready", PLAYER_NOT_READY)] | Observe \]

" - else - output += "

View the Crew Manifest

" - output += "

Join Game!

" - output += "

[LINKIFY_READY("Observe", PLAYER_READY_TO_OBSERVE)]

" - - if(!IsGuestKey(src.key)) - if (SSdbcore.Connect()) - var/isadmin = 0 - if(src.client && src.client.holder) - isadmin = 1 - var/datum/DBQuery/query_get_new_polls = SSdbcore.NewQuery({" - SELECT id FROM [format_table_name("poll_question")] - WHERE (adminonly = 0 OR :isadmin = 1) - AND Now() BETWEEN starttime AND endtime - AND id NOT IN ( - SELECT pollid FROM [format_table_name("poll_vote")] - WHERE ckey = :ckey - ) - AND id NOT IN ( - SELECT pollid FROM [format_table_name("poll_textreply")] - WHERE ckey = :ckey - ) - "}, list("isadmin" = isadmin, "ckey" = ckey)) - var/rs = REF(src) - if(query_get_new_polls.Execute()) - var/newpoll = 0 - if(query_get_new_polls.NextRow()) - newpoll = 1 - - if(newpoll) - output += "

Show Player Polls (NEW!)

" - else - output += "

Show Player Polls

" - qdel(query_get_new_polls) - if(QDELETED(src)) - return - - output += "
" - - var/datum/browser/popup = new(src, "playersetup", "
New Player Options
", 250, 265) - popup.set_window_options("can_close=0") - popup.set_content(output) - popup.open(FALSE) - -// List of possible actions user has chosen on the New Players menus /mob/dead/new_player/Topic(href, href_list[]) if(src != usr) return 0 @@ -104,67 +46,13 @@ if(!client) return 0 - //Determines Relevent Population Cap - var/relevant_cap - var/hpc = CONFIG_GET(number/hard_popcap) - var/epc = CONFIG_GET(number/extreme_popcap) - if(hpc && epc) - relevant_cap = min(hpc, epc) - else - relevant_cap = max(hpc, epc) - - if(href_list["show_preferences"]) - client.prefs.ShowChoices(src) - return 1 - - if(href_list["ready"]) - var/tready = text2num(href_list["ready"]) - //Avoid updating ready if we're after PREGAME (they should use latejoin instead) - //This is likely not an actual issue but I don't have time to prove that this - //no longer is required - if(SSticker.current_state <= GAME_STATE_PREGAME) - ready = tready - //if it's post initialisation and they're trying to observe we do the needful - if(!SSticker.current_state < GAME_STATE_PREGAME && tready == PLAYER_READY_TO_OBSERVE) - ready = tready - make_me_an_observer() - return - - if(href_list["refresh"]) - src << browse(null, "window=playersetup") //closes the player setup window - new_player_panel() - - if(href_list["late_join"]) - if(!SSticker || !SSticker.IsRoundInProgress()) - to_chat(usr, span_danger("The round is either not ready, or has already finished...")) - return - - if(href_list["late_join"] == "override") - LateChoices() - return - - if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in GLOB.admin_datums))) - //yogs start -- donors bypassing the queue - if(ckey(key) in get_donators()) - to_chat(usr, span_notice("Because you are a donator, you have bypassed the queue! Thank you for donating!")) - LateChoices() - return - //yogs end - to_chat(usr, span_danger("[CONFIG_GET(string/hard_popcap_message)]")) - - var/queue_position = SSticker.queued_players.Find(usr) - if(queue_position == 1) - to_chat(usr, span_notice("You are next in line to join the game. You will be notified when a slot opens up.")) - else if(queue_position) - to_chat(usr, span_notice("There are [queue_position-1] players in front of you in the queue to join the game.")) - else - SSticker.queued_players += usr - to_chat(usr, span_notice("You have been added to the queue to join the game. Your position in queue is [SSticker.queued_players.len].")) - return + + if(href_list["late_join"]) //This still exists for queue messages in chat + if(!SSticker?.IsRoundInProgress()) + to_chat(usr, span_boldwarning("The round is either not ready, or has already finished...")) + return LateChoices() - - if(href_list["manifest"]) - ViewManifest() + return if(href_list["SelectedJob"]) @@ -176,6 +64,17 @@ to_chat(usr, span_notice("There is an administrative lock on entering the game!")) return + //Determines Relevent Population Cap + var/relevant_cap + var/hpc = CONFIG_GET(number/hard_popcap) + var/epc = CONFIG_GET(number/extreme_popcap) + if(hpc && epc) + relevant_cap = min(hpc, epc) + else + relevant_cap = max(hpc, epc) + + + if(SSticker.queued_players.len && !(ckey(key) in GLOB.admin_datums)) if((living_player_count() >= relevant_cap) || (src != SSticker.queued_players[1])) to_chat(usr, span_warning("Server is full.")) @@ -192,21 +91,10 @@ AttemptLateSpawn(href_list["SelectedJob"]) return - else if(!href_list["late_join"]) - new_player_panel() - if(href_list["showpoll"]) handle_player_polling() return - if(href_list["pollid"]) - var/pollid = href_list["pollid"] - if(istext(pollid)) - pollid = text2num(pollid) - if(isnum(pollid) && ISINTEGER(pollid)) - src.poll_player(pollid) - return - if(href_list["votepollid"] && href_list["votetype"]) var/pollid = text2num(href_list["votepollid"]) var/votetype = href_list["votetype"] @@ -290,7 +178,6 @@ if(QDELETED(src) || !src.client || this_is_like_playing_right != "Yes") ready = PLAYER_NOT_READY src << browse(null, "window=playersetup") //closes the player setup window - new_player_panel() return FALSE var/mob/dead/observer/observer = new() diff --git a/code/modules/spells/spell_types/aimed.dm b/code/modules/spells/spell_types/aimed.dm index 364d22c441a6..3f1bcbe0a438 100644 --- a/code/modules/spells/spell_types/aimed.dm +++ b/code/modules/spells/spell_types/aimed.dm @@ -4,7 +4,7 @@ var/projectile_type = /obj/item/projectile/magic/teleport var/deactive_msg = "You discharge your projectile..." var/active_msg = "You charge your projectile!" - var/base_icon_state = "projectile" + base_icon_state = "projectile" var/active_icon_state = "projectile" var/list/projectile_var_overrides = list() var/projectile_amount = 1 //Projectiles per cast. diff --git a/icons/hud/lobby/background.dmi b/icons/hud/lobby/background.dmi new file mode 100644 index 000000000000..2d002f0162cc Binary files /dev/null and b/icons/hud/lobby/background.dmi differ diff --git a/icons/hud/lobby/bottom_buttons.dmi b/icons/hud/lobby/bottom_buttons.dmi new file mode 100644 index 000000000000..1d2133d861d9 Binary files /dev/null and b/icons/hud/lobby/bottom_buttons.dmi differ diff --git a/icons/hud/lobby/character_setup.dmi b/icons/hud/lobby/character_setup.dmi new file mode 100644 index 000000000000..2059389d4403 Binary files /dev/null and b/icons/hud/lobby/character_setup.dmi differ diff --git a/icons/hud/lobby/countdown_background.dmi b/icons/hud/lobby/countdown_background.dmi new file mode 100644 index 000000000000..626bd249e792 Binary files /dev/null and b/icons/hud/lobby/countdown_background.dmi differ diff --git a/icons/hud/lobby/countdown_letters.dmi b/icons/hud/lobby/countdown_letters.dmi new file mode 100644 index 000000000000..74f9f2f79cce Binary files /dev/null and b/icons/hud/lobby/countdown_letters.dmi differ diff --git a/icons/hud/lobby/join.dmi b/icons/hud/lobby/join.dmi new file mode 100644 index 000000000000..3ee400ef2b69 Binary files /dev/null and b/icons/hud/lobby/join.dmi differ diff --git a/icons/hud/lobby/observe.dmi b/icons/hud/lobby/observe.dmi new file mode 100644 index 000000000000..a83243f8c8e5 Binary files /dev/null and b/icons/hud/lobby/observe.dmi differ diff --git a/icons/hud/lobby/poll_overlay.dmi b/icons/hud/lobby/poll_overlay.dmi new file mode 100644 index 000000000000..2fc97162601c Binary files /dev/null and b/icons/hud/lobby/poll_overlay.dmi differ diff --git a/icons/hud/lobby/ready.dmi b/icons/hud/lobby/ready.dmi new file mode 100644 index 000000000000..ab473ee8dff1 Binary files /dev/null and b/icons/hud/lobby/ready.dmi differ diff --git a/yogstation.dme b/yogstation.dme index b002e518256d..743e3b4653f0 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -233,6 +233,7 @@ #include "code\_onclick\hud\map_popups.dm" #include "code\_onclick\hud\monkey.dm" #include "code\_onclick\hud\movable_screen_objects.dm" +#include "code\_onclick\hud\new_player.dm" #include "code\_onclick\hud\pai.dm" #include "code\_onclick\hud\parallax.dm" #include "code\_onclick\hud\picture_in_picture.dm" @@ -318,6 +319,7 @@ #include "code\controllers\subsystem\vis_overlays.dm" #include "code\controllers\subsystem\vote.dm" #include "code\controllers\subsystem\weather.dm" +#include "code\controllers\subsystem\processing\fastlobbyprocess.dm" #include "code\controllers\subsystem\processing\fastprocess.dm" #include "code\controllers\subsystem\processing\fields.dm" #include "code\controllers\subsystem\processing\fluids.dm"