Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Lobby Screen #1424

Merged
merged 21 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/controllers/subsystem/SSticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ SUBSYSTEM_DEF(ticker)

for(var/mob/new_player/N in GLOB.mob_list)
if(N.client)
N.new_player_panel_proc()
/* N.new_player_panel_proc() */ SStitle.show_title_screen_to(N.client) // SS220 REPLACEMENT - TITLE SCREEN
AyIong marked this conversation as resolved.
Show resolved Hide resolved

SSnightshift.check_nightshift(TRUE)

Expand Down
124 changes: 124 additions & 0 deletions config/example/title_screen.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<html>
<head>
<title>Lobby Screen</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="v4shim.css">
<link rel="stylesheet" type="text/css" href="font-awesome.css">
<style type='text/css'>
@font-face {
font-family: "Fixedsys";
src: url("FixedsysExcelsior3.01Regular.ttf");
}
/**
* There is all existing classes for the titles screen
* If you want to customise default styles, you can use
* default html from html folder
*/
body,
html {
font-family: Verdana, Geneva, sans-serif;
font-size: 1.2vw;
overflow: hidden;
text-align: center;
-ms-user-select: none;
user-select: none;
cursor: default;
margin: 0;
background-color: black;
}

img {
pointer-events: none;
border-style: none;
}

/* Divider */
hr {}

/* FontAwesome icon additional styles */
i {}

/* Hide checkbox */
input {
display: none;
}

/* Background image, better not change */
.bg {
position: absolute;
width: auto;
height: 100vmin;
min-width: 100vmin;
min-height: 100vmin;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 0;
}

/* Admin notice container */
.container_notice {}

/* What will be done if you click hide button */
#hide_menu:checked ~ .container_notice {}

/* Admin notice itself */
.menu_notice {}

/* Main container for buttons, logo, etc */
.container_menu {}

/* What will be done if you click hide button */
#hide_menu:checked ~ .container_menu {}

/* Logo container */
.container_logo {}

/* Logo itself */
.logo {}

/* Current character name and welcome text */
.character_info {}

/* Welcome text */
.character:first-of-type {}

/* Current character name */
.character {}

/* Buttons container */
.container_buttons {}

/* Menu button */
.menu_button {}

/* Class added to a button if player Ready or have enabled antags */
.good {}

/* Class added to a button if player Not Ready or have disabled antags */
.bad {}

/* Container for extra buttons, like a wiki, discord etc. */
.container_links {}

/* Extra button itself */
.link_button {}

/* Icon inside the button */
.link_button i {}

/* Hide button, makes checkbox checked */
.hide_button {}

/* Icon inside the button */
.hide_button i {}

/* What will be with the hide button if checked*/
#hide_menu:checked ~ .hide_button {}

/* What will be with icon inside if button is checked */
#hide_menu:checked ~ .hide_button i {}
</style>
</head>
<body>
Binary file added icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ window "paramapwindow"
saved-params = "icon-size;zoom-mode"
zoom-mode = "distort"
style = ".center { text-align: center; } .maptext { font-family: 'MS Serif'; font-size: 7px; -dm-text-outline: 1px black; color: white; line-height: 1.1; } .small { font-family: 'Small Fonts'; font-size: 6px; } .big { font-size: 8px; } .reallybig { font-size: 8px; } .extremelybig { font-size: 8px; } .clown { color: #FF69Bf;} .tajaran {color: #803B56;} .skrell {color: #00CED1;} .solcom {color: #22228B;} .com_srus {color: #7c4848;} .zombie\t{color: #7c4848;} .soghun {color: #228B22;} .vox {color: #AA00AA;} .diona {color: #804000; font-weight: bold;} .trinary {color: #727272;} .kidan {color: #664205;} .slime {color: #0077AA;} .moth{color: #869b29;} .drask {color: #a3d4eb;} .vulpkanin {color: #B97A57;} .abductor {color: #800080;} .his_grace { color: #15D512; } .hypnophrase { color: #0d0d0d; font-weight: bold; } .yell { font-weight: bold; } .italics { font-family: 'Small Fonts'; }"
on-show = ".winset \"menu.statusbar.is-checked=true?paramapwindow.status_bar.is-visible=true:paramapwindow.status_bar.is-visible=false\""
elem "title_browser"
type = BROWSER
pos = 0,0
Expand Down
9 changes: 9 additions & 0 deletions modular_ss220/credits/_credits.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
#include "code\aprils_fool_credits.dm"

#include "_credits.dm"
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
// END_INCLUDE
AyIong marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 3 additions & 2 deletions modular_ss220/title_screen/_title_screen.dme
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "_title_screen.dm"

#include "code/_title_screen_defines.dm"
#include "code/asset_lobby.dm"
#include "code/dead.dm"
#include "code/living.dm"
#include "code/asset_lobby.dm"
#include "code/title_screen_datum.dm"
#include "code/new_player.dm"
#include "code/title_screen_configuration.dm"
#include "code/title_screen_controls.dm"
#include "code/title_screen_datum.dm"
#include "code/title_screen_subsystem.dm"
71 changes: 4 additions & 67 deletions modular_ss220/title_screen/code/_title_screen_defines.dm
Original file line number Diff line number Diff line change
@@ -1,68 +1,5 @@
#define DEFAULT_TITLE_SCREEN_IMAGE_PATH 'modular_ss220/title_screen/icons/default.gif'
#define DEFAULT_TITLE_SCREEN_IMAGE_PATH 'modular_ss220/title_screen/icons/default.jpg'
#define DEFAULT_TITLE_SCREEN_HTML_PATH 'modular_ss220/title_screen/html/title_screen.html'

#define DEFAULT_TITLE_HTML {"
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type='text/css'>
@font-face {
font-family: "Fixedsys";
src: url("FixedsysExcelsior3.01Regular.ttf");
}
body,
html {
margin: 0;
overflow: hidden;
text-align: center;
background-color: black;
padding-top: 5vmin;
-ms-user-select: none;
cursor: default;
}

img {
border-style:none;
}

.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;
width: auto;
padding-top: 1vmin;
top: calc(50% - 10vmin);
left:50%;
transform: translate(-50%, -50%);
z-index: 1;
}

.menu_notice {
display: inline-block;
font-family: "Fixedsys";
font-weight: lighter;
text-decoration: none;
width: 100%;
text-align: left;
color: red;
text-shadow: 1px 0px black, -1px 0px black, 0px 1px black, 0px -1px black, 2px 0px black, -2px 0px black, 0px 2px black, 0px -2px black;
margin-right: 0%;
margin-top: 0px;
font-size: 3vmin;
line-height: 2vmin;
}
</style>
</head>
<body>
"}
#define TITLE_SCREENS_LOCATION "config/title_screens/images"
#define TITLE_SCREEN_HTML "config/title_screen.html"
5 changes: 3 additions & 2 deletions modular_ss220/title_screen/code/asset_lobby.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/datum/asset/simple/lobby_fonts
/datum/asset/simple/lobby
assets = list(
"FixedsysExcelsior3.01Regular.ttf" = 'modular_ss220/title_screen/html/browser/FixedsysExcelsior3.01Regular.ttf',
"FixedsysExcelsior3.01Regular.ttf" = 'modular_ss220/title_screen/html/FixedsysExcelsior3.01Regular.ttf',
"logo.png" = 'icons/logo.png',
)
71 changes: 71 additions & 0 deletions modular_ss220/title_screen/code/new_player.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
/mob/new_player/Login()
. = ..()
SStitle.show_title_screen_to(client)

/mob/new_player/new_player_panel_proc()
return

/mob/new_player/Topic(href, href_list[])
AyIong marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
var/mob/new_player/user = usr
var/client/client = user.client

if(href_list["ready"])
client << output(ready, "title_browser:ready")

if(href_list["skip_antag"])
client << output(client.skip_antag, "title_browser:skip_antag")

if(href_list["game_preferences"])
client.setup_character()

if(href_list["swap_server"])
swap_server()

if(href_list["wiki"])
if(tgui_alert(usr, "Хотите открыть нашу вики?", "Вики", list("Да", "Нет")) != "Да")
return
client << link("https://wiki.ss220.club")

if(href_list["discord"])
if(tgui_alert(usr, "Хотите перейти в наш дискорд сервер?", "Дискорд", list("Да", "Нет")) != "Да")
return
client << link("https://discord.gg/ss220")

if(href_list["changelog"])
SSchangelog.OpenChangelog(client)
AyIong marked this conversation as resolved.
Show resolved Hide resolved

/mob/new_player/proc/swap_server()
var/list/servers = GLOB.configuration.ss220_misc.cross_server_list
if(LAZYLEN(servers) < 1)
return
AyIong marked this conversation as resolved.
Show resolved Hide resolved

var/server_name
var/server_ip
if(LAZYLEN(servers) > 1)
server_name = tgui_input_list(src, "Пожалуйста, выберите сервер куда собираетесь отправиться...", "Смена сервера!", servers)
if(!server_name)
return
server_ip = servers[server_name]

if(LAZYLEN(servers) == 1)
server_name = servers[1]
server_ip = servers[server_name]
AyIong marked this conversation as resolved.
Show resolved Hide resolved

var/confirm = tgui_alert(src, "Вы уверены что хотите перейти на [server_name] ([server_ip])?", "Смена сервера!", list("Поехали", "Побуду тут..."))
if(confirm != "Поехали")
return

to_chat_immediate(src, "Удачной охоты, сталкер.")
src.client << link(server_ip)
AyIong marked this conversation as resolved.
Show resolved Hide resolved

/datum/preferences/process_link(mob/user, list/href_list)
. = ..()
if(href_list["task"] == "random" && href_list["preference"] == "name")
user.client << output(active_character.real_name, "title_browser:update_current_character")
return TRUE

if(href_list["task"] == "input" && href_list["preference"] == "name")
user.client << output(active_character.real_name, "title_browser:update_current_character")
return TRUE

if(href_list["preference"] == "changeslot")
user.client << output(active_character.real_name, "title_browser:update_current_character")
return TRUE
AyIong marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions modular_ss220/title_screen/code/title_screen_configuration.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/datum/configuration_section/ss220_misc_configuration
/// Server list. Name + IP
var/list/cross_server_list = list()

/datum/configuration_section/ss220_misc_configuration/load_data(list/data)
. = ..()
// Load server list data
if(islist(data["cross_server_list"]))
cross_server_list.Cut()
for(var/list/server in data["cross_server_list"])
AyIong marked this conversation as resolved.
Show resolved Hide resolved
cross_server_list["[server["name"]]"] = server["ip"]
Loading
Loading