Skip to content

Commit

Permalink
Add some buttons to title screen for admins
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Aug 10, 2024
1 parent 7c6dabe commit e6039fb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
6 changes: 6 additions & 0 deletions modular_ss220/title_screen/code/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
else if(href_list["game_preferences"])
client.setup_character()

else if(href_list["change_picture"])
client.admin_change_title_screen()

else if(href_list["leave_notice"])
client.change_title_screen_notice()

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

Expand Down
24 changes: 13 additions & 11 deletions modular_ss220/title_screen/code/title_screen_controls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
log_admin("[key_name(usr)] is changing the title screen.")
message_admins("[key_name_admin(usr)] is changing the title screen.")

switch(alert(usr, "Please select a new title screen.", "Title Screen", "Change", "Reset", "Cancel"))
if("Change")
switch(tgui_alert(usr, "Что делаем с изображением в лобби?", "Лобби", list("Меняем", "Сбрасываем", "Ничего")))
if("Меняем")
var/file = input(usr) as icon|null
if(!file)
return

SStitle.set_title_image(file)
if("Reset")
if("Сбрасываем")
SStitle.set_title_image()
if("Cancel")
if("Ничего")
return

/**
Expand All @@ -36,12 +36,13 @@
log_admin("[key_name(usr)] is setting the title screen notice.")
message_admins("[key_name_admin(usr)] is setting the title screen notice.")

var/new_notice = input(usr, "Please input a notice to be displayed on the title screen:", "Titlescreen Notice") as text|null
SStitle.set_notice(new_notice)
if(!new_notice)
var/new_notice = tgui_input_text(usr, "Введи то что должно отображаться в лобби:", "Уведомление в лобби")
if(isnull(new_notice))
return

SStitle.set_notice(new_notice)
for(var/mob/new_player/new_player in GLOB.player_list)
to_chat(new_player, span_boldannounce("TITLE NOTICE UPDATED: [new_notice]"))
to_chat(new_player, span_boldannounce("УВЕДОМЛЕНИЕ В ЛОББИ ОБНОВЛЕНО: [new_notice]"))
SEND_SOUND(new_player, sound('sound/items/bikehorn.ogg'))

/**
Expand Down Expand Up @@ -70,11 +71,12 @@
log_admin("[key_name(usr)] is setting the title screen HTML.")
message_admins("[key_name_admin(usr)] is setting the title screen HTML.")

var/new_html = input(usr, "Please enter your desired HTML(WARNING: YOU WILL BREAK SHIT)", "DANGER: TITLE HTML EDIT") as message|null
var/new_html = tgui_input_text(usr, "Введи нужный HTML (ВНИМАНИЕ: ТЫ СКОРЕЕ ВСЕГО ЧТО-ТО СЛОМАЕШЬ!!!)", "РИСКОВАННО: ИЗМЕНЕНИЕ HTML ЛОББИ", max_length = 99999, multiline = TRUE, encode = FALSE)
if(isnull(new_html))
return

if(!new_html)
if(tgui_alert(usr, "Всё ли верно? Нигде не ошибся? Возврата нет!", "Ты подумай...", list("Рискнём", "Пожалуй нет...")) != "Рискнём")
return

SStitle.set_title_html(new_html)

message_admins("[key_name_admin(usr)] has changed the title screen HTML.")
13 changes: 12 additions & 1 deletion modular_ss220/title_screen/code/title_screen_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,20 @@
<a class="menu_button" href='byond://?src=[player.UID()];show_preferences=1'>Настройка персонажа</a>
<a class="menu_button" href='byond://?src=[player.UID()];game_preferences=1'>Настройки игры</a>
<hr>
"}

if(check_rights_client(R_EVENT, FALSE, viewer))
html += {"
<a class="menu_button admin" href='byond://?src=[player.UID()];change_picture=1'>Изменить изображение</a>
<a class="menu_button admin" href='byond://?src=[player.UID()];leave_notice=1'>Оставить уведомление</a>
<hr>
"}

html += {"
<a class="menu_button" href='byond://?src=[player.UID()];swap_server=1'>Сменить сервер</a>
</div>
"}
html += {"</div>"}

html += {"
<div class="container_links">
<a class="link_button" href='byond://?src=[player.UID()];wiki=1'><i class="fab fa-wikipedia-w"></i></a>
Expand Down
8 changes: 8 additions & 0 deletions modular_ss220/title_screen/html/title_screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@
background-color: #d93f3f;
}

.admin:hover {
color: #f5b52b;
}

.admin::before {
background-color: #f2a918;
}

.container_links {
display: flex;
}
Expand Down

0 comments on commit e6039fb

Please sign in to comment.