forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move title screens to assets, move
Fix Lobby Screen
verb …
…to `Special Verbs` category (#947) ## Что этот PR делает Рефактор способа доставки лобби картинок пользователю с использованием `datum/asset`. ## Почему это хорошо для игры Должно исправить проблему, когда картинку в лобби пытается отобразить до того, как она будет получена пользователем. ## Тестирование Протестировали с другим игрком, картинка отобразилась нормально. Следующий этап тестирования уже на лайв серверах. ## Changelog :cl: tweak: `Fix Lobby Screen` в стат панельке был перенесен в категорию `Special Verbs` fix: Картинка лобби скрина теперь должна подгружаться без проблем и черный экран вместо неё не должен отображаться /:cl:
- Loading branch information
Showing
12 changed files
with
190 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/datum/asset/simple/lobby_fonts | ||
assets = list( | ||
"FixedsysExcelsior3.01Regular.ttf" = 'modular_ss220/title_screen/html/browser/FixedsysExcelsior3.01Regular.ttf', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/mob/dead/Login() | ||
. = ..() | ||
hide_title_screen() | ||
SStitle.hide_title_screen_from(client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/mob/living/Login() | ||
. = ..() | ||
hide_title_screen() | ||
SStitle.hide_title_screen_from(client) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/mob/new_player/Login() | ||
. = ..() | ||
show_title_screen() | ||
SStitle.show_title_screen_to(client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/datum/title_screen | ||
/// The preamble html that includes all styling and layout. | ||
var/title_html = DEFAULT_TITLE_HTML | ||
/// The current notice text, or null. | ||
var/notice | ||
/// The current title screen being displayed, as `/datum/asset_cache_item` | ||
var/datum/asset_cache_item/screen_image | ||
|
||
/datum/title_screen/New(title_html = DEFAULT_TITLE_HTML, notice, screen_image_file) | ||
src.title_html = title_html | ||
src.notice = notice | ||
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=true;is-visible=true") | ||
winset(viewer, "status_bar", "is-visible=false") | ||
|
||
var/datum/asset/lobby_asset = get_asset_datum(/datum/asset/simple/lobby_fonts) | ||
lobby_asset.send(viewer) | ||
|
||
SSassets.transport.send_assets(viewer, screen_image.name) | ||
|
||
viewer << browse(get_title_html(), "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") | ||
|
||
/** | ||
* Get the HTML of title screen. | ||
*/ | ||
/datum/title_screen/proc/get_title_html() | ||
var/list/html = list(title_html) | ||
|
||
var/screen_image_url = SSassets.transport.get_asset_url(asset_cache_item = screen_image) | ||
if(screen_image_url) | ||
html += {"<img src="[screen_image_url]" class="bg" alt="">"} | ||
|
||
if(notice) | ||
html += {" | ||
<div class="container_notice"> | ||
<p class="menu_notice">[notice]</p> | ||
</div> | ||
"} | ||
|
||
html += "</body></html>" | ||
|
||
return html.Join() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.