diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index ae1e619763f22..ca63a0d58e795 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -433,10 +433,12 @@ GLOBAL_LIST_INIT(available_ui_styles, list( return update_robot_modules_display() +/* BANDASTATION REMOVAL - HTML Title Screen /datum/hud/new_player/show_hud(version = 0, mob/viewmob) . = ..() if(.) show_station_trait_buttons() +*/ /datum/hud/proc/hidden_inventory_update() return diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index 594449575ea06..bacc16173550b 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -10,7 +10,7 @@ /datum/hud/new_player/New(mob/owner) . = ..() - + /* BANDASTATION REMOVAL - HTML Title Screen if (!owner || !owner.client) return @@ -605,7 +605,7 @@ //pull the shutter back off-screen animate(transform = matrix(), time = SHUTTER_MOVEMENT_DURATION, easing = CUBIC_EASING|EASE_IN) - +*/ #undef SHUTTER_MOVEMENT_DURATION #undef SHUTTER_WAIT_DURATION #undef MAX_STATION_TRAIT_BUTTONS_VERTICAL diff --git a/code/controllers/subsystem/processing/station.dm b/code/controllers/subsystem/processing/station.dm index c58840cfa7ad1..58cfdda639e56 100644 --- a/code/controllers/subsystem/processing/station.dm +++ b/code/controllers/subsystem/processing/station.dm @@ -24,7 +24,7 @@ PROCESSING_SUBSYSTEM_DEF(station) // Autowiki also wants consistent outputs, for example making sure the vending machine page always reports the normal products #if !defined(UNIT_TESTS) && !defined(AUTOWIKI) SetupTraits() - display_lobby_traits() + // display_lobby_traits() BANDASTATION REMOVAL - HTML Title Screen #endif announcer = new announcer() //Initialize the station's announcer datum @@ -175,6 +175,7 @@ PROCESSING_SUBSYSTEM_DEF(station) var/datum/station_trait/trait_to_remove = i selectable_traits_by_types[initial(trait_to_remove.trait_type)] -= trait_to_remove +/* BANDASTATION REMOVAL - HTML Title Screen /// Update station trait lobby buttons for clients who joined before we initialised this subsystem /datum/controller/subsystem/processing/station/proc/display_lobby_traits() for (var/mob/dead/new_player/player as anything in GLOB.new_player_list) @@ -182,3 +183,4 @@ PROCESSING_SUBSYSTEM_DEF(station) if (!istype(observer_hud)) continue observer_hud.show_station_trait_buttons() +*/ diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 96cde0ef0dded..4ceba5e25acd4 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -354,6 +354,7 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/create_characters() for(var/i in GLOB.new_player_list) var/mob/dead/new_player/player = i + SStitle.show_title_screen_to(player.client) // BANDASTATION ADDITION - HTML Title Screen if(player.ready == PLAYER_READY_TO_PLAY && player.mind) GLOB.joined_player_list += player.ckey var/atom/destination = player.mind.assigned_role.get_roundstart_spawn_point() diff --git a/code/datums/station_traits/_station_trait.dm b/code/datums/station_traits/_station_trait.dm index ddd8bc20a9110..7756ca779441b 100644 --- a/code/datums/station_traits/_station_trait.dm +++ b/code/datums/station_traits/_station_trait.dm @@ -51,8 +51,10 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) GLOB.dynamic_ruleset_categories = dynamic_category if(sign_up_button) GLOB.lobby_station_traits += src + /* BANDASTATION REMOVAL - HTML Title Screen if(SSstation.initialized) SSstation.display_lobby_traits() + */ if(trait_processes) START_PROCESSING(SSstation, src) if(trait_to_give) @@ -96,6 +98,7 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) /datum/station_trait/proc/can_display_lobby_button(client/player) return sign_up_button && !SSticker.HasRoundStarted() +/* BANDASTATION REMOVAL - HTML Title Screen /// Apply any additional handling we need to our lobby button /datum/station_trait/proc/setup_lobby_button(atom/movable/screen/lobby/button/sign_up/lobby_button) SHOULD_CALL_PARENT(TRUE) @@ -120,6 +123,7 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) /datum/station_trait/proc/on_lobby_button_destroyed(atom/movable/screen/lobby/button/sign_up/lobby_button) SIGNAL_HANDLER lobby_buttons -= lobby_button +*/ /// Proc ran when round starts. Use this for roundstart effects. By default we clean up our buttons here. /datum/station_trait/proc/on_round_start() @@ -128,6 +132,7 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) /// Remove all of our active lobby buttons /datum/station_trait/proc/destroy_lobby_buttons() +/* BANDASTATION REMOVAL - HTML Title Screen for (var/atom/movable/screen/button as anything in lobby_buttons) var/mob/dead/new_player/hud_owner = button.get_mob() if (QDELETED(hud_owner)) @@ -138,6 +143,7 @@ GLOBAL_LIST_EMPTY(lobby_station_traits) qdel(button) continue using_hud.remove_station_trait_button(src) +*/ /// Called when overriding a pulsar star command report message. /datum/station_trait/proc/get_pulsar_message() diff --git a/code/datums/station_traits/job_traits.dm b/code/datums/station_traits/job_traits.dm index 3e8171d99c57b..ab56281f6a56e 100644 --- a/code/datums/station_traits/job_traits.dm +++ b/code/datums/station_traits/job_traits.dm @@ -30,6 +30,7 @@ blacklist += subtypesof(/datum/station_trait/job) - type // All but ourselves RegisterSignal(SSdcs, COMSIG_GLOB_PRE_JOBS_ASSIGNED, PROC_REF(pre_jobs_assigned)) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/setup_lobby_button(atom/movable/screen/lobby/button/sign_up/lobby_button) RegisterSignal(lobby_button, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_lobby_button_update_overlays)) lobby_button.desc = button_desc @@ -55,6 +56,7 @@ /datum/station_trait/job/proc/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) SIGNAL_HANDLER overlays += LAZYFIND(lobby_candidates, lobby_button.get_mob()) ? "tick" : "cross" +*/ /// Called before we start assigning roles, assign ours first /datum/station_trait/job/proc/pre_jobs_assigned() @@ -93,9 +95,11 @@ . = ..() RegisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(replace_cargo)) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/cargorilla/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) . = ..() overlays += LAZYFIND(lobby_candidates, lobby_button.get_mob()) ? "gorilla_on" : "gorilla_off" +*/ /// Remove the cargo equipment and personnel that are being replaced by a gorilla. /datum/station_trait/job/cargorilla/proc/replace_cargo(datum/source) @@ -126,9 +130,11 @@ . = ..() RegisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE, PROC_REF(add_coffeemaker)) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/bridge_assistant/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) . = ..() overlays += "bridge_assistant" +*/ /// Creates a coffeemaker in the bridge, if we don't have one yet. /datum/station_trait/job/bridge_assistant/proc/add_coffeemaker(datum/source) @@ -176,9 +182,11 @@ can_roll_antag = CAN_ROLL_PROTECTED job_to_add = /datum/job/veteran_advisor +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/veteran_advisor/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) . = ..() overlays += "veteran_advisor" +*/ /datum/station_trait/job/human_ai name = "Human AI" @@ -201,9 +209,11 @@ UnregisterSignal(SSatoms, COMSIG_SUBSYSTEM_POST_INITIALIZE) return ..() +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/human_ai/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) . = ..() overlays += LAZYFIND(lobby_candidates, lobby_button.get_mob()) ? "human_ai_on" : "human_ai_off" +*/ /datum/station_trait/job/human_ai/proc/remove_ai_job(datum/source) SIGNAL_HANDLER @@ -264,9 +274,11 @@ new /obj/effect/landmark/start/pun_pun(GLOB.the_one_and_only_punpun.loc) qdel(GLOB.the_one_and_only_punpun) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/job/pun_pun/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) . = ..() overlays += LAZYFIND(lobby_candidates, lobby_button.get_mob()) ? "pun_pun_on" : "pun_pun_off" +*/ #undef CAN_ROLL_ALWAYS #undef CAN_ROLL_PROTECTED diff --git a/code/datums/station_traits/neutral_traits.dm b/code/datums/station_traits/neutral_traits.dm index f3bb4fb4a9c75..52a1ed60140e5 100644 --- a/code/datums/station_traits/neutral_traits.dm +++ b/code/datums/station_traits/neutral_traits.dm @@ -413,10 +413,12 @@ . = ..() RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, PROC_REF(on_job_after_spawn)) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/skub/setup_lobby_button(atom/movable/screen/lobby/button/sign_up/lobby_button) RegisterSignal(lobby_button, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_lobby_button_update_overlays)) lobby_button.desc = "Are you pro-skub or anti-skub? Click to cycle through pro-skub, anti-skub, random and neutral." return ..() +*/ /// Let late-joiners jump on this gimmick too. /datum/station_trait/skub/can_display_lobby_button(client/player) @@ -426,6 +428,7 @@ /datum/station_trait/skub/on_round_start() return +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/skub/on_lobby_button_update_icon(atom/movable/screen/lobby/button/sign_up/lobby_button, location, control, params, mob/dead/new_player/user) var/mob/player = lobby_button.get_mob() var/skub_stance = skubbers[player.ckey] @@ -467,6 +470,7 @@ overlays += "neutral_skub" if(RANDOM_SKUB) overlays += "random_skub" +*/ /datum/station_trait/skub/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/spawned, client/player_client) SIGNAL_HANDLER @@ -554,10 +558,12 @@ . = ..() RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, PROC_REF(on_job_after_spawn)) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/pet_day/setup_lobby_button(atom/movable/screen/lobby/button/sign_up/lobby_button) lobby_button.desc = "Want to bring your innocent pet to a giant metal deathtrap? Click here to customize it!" RegisterSignal(lobby_button, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_lobby_button_update_overlays)) return ..() +*/ /datum/station_trait/pet_day/can_display_lobby_button(client/player) return sign_up_button @@ -565,6 +571,7 @@ /datum/station_trait/pet_day/on_round_start() return +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/pet_day/on_lobby_button_click(atom/movable/screen/lobby/button/sign_up/lobby_button, updates) var/mob/our_player = lobby_button.get_mob() var/client/player_client = our_player.client @@ -574,6 +581,7 @@ if(isnull(customization)) customization = new(player_client) INVOKE_ASYNC(customization, TYPE_PROC_REF(/datum, ui_interact), our_player) +*/ /datum/station_trait/pet_day/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/spawned, client/player_client) SIGNAL_HANDLER @@ -583,5 +591,7 @@ return INVOKE_ASYNC(customization, TYPE_PROC_REF(/datum/pet_customization, create_pet), spawned, player_client) +/* BANDASTATION REMOVAL - HTML Title Screen /datum/station_trait/pet_day/proc/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays) overlays += "select_pet" +*/ diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 98ff0e08e7d8e..8b9f1bf33f618 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,10 +1,12 @@ /client/proc/add_admin_verbs() control_freak = CONTROL_FREAK_SKIN | CONTROL_FREAK_MACROS SSadmin_verbs.assosciate_admin(src) + SStitle.title_output(src, "true", "admin_buttons_visibility") // BANDASTATION ADDITION - HTML Title Screen /client/proc/remove_admin_verbs() control_freak = initial(control_freak) SSadmin_verbs.deassosciate_admin(src) + SStitle.title_output(src, "false", "admin_buttons_visibility") // BANDASTATION ADDITION - HTML Title Screen ADMIN_VERB(hide_verbs, R_NONE, "Adminverbs - Hide All", "Hide most of your admin verbs.", ADMIN_CATEGORY_MAIN) user.remove_admin_verbs() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 545458537e1a2..878997047614f 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -237,7 +237,11 @@ GLOBAL_LIST_EMPTY(preferences_datums) if (istype(requested_preference, /datum/preference/name)) tainted_character_profiles = TRUE - + // BANDASTATION ADDITION - HTML Title Screen + for (var/datum/preference_middleware/preference_middleware as anything in middleware) + if (preference_middleware.post_set_preference(usr, requested_preference_key, value)) + return TRUE + // BANDASTATION ADDITION END return TRUE if ("set_color_preference") var/requested_preference_key = params["preference"] diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm index 4cbd2ee859fe6..3b374971ee5b0 100644 --- a/code/modules/mob/dead/new_player/login.dm +++ b/code/modules/mob/dead/new_player/login.dm @@ -2,6 +2,7 @@ if(!client) return + SStitle.show_title_screen_to(client) // BANDASTATION ADDITION - HTML Title Screen if(CONFIG_GET(flag/use_exp_tracking)) client?.set_exp_from_db() client?.set_db_player_flags() diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 97a373abc186b..ef0617f6a6134 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -79,6 +79,7 @@ ready = PLAYER_NOT_READY return FALSE + SStitle.hide_title_screen_from(client) // BANDASTATION ADDITION - HTML Title Screen var/mob/dead/observer/observer = new() spawning = TRUE @@ -282,6 +283,7 @@ . = new_character if(!.) return + SStitle.hide_title_screen_from(client) // BANDASTATION ADDITION - HTML Title Screen new_character.key = key //Manually transfer the key to log them in, new_character.stop_sound_channel(CHANNEL_LOBBYMUSIC) var/area/joined_area = get_area(new_character.loc) diff --git a/icons/ui/common/ss220.png b/icons/ui/common/ss220.png new file mode 100644 index 0000000000000..1b46266abf35d Binary files /dev/null and b/icons/ui/common/ss220.png differ diff --git a/interface/fonts/PixCyrillic.ttf b/interface/fonts/PixCyrillic.ttf index f0016e86c222f..b01ca05450c80 100644 Binary files a/interface/fonts/PixCyrillic.ttf and b/interface/fonts/PixCyrillic.ttf differ diff --git a/interface/skin.dmf b/interface/skin.dmf index 7124e67cec605..bedcab8198a2e 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -65,7 +65,7 @@ window "mainwindow" is-default = true saved-params = "pos;size;is-minimized;is-maximized" statusbar = false - icon = 'icons\\ui\\common\\tg_32.png' + icon = 'icons\\ui\\common\\ss220.png' macro = "default" menu = "menu" elem "split" @@ -126,6 +126,17 @@ window "mapwindow" right-click = true saved-params = "zoom;letterbox;zoom-mode" style = ".center { text-align: center; } .maptext { font-family: 'Grand9K Pixel'; font-size: 6pt; -dm-text-outline: 1px black; color: white; line-height: 1.0; } .command_headset { font-weight: bold; } .context { font-family: 'Pix Cyrillic'; font-size: 12pt; -dm-text-outline: 1px black; } .subcontext { font-family: 'TinyUnicode'; font-size: 12pt; line-height: 0.75; } .small { font-family: 'Spess Font'; font-size: 6pt; line-height: 1.4; } .big { font-family: 'Pix Cyrillic'; font-size: 12pt; } .reallybig { font-size: 12pt; } .extremelybig { font-size: 12pt; } .greentext { color: #00FF00; font-size: 6pt; } .redtext { color: #FF0000; font-size: 6pt; } .clown { color: #FF69BF; font-weight: bold; } .his_grace { color: #15D512; } .hypnophrase { color: #0d0d0d; font-weight: bold; } .yell { font-weight: bold; } .italics { font-family: 'Spess Font'; font-size: 6pt; line-height: 1.4; }" + elem "title_browser" + type = BROWSER + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + is-visible = false + is-disabled = true + saved-params = "" + auto-format = false + style = ".center { text-align: center; } .maptext { font-family: 'Grand9K Pixel'; font-size: 6pt; -dm-text-outline: 1px black; color: white; line-height: 1.0; } .command_headset { font-weight: bold; } .context { font-family: 'Pix Cyrillic'; font-size: 12pt; -dm-text-outline: 1px black; } .subcontext { font-family: 'TinyUnicode'; font-size: 12pt; line-height: 0.75; } .small { font-family: 'Spess Font'; font-size: 6pt; line-height: 1.4; } .big { font-family: 'Pix Cyrillic'; font-size: 12pt; } .reallybig { font-size: 12pt; } .extremelybig { font-size: 12pt; } .greentext { color: #00FF00; font-size: 6pt; } .redtext { color: #FF0000; font-size: 6pt; } .clown { color: #FF69BF; font-weight: bold; } .his_grace { color: #15D512; } .hypnophrase { color: #0d0d0d; font-weight: bold; } .yell { font-weight: bold; } .italics { font-family: 'Spess Font'; font-size: 6pt; line-height: 1.4; }" elem "status_bar" type = LABEL pos = 0,464 diff --git a/modular_bandastation/aesthetics/_aesthetics.dme b/modular_bandastation/aesthetics/_aesthetics.dme index 4d142b206a4fc..5a71da1c528a1 100644 --- a/modular_bandastation/aesthetics/_aesthetics.dme +++ b/modular_bandastation/aesthetics/_aesthetics.dme @@ -53,9 +53,6 @@ // Lights #include "lights/code/lights.dm" -// Lobby Menu -#include "lobby/code/lobby.dm" - // Radio #include "radio/code/radio.dm" diff --git a/modular_bandastation/aesthetics/lobby/code/lobby.dm b/modular_bandastation/aesthetics/lobby/code/lobby.dm deleted file mode 100644 index f262d188d4c44..0000000000000 --- a/modular_bandastation/aesthetics/lobby/code/lobby.dm +++ /dev/null @@ -1,11 +0,0 @@ -/atom/movable/screen/lobby/button/ready - icon = 'modular_bandastation/aesthetics/lobby/icons/ready.dmi' - -/atom/movable/screen/lobby/button/join - icon = 'modular_bandastation/aesthetics/lobby/icons/join.dmi' - -/atom/movable/screen/lobby/button/observe - icon = 'modular_bandastation/aesthetics/lobby/icons/observe.dmi' - -/atom/movable/screen/lobby/button/character_setup - icon = 'modular_bandastation/aesthetics/lobby/icons/character_setup.dmi' diff --git a/modular_bandastation/aesthetics/lobby/icons/character_setup.dmi b/modular_bandastation/aesthetics/lobby/icons/character_setup.dmi deleted file mode 100644 index 8d0f5ff7e12fd..0000000000000 Binary files a/modular_bandastation/aesthetics/lobby/icons/character_setup.dmi and /dev/null differ diff --git a/modular_bandastation/aesthetics/lobby/icons/join.dmi b/modular_bandastation/aesthetics/lobby/icons/join.dmi deleted file mode 100644 index 67ba7b2ca23da..0000000000000 Binary files a/modular_bandastation/aesthetics/lobby/icons/join.dmi and /dev/null differ diff --git a/modular_bandastation/aesthetics/lobby/icons/observe.dmi b/modular_bandastation/aesthetics/lobby/icons/observe.dmi deleted file mode 100644 index 7ea97e420412f..0000000000000 Binary files a/modular_bandastation/aesthetics/lobby/icons/observe.dmi and /dev/null differ diff --git a/modular_bandastation/aesthetics/lobby/icons/ready.dmi b/modular_bandastation/aesthetics/lobby/icons/ready.dmi deleted file mode 100644 index c264279585b33..0000000000000 Binary files a/modular_bandastation/aesthetics/lobby/icons/ready.dmi and /dev/null differ diff --git a/modular_bandastation/discord/code/discord.dm b/modular_bandastation/discord/code/discord.dm index 1d5e273ce496e..66b636eeefdf4 100644 --- a/modular_bandastation/discord/code/discord.dm +++ b/modular_bandastation/discord/code/discord.dm @@ -54,21 +54,3 @@ else to_chat(src, span_danger("The discord URL is not set in the server configuration.")) return - -/mob/dead/new_player/Topic(href, href_list[]) - if(src != usr) - return - - if(!client) - return - - if(client.interviewee) - return FALSE - - if(href_list["observe"] || href_list["toggle_ready"] || href_list["late_join"]) - if (!!CONFIG_GET(flag/sql_enabled) && !client.prefs.discord_id) - to_chat(usr, "Вам необходимо привязать дискорд-профиль к аккаунту!") - to_chat(usr, "Нажмите 'Verify Discord Account' во вкладке 'OOC' для получения инструкций.") - return FALSE - - . = ..() diff --git a/modular_bandastation/modular_bandastation.dme b/modular_bandastation/modular_bandastation.dme index 0df1f244a3ec4..ce0ebd54a1de4 100644 --- a/modular_bandastation/modular_bandastation.dme +++ b/modular_bandastation/modular_bandastation.dme @@ -5,6 +5,7 @@ #include "_helpers220/_helpers220.dme" #include "_signals220/_signals220.dme" #include "_singletons/_singletons.dme" +#include "title_screen/_title_screen.dme" #include "admin/_admin.dme" #include "aesthetics/_aesthetics.dme" #include "aesthetics_sounds/_aesthetics_sounds.dme" diff --git a/modular_bandastation/title_screen/README.md b/modular_bandastation/title_screen/README.md new file mode 100644 index 0000000000000..24efe9c43ce48 --- /dev/null +++ b/modular_bandastation/title_screen/README.md @@ -0,0 +1,14 @@ +# Изменения в изначальном коде + +`interface/skin.dmf` - `add`:`elem "title_browser"` + +`code/_onclick/hud/hud.dm` +`code/_onclick/hud/new_player.dm` +`code/controllers/subsystem/ticker.dm` +`code/controllers/subsystem/processing/station.dm` +`code/datums/station_traits/_station_trait.dm` +`code/datums/station_traits/job_traits.dm` +`code/datums/station_traits/neutral_traits.dm` +`code/modules/mob/dead/new_player/new_player.dm` + +Конерктику ищите по комментарию - `HTML Title Screen` diff --git a/modular_bandastation/title_screen/_title_screen.dm b/modular_bandastation/title_screen/_title_screen.dm new file mode 100644 index 0000000000000..f13e6de7d903e --- /dev/null +++ b/modular_bandastation/title_screen/_title_screen.dm @@ -0,0 +1,4 @@ +/datum/modpack/title_screen + name = "Title Screen" + desc = "Делает лобби браузерным, а не объектом в мире игры." + author = "Aylong" diff --git a/modular_bandastation/title_screen/_title_screen.dme b/modular_bandastation/title_screen/_title_screen.dme new file mode 100644 index 0000000000000..f7a54bf69588a --- /dev/null +++ b/modular_bandastation/title_screen/_title_screen.dme @@ -0,0 +1,10 @@ +#include "_title_screen.dm" + +#include "code/_title_screen_defines.dm" +#include "code/asset_lobby.dm" +#include "code/title_screen_datum.dm" +#include "code/new_player.dm" +#include "code/station_traits.dm" +#include "code/title_screen_controls.dm" +#include "code/title_screen_pref_middleware.dm" +#include "code/title_screen_subsystem.dm" diff --git a/modular_bandastation/title_screen/code/_title_screen_defines.dm b/modular_bandastation/title_screen/code/_title_screen_defines.dm new file mode 100644 index 0000000000000..538f1923efe25 --- /dev/null +++ b/modular_bandastation/title_screen/code/_title_screen_defines.dm @@ -0,0 +1,4 @@ +#define MAX_STATION_TRAIT_BUTTONS_VERTICAL 3 +#define DEFAULT_TITLE_SCREEN_IMAGE_PATH 'modular_bandastation/title_screen/icons/default.png' +#define DEFAULT_TITLE_SCREEN_HTML_CSS 'modular_bandastation/title_screen/html/title_screen.css' +#define TITLE_SCREENS_LOCATION "config/title_screens/images/" diff --git a/modular_bandastation/title_screen/code/asset_lobby.dm b/modular_bandastation/title_screen/code/asset_lobby.dm new file mode 100644 index 0000000000000..8c3fad11a4333 --- /dev/null +++ b/modular_bandastation/title_screen/code/asset_lobby.dm @@ -0,0 +1,29 @@ +/datum/asset/simple/html_title_screen + assets = list( + "lobby_background.png" = 'modular_bandastation/title_screen/icons/lobby_background.png', + "lobby_toggle_ready.png" = 'modular_bandastation/title_screen/icons/lobby_toggle_ready.png', + "lobby_late_join.png" = 'modular_bandastation/title_screen/icons/lobby_late_join.png', + "lobby_character_setup.png" = 'modular_bandastation/title_screen/icons/lobby_character_setup.png', + "lobby_observe.png" = 'modular_bandastation/title_screen/icons/lobby_observe.png', + + "lobby_active.png" = 'modular_bandastation/title_screen/icons/lobby_active.png', + "lobby_disabled.png" = 'modular_bandastation/title_screen/icons/lobby_disabled.png', + "lobby_highlight.png" = 'modular_bandastation/title_screen/icons/lobby_highlight.png', + + "lobby_manifest.png" = 'modular_bandastation/title_screen/icons/lobby_manifest.png', + "lobby_wiki.png" = 'modular_bandastation/title_screen/icons/lobby_wiki.png', + "lobby_settings.png" = 'modular_bandastation/title_screen/icons/lobby_settings.png', + "lobby_changelog.png" = 'modular_bandastation/title_screen/icons/lobby_changelog.png', + "lobby_picture.png" = 'modular_bandastation/title_screen/icons/lobby_picture.png', + "lobby_notice.png" = 'modular_bandastation/title_screen/icons/lobby_notice.png', + "lobby_css.png" = 'modular_bandastation/title_screen/icons/lobby_css.png', + + "lobby_human_ai.png" = 'modular_bandastation/title_screen/icons/lobby_human_ai.png', + "lobby_bridge_assistant.png" = 'modular_bandastation/title_screen/icons/lobby_bridge_assistant.png', + "lobby_cargorilla.png" = 'modular_bandastation/title_screen/icons/lobby_cargorilla.png', + "lobby_pun_pun.png" = 'modular_bandastation/title_screen/icons/lobby_pun_pun.png', + "lobby_veteran_advisor.png" = 'modular_bandastation/title_screen/icons/lobby_veteran_advisor.png', + + "lobby_collapse.png" = 'modular_bandastation/title_screen/icons/lobby_collapse.png', + "lobby_shutter.png" = 'modular_bandastation/title_screen/icons/lobby_shutter.png', + ) diff --git a/modular_bandastation/title_screen/code/new_player.dm b/modular_bandastation/title_screen/code/new_player.dm new file mode 100644 index 0000000000000..85e22af762d58 --- /dev/null +++ b/modular_bandastation/title_screen/code/new_player.dm @@ -0,0 +1,106 @@ +/mob/dead/new_player + var/title_collapsed = FALSE + +/mob/dead/new_player/Topic(href, href_list[]) + if(src != usr) + return + + if(!client || client.interviewee) + return + + if(href_list["toggle_ready"]) + ready = !ready + SStitle.title_output(client, ready, "toggle_ready") + lobby_button_sound() + + else if(href_list["late_join"]) + lobby_button_sound() + GLOB.latejoin_menu.ui_interact(usr) + + else if(href_list["observe"]) + lobby_button_sound() + if(!SSticker || SSticker.current_state <= GAME_STATE_STARTUP) + to_chat(usr, span_warning("Сервер ещё не загрузился!")) + return + + make_me_an_observer() + + else if(href_list["character_setup"]) + lobby_button_sound() + var/datum/preferences/preferences = client.prefs + preferences.current_window = PREFERENCE_TAB_CHARACTER_PREFERENCES + preferences.update_static_data(src) + preferences.ui_interact(src) + + else if(href_list["settings"]) + lobby_button_sound() + var/datum/preferences/preferences = client.prefs + preferences.current_window = PREFERENCE_TAB_GAME_PREFERENCES + preferences.update_static_data(usr) + preferences.ui_interact(usr) + + else if(href_list["manifest"]) + lobby_button_sound() + ViewManifest() + + else if(href_list["changelog"]) + lobby_button_sound() + client?.changelog() + + else if(href_list["wiki"]) + lobby_button_sound() + if(tgui_alert(usr, "Хотите открыть нашу вики?", "Вики", list("Да", "Нет")) != "Да") + return + client << link("https://tg.ss220.club") + + else if(href_list["trait_signup"]) + var/datum/station_trait/clicked_trait + for(var/datum/station_trait/trait as anything in GLOB.lobby_station_traits) + if(trait.name == href_list["trait_signup"]) + clicked_trait = trait + + clicked_trait.on_lobby_button_click(usr, href_list["id"]) + lobby_button_sound() + + else if(href_list["picture"]) + if(!check_rights(R_FUN)) + log_admin("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + message_admins("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + return + + lobby_button_sound() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/change_title_screen) + + else if(href_list["notice"]) + if(!check_rights(R_FUN)) + log_admin("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + message_admins("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + return + + lobby_button_sound() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/change_title_screen_notice) + + else if(href_list["css"]) + if(!check_rights(R_DEBUG)) + log_admin("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + message_admins("Title Screen: Possible href exploit attempt by [key_name(usr)]!") + return + + lobby_button_sound() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/change_title_screen_css) + + else if(href_list["collapse"]) + title_collapsed = !title_collapsed + + if(title_collapsed) + SEND_SOUND(src, sound('sound/misc/menu/menu_rollup1.ogg')) + else + SEND_SOUND(src, sound('sound/misc/menu/menu_rolldown1.ogg')) + + else if(href_list["focus"]) + winset(client, "map", "focus=true") + +/mob/dead/new_player/proc/lobby_button_sound() + var/sound/ui_select_sound = sound('sound/misc/menu/ui_select1.ogg') + ui_select_sound.frequency = get_rand_frequency_low_range() + SEND_SOUND(src, ui_select_sound) diff --git a/modular_bandastation/title_screen/code/station_traits.dm b/modular_bandastation/title_screen/code/station_traits.dm new file mode 100644 index 0000000000000..56369eb8ffb15 --- /dev/null +++ b/modular_bandastation/title_screen/code/station_traits.dm @@ -0,0 +1,17 @@ +/datum/station_trait/proc/on_lobby_button_click(mob/dead/new_player/user, button_id) + return // No SCUB and Pet Day + +// STANDARD JOB TRAIT HANDLING +/datum/station_trait/job/on_lobby_button_click(mob/dead/new_player/user, button_id) + if(SSticker.HasRoundStarted()) + to_chat(user, span_redtext("Раунд уже начался!")) + return + + if(LAZYFIND(lobby_candidates, user)) + LAZYREMOVE(lobby_candidates, user) + to_chat(user, span_redtext("Вы были убраны из списка кандидатов на роль [name].")) + SStitle.title_output(user.client, list2params(list("false", button_id)), "job_sign") + else + LAZYADD(lobby_candidates, user) + to_chat(user, span_greentext("Вы были добавлены в список кандидатов на роль [name].")) + SStitle.title_output(user.client, list2params(list("true", button_id)), "job_sign") diff --git a/modular_bandastation/title_screen/code/title_screen_controls.dm b/modular_bandastation/title_screen/code/title_screen_controls.dm new file mode 100644 index 0000000000000..f469a7c028303 --- /dev/null +++ b/modular_bandastation/title_screen/code/title_screen_controls.dm @@ -0,0 +1,75 @@ +/** + * Enables an admin to upload a new titlescreen image. + */ +ADMIN_VERB(change_title_screen, R_FUN, "Title Screen: Change", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_EVENTS) + if(!check_rights(R_FUN)) + return + + switch(tgui_alert(usr, "Что делаем с изображением в лобби?", "Лобби", list("Меняем", "Сбрасываем", "Ничего"))) + if("Меняем") + var/file = input(usr) as icon|null + if(file) + SStitle.set_title_image(file) + + if("Сбрасываем") + SStitle.set_title_image() + + log_admin("[key_name(usr)] is changing the title screen.") + message_admins("[key_name_admin(usr)] is changing the title screen.") + +/** + * Sets a titlescreen notice, a big red text on the main screen. + */ +ADMIN_VERB(change_title_screen_notice, R_FUN, "Title Screen: Set Notice", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_EVENTS) + if(!check_rights(R_FUN)) + return + + var/new_notice = tgui_input_text(usr, "Введи то что должно отображаться в лобби:", "Уведомление в лобби", max_length = 2048) + if(isnull(new_notice)) + return + + var/announce_text + if(new_notice == "") + announce_text = "УВЕДОМЛЕНИЕ В ЛОББИ УДАЛЕНО." + else + announce_text = "УВЕДОМЛЕНИЕ В ЛОББИ ОБНОВЛЕНО: [new_notice]" + + SStitle.set_notice(new_notice) + log_admin("Title Screen: [key_name(usr)] setted the title screen notice, which contains: [new_notice]") + message_admins("Title Screen: [key_name_admin(usr)] setted the title screen notice, which contains: [new_notice]") + + for(var/mob/dead/new_player/new_player as anything in GLOB.new_player_list) + to_chat(new_player, span_boldannounce(announce_text)) + SEND_SOUND(new_player, sound('sound/mobs/humanoids/moth/scream_moth.ogg')) + +/** + * An admin debug command that enables you to change the CSS on the go. + */ +ADMIN_VERB(change_title_screen_css, R_DEBUG, "Title Screen: Set CSS", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_EVENTS) + if(!check_rights(R_DEBUG)) + to_chat(src, span_warning("Недостаточно прав! Необходимы права R_DEBUG.")) + return + + log_admin("Title Screen: [key_name(usr)] is setting the title screen CSS.") + message_admins("Title Screen: [key_name_admin(usr)] is setting the title screen CSS.") + + SStitle.set_title_css() + +/** + * Reloads the titlescreen if it is bugged for someone. + */ +/client/verb/fix_title_screen() + set name = "Fix Lobby Screen" + set desc = "Lobbyscreen broke? Press this." + set category = "Special" + + if(!isnewplayer(src.mob)) + to_chat(src, span_warning("Вы должны быть в лобби дабы использовать это!")) + return + + SStitle.show_title_screen_to(src) + +/client/open_escape_menu() + if(isnewplayer(mob)) + return + . = ..() diff --git a/modular_bandastation/title_screen/code/title_screen_datum.dm b/modular_bandastation/title_screen/code/title_screen_datum.dm new file mode 100644 index 0000000000000..609cc0d36042f --- /dev/null +++ b/modular_bandastation/title_screen/code/title_screen_datum.dm @@ -0,0 +1,275 @@ +/datum/title_screen + /// All title screen styles. + var/title_css = DEFAULT_TITLE_SCREEN_HTML_CSS + /// The current title screen being displayed, as `/datum/asset_cache_item` + var/datum/asset_cache_item/screen_image + +/datum/title_screen/New(styles, screen_image_file) + if(styles) + src.title_css = styles + set_screen_image(screen_image_file) + +/datum/title_screen/proc/set_screen_image(screen_image_file) + if(!screen_image_file) + return + + if(!isfile(screen_image_file)) + screen_image_file = fcopy_rsc(screen_image_file) + + screen_image = SSassets.transport.register_asset("[screen_image_file]", screen_image_file) + +/datum/title_screen/proc/show_to(client/viewer) + if(!viewer) + return + + winset(viewer, "title_browser", "is-disabled=false;is-visible=true") + winset(viewer, "status_bar", "is-visible=false") + + var/datum/asset/lobby_asset = get_asset_datum(/datum/asset/simple/html_title_screen) + var/datum/asset/fontawesome = get_asset_datum(/datum/asset/simple/namespaced/fontawesome) + lobby_asset.send(viewer) + fontawesome.send(viewer) + + SSassets.transport.send_assets(viewer, screen_image.name) + viewer << browse(get_title_html(viewer, viewer.mob), "window=title_browser") + +/datum/title_screen/proc/hide_from(client/viewer) + if(viewer?.mob) + winset(viewer, "title_browser", "is-disabled=true;is-visible=false") + winset(viewer, "status_bar", "is-visible=true;focus=true") + +/datum/title_screen/proc/create_main_button(user, href, text, advanced_classes) + return {" + + [text] + + + "} + +/datum/title_screen/proc/create_icon_button(user, href, tooltip, tooltip_position = "bottom", enabled = TRUE) + return {" + +
+ +
+ + [tooltip ? {" +
+ [tooltip] +
"} : ""] +
+ "} + +/** + * Get the HTML of title screen. + */ +/datum/title_screen/proc/get_title_html(client/viewer, mob/user) + var/screen_image_url = SSassets.transport.get_asset_url(asset_cache_item = screen_image) + var/mob/dead/new_player/player = user + var/list/html = list() + html += {" + + + + Title Screen + + + + + + "} + + if(screen_image_url) + html += {""} + + html += {"
[SStitle.notice]
"} + html += {""} + html += {"
"} + html += {" +
+ + + "} + + html += {"
"} + if(!SSticker || SSticker.current_state <= GAME_STATE_PREGAME) + html += create_main_button(player, "toggle_ready", "ГОТОВ", player.ready == PLAYER_READY_TO_PLAY ? "good" : "bad") + else + html += create_main_button(player, "late_join", "ИГРАТЬ") + + html += create_main_button(player, "observe", "СЛЕДИТЬ") + html += create_main_button(player, "character_setup", "НАСТРОЙКА ПЕРСОНАЖА") + html += {"
[player.client.prefs.read_preference(/datum/preference/name/real_name)]
"} + html += {"
"} + + html += {"
"} + html += create_icon_button(player, "changelog", "Открыть чейнджлог") + html += create_icon_button(player, "settings", "Настройки игры") + html += create_icon_button(player, "manifest", "Манифест персонала") + html += create_icon_button(player, "wiki", "Перейти на вики") + html += {"
"} + + html += {""} + + if(length(GLOB.lobby_station_traits)) + html += {"
"} + + var/number = 0 + for(var/datum/station_trait/job/trait as anything in GLOB.lobby_station_traits) + if(!istype(trait)) + continue // Skip trait if it is not a job + + if(!trait.can_display_lobby_button(player.client)) + continue + + if(number > MAX_STATION_TRAIT_BUTTONS_VERTICAL) // 3 is a maximum + break + + number++ + var/traitID = replacetext(replacetext("[trait.type]", "/datum/station_trait/job/", ""), "/", "-") + var/assigned = LAZYFIND(trait.lobby_candidates, player) + html += {" + +
+ + + +
+ +
+ [trait.name] + [trait.button_desc] +
+
+ "} + + html += {"
"} + + html += {" + + "} + + html += {"
"} + html += {" + + "} + + html += "" + + return html.Join() + +#undef MAX_STATION_TRAIT_BUTTONS_VERTICAL diff --git a/modular_bandastation/title_screen/code/title_screen_pref_middleware.dm b/modular_bandastation/title_screen/code/title_screen_pref_middleware.dm new file mode 100644 index 0000000000000..d3e011033ea06 --- /dev/null +++ b/modular_bandastation/title_screen/code/title_screen_pref_middleware.dm @@ -0,0 +1,20 @@ +// This is purely so that we can cleanly update the name in the "Setup Character" menu entry. +/datum/preference_middleware/titlescreen + +/datum/preference_middleware/titlescreen/on_new_character(mob/user) + // User changed the slot. + if(!istype(user, /mob/dead/new_player)) + return + + SStitle.update_character_name(user, preferences.read_preference(/datum/preference/name/real_name)) + +/datum/preference_middleware/proc/post_set_preference(mob/user, preference, value) + return FALSE + +/datum/preference_middleware/titlescreen/post_set_preference(mob/user, preference, value) + // User changed the current slot's name. + if(!istype(user, /mob/dead/new_player) || preference != "real_name") + return FALSE + + SStitle.update_character_name(user, value) + return TRUE diff --git a/modular_bandastation/title_screen/code/title_screen_subsystem.dm b/modular_bandastation/title_screen/code/title_screen_subsystem.dm new file mode 100644 index 0000000000000..ee224a9d328fc --- /dev/null +++ b/modular_bandastation/title_screen/code/title_screen_subsystem.dm @@ -0,0 +1,180 @@ +/datum/controller/subsystem/title + /// The current notice text, or null. + var/notice + /// Currently set title screen + var/datum/title_screen/current_title_screen + /// The list of image files available to be picked for title screen + var/list/title_images_pool = list() + +/datum/controller/subsystem/title/Initialize() + fill_title_images_pool() + current_title_screen = new(screen_image_file = pick_title_image()) + show_title_screen_to_all_new_players() + return SS_INIT_SUCCESS + +/datum/controller/subsystem/title/Recover() + current_title_screen = SStitle.current_title_screen + title_images_pool = SStitle.title_images_pool + +/** + * Iterates over all files in `TITLE_SCREENS_LOCATION` and loads all valid title screens to `title_screens` var. + */ +/datum/controller/subsystem/title/proc/fill_title_images_pool() + for(var/file_name in flist(TITLE_SCREENS_LOCATION)) + if(validate_filename(file_name)) + var/file_path = "[TITLE_SCREENS_LOCATION][file_name]" + title_images_pool += fcopy_rsc(file_path) + +/** + * Checks wheter passed title is valid + * Currently validates extension and checks whether it's special image like default title screen etc. + */ +/datum/controller/subsystem/title/proc/validate_filename(filename) + var/static/list/title_screens_to_ignore = list("blank.png") + if(filename in title_screens_to_ignore) + return FALSE + + var/static/list/supported_extensions = list("gif", "jpg", "jpeg", "png", "svg") + var/extstart = findlasttext(filename, ".") + if(!extstart) + return FALSE + + var/extension = copytext(filename, extstart + 1) + return (extension in supported_extensions) + +/** + * Show the title screen to all new players. + */ +/datum/controller/subsystem/title/proc/show_title_screen_to_all_new_players() + if(!current_title_screen) + return + + for(var/mob/dead/new_player/viewer as anything in GLOB.new_player_list) + show_title_screen_to(viewer.client) + +/** + * Show the title screen to specific client. + */ +/datum/controller/subsystem/title/proc/show_title_screen_to(client/viewer) + if(!viewer || !current_title_screen) + return + + INVOKE_ASYNC(current_title_screen, TYPE_PROC_REF(/datum/title_screen, show_to), viewer) + + if(check_rights_for(viewer, R_ADMIN|R_DEBUG)) + addtimer(CALLBACK(src, PROC_REF(title_output), viewer, "true", "admin_buttons_visibility"), 1.75 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_CLIENT_TIME) + +/** + * Hide the title screen from specific client. + */ +/datum/controller/subsystem/title/proc/hide_title_screen_from(client/viewer) + if(!viewer || !current_title_screen) + return + + INVOKE_ASYNC(current_title_screen, TYPE_PROC_REF(/datum/title_screen, hide_from), viewer) + +/** + * Call JavaScript function on all clients + */ +/datum/controller/subsystem/title/proc/title_output_to_all(params, function) + if(!current_title_screen) + return + + for(var/mob/dead/new_player/viewer as anything in GLOB.new_player_list) + title_output(viewer.client, params, function) + +/** + * Call JavaScript function for specific client. + */ +/datum/controller/subsystem/title/proc/title_output(client/viewer, params, function) + if(!viewer || !current_title_screen) + return + + viewer << output(params, "title_browser:[function]") + +/** + * Adds a notice to the main title screen in the form of big red text! + */ +/datum/controller/subsystem/title/proc/set_notice(new_notice) + notice = sanitize_text(new_notice) || null + title_output_to_all(notice, "update_notice") + +/** + * Change or reset title screen css + */ +/datum/controller/subsystem/title/proc/set_title_css() + var/action = tgui_alert(usr, "Что делаем?", "Title Screen CSS", list("Меняем", "Сбрасываем", "Ничего")) + switch(action) + if("Меняем") + var/new_css = input(usr, "Загрузи CSS файл со своими стилями.", "РИСКОВАННО: ИЗМЕНЕНИЕ СТИЛЕЙ ЛОББИ") as null|file + if(!new_css) + message_admins("Title Screen: [key_name_admin(usr)] changed mind to change title screen CSS.") + return + + if(copytext("[new_css]",-4) != ".css") + to_chat(usr, span_reallybig("Ты что загрузил, еблуша? Это не CSS!")) + message_admins("Title Screen: [key_name_admin(usr)] загрузил какую-то хуйню вместо CSS.") + return + + if(!current_title_screen) + current_title_screen = new(styles = new_css) + else + current_title_screen.title_css = new_css + if("Сбрасываем") + if(!current_title_screen) + current_title_screen = new(styles = current_title_screen::title_css) + else + current_title_screen.title_css = current_title_screen::title_css + else + return + + show_title_screen_to_all_new_players() + message_admins("Title Screen: [key_name_admin(usr)] has changed the title screen CSS.") + +/** + * Changes title image to desired + */ +/datum/controller/subsystem/title/proc/set_title_image(desired_image_file) + if(desired_image_file) + if(!isfile(desired_image_file)) + CRASH("Not a file passed to `/datum/controller/subsystem/title/proc/set_title_image`") + else + desired_image_file = pick_title_image() + + if(!current_title_screen) + current_title_screen = new(screen_image_file = desired_image_file) + else + current_title_screen.set_screen_image(desired_image_file) + + for(var/mob/dead/new_player/viewer as anything in GLOB.new_player_list) + INVOKE_ASYNC(src, PROC_REF(update_title_image_for_client), viewer.client) + +/** + * Sends title image to client and updates title screen for it + */ +/datum/controller/subsystem/title/proc/update_title_image_for_client(client/update_for) + PRIVATE_PROC(TRUE) + + if(!istype(update_for)) + return + + SSassets.transport.send_assets(update_for, current_title_screen.screen_image.name) + update_for.browse_queue_flush() + title_output(update_for, SSassets.transport.get_asset_url(asset_cache_item = current_title_screen.screen_image), "update_image") + +/** + * Update a user's character setup name. + */ +/datum/controller/subsystem/title/proc/update_character_name(mob/dead/new_player/user, name) + if(!(istype(user))) + return + + title_output(user.client, name, "update_character_name") + +/** + * Picks title image from `title_images_pool` list. If the list is empty, `DEFAULT_TITLE_SCREEN_IMAGE_PATH` is returned + */ +/datum/controller/subsystem/title/proc/pick_title_image() + return length(title_images_pool) ? pick(title_images_pool) : DEFAULT_TITLE_SCREEN_IMAGE_PATH + +#undef TITLE_SCREENS_LOCATION diff --git a/modular_bandastation/title_screen/html/title_screen.css b/modular_bandastation/title_screen/html/title_screen.css new file mode 100644 index 0000000000000..8fd6626a311ac --- /dev/null +++ b/modular_bandastation/title_screen/html/title_screen.css @@ -0,0 +1,540 @@ + +@font-face { + font-family: "Pix Cyrillic"; + src: url("PixCyrillic.ttf"); +} + +/** + * MARK: Animations + */ +@keyframes shutter { + 0% { + transform: translateY(-100%); + } + + 50%, 100% { + transform: translateY(0); + } +} + +@keyframes shutter_reverse { + 0% { + transform: translateY(-100%); + } + + 50%, 100% { + transform: translateY(0); + } +} + +@keyframes shutter_all { + 0%, 50% { + transform: scale(2) translateY(0); + } + + 100% { + transform: scale(2) translateY(-100%); + } +} + +@keyframes shutter_all_reverse { + 0% { + transform: scale(2) translateY(-100%); + } + + 50%, 100% { + transform: scale(2) translateY(0); + } +} + +@keyframes sidebuttons_right { + 0% { + transform: translateX(0); + } + + 25%, 50%, 75%, 100% { + transform: translateX(-125%); + } +} + +@keyframes sidebuttons_right_reverse { + 0%, 25%, 50%, 75% { + transform: translateX(-125%); + z-index: 1; + } + + 100% { + transform: translateX(0); + z-index: 1; + } +} + +@keyframes sidebuttons_left { + 0% { + transform: translateX(0); + } + + 25%, 50%, 75%, 100% { + transform: translateX(125%); + } +} + +@keyframes sidebuttons_left_reverse { + 0%, 25%, 50%, 75% { + transform: translateX(125%); + z-index: 1; + } + + 100% { + transform: translateX(0); + z-index: 1; + } +} + +@keyframes sidebuttons_bottom { + 0%, 25%, 50%, 75% { + transform: translateY(0); + } + + 100% { + transform: translateY(-100%); + } +} + +@keyframes sidebuttons_bottom_reverse { + 0% { + transform: translateY(-100%); + } + + 25%, 50%, 75%, 100% { + transform: translateY(0); + } +} + +@keyframes collapse_button { + 0%, 25%, 50%, 75%, 100% { + visibility: hidden; + } +} + +@keyframes collapse_button_reverse { + 0%, 25%, 50%, 75%, 100% { + visibility: hidden; + } +} + +/** + * MARK: Common + */ +body, +html { + font-family: Pix Cyrillic; + font-size: 15px; + overflow: hidden; + text-align: center; + -ms-user-select: none; + user-select: none; + cursor: default; + position: static; + width: 100%; + height: 100%; + margin: 0; + background-color: black; +} + +img { + pointer-events: none; + border-style: none; +} + +hr { + border: 0; + border-bottom: 0.15em solid rgba(255, 255, 255, 0.1); +} + +input, +.hidden { + display: none !important; + visibility: hidden !important; +} + +*, +*::before, +*::after { + position: relative; + box-sizing: border-box; +} + +.pixelated { + -ms-interpolation-mode: nearest-neighbor; + image-rendering: pixelated; +} + +.bg { + position: absolute; + width: auto; + height: 100vmin; + min-width: 100vmin; + min-height: 100vmin; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 0; +} + +#container_notice { + position: absolute; + box-sizing: border-box; + bottom: 0; + width: 100vw; + font-size: 26px; + padding: 0.5em 0 0.33em; + background-color: rgba(22, 22, 22, 0.85); + color: hsl(345, 100%, 70%); + border-top: 1px solid rgba(255, 255, 255, 0.1); + backdrop-filter: blur(24px); + z-index: 2; +} + +.lobby_wrapper { + display: flex; + justify-content: center; +} + +.lobby_container { + width: 200px; + transform: scale(2); + transform-origin: top; + z-index: 2; +} + +.lobby_background { + z-index: 2; +} + +.lobby_element { + display: inline-flex; +} + +.lobby_shutter { + position: absolute; + top: -5px; + left: 11.5px; + transform: translateY(-100%); + transform-origin: top; + z-index: 4; +} + +.lobby-collapse { + pointer-events: none; + position: absolute; + left: 31.5px; + bottom: -17.5px; + z-index: 1; +} + +#collapse { + pointer-events: all; + cursor: pointer; + width: 19px; + height: 15px; + text-indent: -2px; + transform: translate(3.8px, 53.5px) scale(1.25, 0.75); +} + +/** + * MARK: Positioning + */ +.lobby_buttons-left, +.lobby_buttons-right, +.lobby_buttons-center, +.lobby_buttons-bottom { + position: absolute; + z-index: 3; +} + +.lobby_buttons-left { + left: -3px; + bottom: 12px; +} + +.lobby_buttons-right { + right: -3px; + bottom: 12px; +} + +.lobby_buttons-center { + top: 8px; +} + +.lobby_buttons-bottom { + display: flex; + flex-direction: row-reverse; + bottom: -17.5px; + right: 32.5px; + z-index: 4; +} + +.lobby_buttons-left, +.lobby_buttons-right { + display: flex; + flex-direction: column-reverse; +} + +.lobby_buttons-left .lobby_button, +.lobby_buttons-right .lobby_button { + margin-top: 4px; +} + +.lobby_buttons-left .lobby_button:last-of-type, +.lobby_buttons-right .lobby_button:last-of-type { + margin-top: 0; +} + +.lobby_buttons-bottom .lobby_button { + margin-left: 4px; +} + +.lobby_buttons-bottom .lobby_button:last-of-type { + margin-left: 0; +} + +/** + * MARK: Icon button + */ +.lobby_button.disabled { + pointer-events: none; +} + +.indicator { + opacity: 0; + transform: scaleX(0.25); + transition: transform 0.2s, opacity 0.2s; + z-index: 1; +} + +.trait_active, +.trait_disabled, +.indicator.disabled, +.lobby_button:hover .toggle .indicator { + opacity: 1; + transform: scaleX(1); +} + +.trait_active, +.trait_disabled { + position: absolute; +} + +/** + * MARK: Main buttons + */ +.lobby-toggle_ready .lobby-text { + transform: translateY(5.25px) translateX(2px); +} + +.lobby-late_join .lobby-text { + transform: translateY(6.25px) translateX(3px); +} + +.lobby-toggle_ready.bad .lobby-text::before, +.lobby-toggle_ready.bad .lobby-text::after { + content: 'X'; + display: inline-block; + margin: 0 8px; +} + +.lobby-toggle_ready.good .lobby-text::before, +.lobby-toggle_ready.good .lobby-text::after { + content: '✓'; + display: inline-block; + margin: 0 8px; +} + +.lobby-late_join { + left: -1px; +} + +.lobby-observe, +.lobby-character_setup { + box-shadow: 2.5px 0px 0px rgba(0,0,0,0.33); +} + +/** + * MARK: Character name + */ +.lobby-name { + align-items: center; + vertical-align: middle; + justify-content: center; + top: -1px; + height: 18px; + width: 110px; + z-index: 2; +} + +.lobby-name span { + line-height: 8.5px; + font-size: 10px; + color: #383b43; + text-shadow: 0px -1px 0px #bec4bf; +} + +/** + * MARK: Clickable area + * It's invisible + */ +.toggle, +.lobby-text { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +/** + * MARK: Text + */ +.lobby-text { + pointer-events: none; + color: hsl(150, 100%, 75%); + text-shadow: 0px 0px 3px hsla(185, 100%, 75%, 0.75); + font-size: 11px; + line-height: 1.33em; + letter-spacing: 5.75px; + transform: translateY(2.25px) translateX(3px); + transition: color 0.2s, text-shadow 0.2s; + z-index: 1; +} + +.lobby_element:hover .lobby-text { + color: hsl(50, 100%, 75%); + text-shadow: 0px 0px 3px hsla(25, 100%, 75%, 0.75); +} + +.good .lobby-text { + color: hsl(140, 100%, 70%); + text-shadow: 0px 0px 3px hsla(130, 100%, 60%, 0.75); +} + +.bad .lobby-text { + color: hsl(345, 100%, 70%); + text-shadow: 0px 0px 3px hsla(0, 100%, 60%, 0.75); +} + +/** + * MARK: Tooltip + */ +.lobby_button:hover .lobby-tooltip { + opacity: 1; + transition-delay: 0.75s; +} + +.lobby-tooltip { + opacity: 0; + overflow: hidden; + position: absolute; + pointer-events: none; + min-width: 60px; + max-width: 120px; + line-height: 10px; + text-shadow: 0px -1px 0px #bec4bf; + background-color: #9aa39f; + color: #383b43; + border: 1px solid #51575e; + border-radius: 1px; + box-shadow: 0px 1.5px 0px #20202a; + transition: opacity 0s; +} + +.lobby-tooltip[data-position='right'] { + left: 27.5px; +} + +.lobby-tooltip[data-position='bottom'] { + bottom: -27.5px; + left: 0px; +} + +.lobby-tooltip[data-position='left'] { + left: -123.5px; +} + +.lobby-tooltip-title { + display: block; + font-size: 13px; + line-height: 11px; + padding: 0.15em 0.15em 0.05em; + border-bottom: 1px solid #20202a; + box-shadow: inset 1px -1px 0px #e0e3dc; +} + +.lobby-tooltip-content { + display: block; + font-size: 10px; + line-height: 8.75px; + padding: 0.2em 0.2em 0.1em; + box-shadow: inset 1px -1px 0px #e0e3dc; +} + +/** + * MARK: Checkbox handling + */ +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby-collapse .lobby-text { + animation: collapse_button_reverse 2s; +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container .lobby-collapse .lobby-text { + animation: collapse_button 2s; +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container { + animation: shutter_all 1.5s; + transform: scale(2) translateY(-100%); +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_shutter { + animation: shutter 1.5s; + transform: translateY(-100%); +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container { + animation: shutter_all_reverse 1.5s; +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container .lobby_shutter { + animation: shutter_reverse 1.5s reverse; +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_buttons-left, +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_buttons-right { + z-index: 1; +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_buttons-left{ + animation: 2s sidebuttons_left; + transform: translateX(125%); +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container .lobby_buttons-left{ + animation: 2s sidebuttons_left_reverse; +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_buttons-right { + animation: 2s sidebuttons_right; + transform: translateX(-125%); +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container .lobby_buttons-right { + animation: 2s sidebuttons_right_reverse; +} + +#hide_menu:checked ~ .lobby_wrapper .lobby_container .lobby_buttons-bottom { + animation: 2s sidebuttons_bottom; + transform: translateY(-100%); +} + +#hide_menu:not(:checked) ~ .lobby_wrapper .lobby_container .lobby_buttons-bottom { + animation: 0.5s sidebuttons_bottom_reverse; +} diff --git a/modular_bandastation/title_screen/icons/default.png b/modular_bandastation/title_screen/icons/default.png new file mode 100644 index 0000000000000..49e7d70a6ddde Binary files /dev/null and b/modular_bandastation/title_screen/icons/default.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_active.png b/modular_bandastation/title_screen/icons/lobby_active.png new file mode 100644 index 0000000000000..6de3fbf900d8f Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_active.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_background.png b/modular_bandastation/title_screen/icons/lobby_background.png new file mode 100644 index 0000000000000..3ced0bda763b0 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_background.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_bridge_assistant.png b/modular_bandastation/title_screen/icons/lobby_bridge_assistant.png new file mode 100644 index 0000000000000..b7d1571d68d65 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_bridge_assistant.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_cargorilla.png b/modular_bandastation/title_screen/icons/lobby_cargorilla.png new file mode 100644 index 0000000000000..ef8193e83cee8 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_cargorilla.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_changelog.png b/modular_bandastation/title_screen/icons/lobby_changelog.png new file mode 100644 index 0000000000000..359dc630bdc5d Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_changelog.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_character_setup.png b/modular_bandastation/title_screen/icons/lobby_character_setup.png new file mode 100644 index 0000000000000..1b9d3978511c7 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_character_setup.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_collapse.png b/modular_bandastation/title_screen/icons/lobby_collapse.png new file mode 100644 index 0000000000000..ca31216cc7829 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_collapse.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_css.png b/modular_bandastation/title_screen/icons/lobby_css.png new file mode 100644 index 0000000000000..e7ef18fae262a Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_css.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_disabled.png b/modular_bandastation/title_screen/icons/lobby_disabled.png new file mode 100644 index 0000000000000..92d7a64b93652 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_disabled.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_highlight.png b/modular_bandastation/title_screen/icons/lobby_highlight.png new file mode 100644 index 0000000000000..9fb5da6c555ee Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_highlight.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_human_ai.png b/modular_bandastation/title_screen/icons/lobby_human_ai.png new file mode 100644 index 0000000000000..3ed39a9caee28 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_human_ai.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_late_join.png b/modular_bandastation/title_screen/icons/lobby_late_join.png new file mode 100644 index 0000000000000..1befb07340a93 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_late_join.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_manifest.png b/modular_bandastation/title_screen/icons/lobby_manifest.png new file mode 100644 index 0000000000000..54f8ec63df1ad Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_manifest.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_notice.png b/modular_bandastation/title_screen/icons/lobby_notice.png new file mode 100644 index 0000000000000..5ccfe14383cd2 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_notice.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_observe.png b/modular_bandastation/title_screen/icons/lobby_observe.png new file mode 100644 index 0000000000000..6c9f30aa2604f Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_observe.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_picture.png b/modular_bandastation/title_screen/icons/lobby_picture.png new file mode 100644 index 0000000000000..866bc1f97751f Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_picture.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_pun_pun.png b/modular_bandastation/title_screen/icons/lobby_pun_pun.png new file mode 100644 index 0000000000000..c3321ebe89187 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_pun_pun.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_settings.png b/modular_bandastation/title_screen/icons/lobby_settings.png new file mode 100644 index 0000000000000..a25e3f31d8876 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_settings.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_shutter.png b/modular_bandastation/title_screen/icons/lobby_shutter.png new file mode 100644 index 0000000000000..d0e8e7eeaf300 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_shutter.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_toggle_ready.png b/modular_bandastation/title_screen/icons/lobby_toggle_ready.png new file mode 100644 index 0000000000000..db1e6d113abc3 Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_toggle_ready.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_veteran_advisor.png b/modular_bandastation/title_screen/icons/lobby_veteran_advisor.png new file mode 100644 index 0000000000000..97ea1d3881c6e Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_veteran_advisor.png differ diff --git a/modular_bandastation/title_screen/icons/lobby_wiki.png b/modular_bandastation/title_screen/icons/lobby_wiki.png new file mode 100644 index 0000000000000..f672b5e3e18cd Binary files /dev/null and b/modular_bandastation/title_screen/icons/lobby_wiki.png differ diff --git a/tgstation.dme b/tgstation.dme index 35d1d5cb738d6..8fa36ea742eb2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6513,5 +6513,7 @@ #include "interface\fonts\spess_font.dm" #include "interface\fonts\tiny_unicode.dm" #include "interface\fonts\vcr_osd_mono.dm" -#include "modular_bandastation\modular_bandastation.dme" // BANDASTATION EDIT // END_INCLUDE + +// BANDASTATION +#include "modular_bandastation\modular_bandastation.dme"