Prevents Lore News Pop-up On Every Connect

This commit is contained in:
Cerebulon
2021-08-11 02:00:09 +01:00
parent beaa3051ff
commit 3e735591b6
5 changed files with 15 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
/datum/category_item/player_setup_item/player_global/settings/load_preferences(var/savefile/S)
S["lastchangelog"] >> pref.lastchangelog
S["lastnews"] >> pref.lastnews
S["lastlorenews"] >> pref.lastlorenews
S["default_slot"] >> pref.default_slot
S["preferences"] >> pref.preferences_enabled
S["preferences_disabled"] >> pref.preferences_disabled
@@ -16,6 +17,7 @@
/datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S)
S["lastchangelog"] << pref.lastchangelog
S["lastnews"] << pref.lastnews
S["lastlorenews"] << pref.lastlorenews
S["default_slot"] << pref.default_slot
S["preferences"] << pref.preferences_enabled
S["preferences_disabled"] << pref.preferences_disabled

View File

@@ -139,6 +139,7 @@ var/list/preferences_datums = list()
var/datum/browser/panel
var/lastnews // Hash of last seen lobby news content.
var/lastlorenews //ID of last seen lore news article.
var/examine_text_mode = 0 // Just examine text, include usage (description_info), switch to examine panel.
var/multilingual_mode = 0 // Default behaviour, delimiter-key-space, delimiter-key-delimiter, off

View File

@@ -112,6 +112,8 @@
/datum/lore/codex/page/about_news,
)
var/newsindex = "103" //Update with number of latest article
/datum/lore/codex/page/about_news
name = "About the Publisher"
data = "The <i>Daedalus Pocket Newscaster</i> is produced and maintained by Occulum Broadcast, the foremost authority on media distribution \

View File

@@ -76,8 +76,13 @@
output += "</div>"
if (client.prefs.lastlorenews == GLOB.news_data.newsindex)
client.seen_news = 1
if(GLOB.news_data.station_newspaper && !client.seen_news)
show_latest_news(GLOB.news_data.station_newspaper)
client.prefs.lastnews = GLOB.news_data.newsindex
SScharacter_setup.queue_preferences_save(client.prefs)
panel = new(src, "Welcome","Welcome", 500, 480, src)
panel.set_window_options("can_close=0")

View File

@@ -7,6 +7,7 @@ GLOBAL_DATUM_INIT(news_data, /datum/lore/news, new)
/datum/lore/news
var/datum/feed_channel/station_newspaper
var/datum/lore/codex/category/main_news/news_codex = new()
var/newsindex
/datum/lore/news/New()
..()
@@ -17,6 +18,10 @@ GLOBAL_DATUM_INIT(news_data, /datum/lore/news, new)
break
spawn(300) // Yes, again.
fill_codex_news()
if (!news_codex.newsindex)
return
else
newsindex = news_codex.newsindex
/datum/lore/news/proc/fill_codex_news()
if(!news_network)