Adds Starcaster

-Adds the starcaster, a device for reading the news.
-Adds starcaster as a free loadout item
-Comments out sleepy sergal articles, adds starfire articles
This commit is contained in:
Darlantan
2020-06-08 07:28:15 -04:00
parent 474c1fa712
commit 5e776cdc0b
5 changed files with 135 additions and 2 deletions

View File

@@ -0,0 +1,75 @@
/datum/category_item/catalogue/information/starfire_news
desc = "A small news reporting agency based near Sif's New Reykjavik, the Starfire Report is somewhat infamous \
for scrutinizing the actions of Trans-Stellar Corporations in the Vir system yet coming out on top in the legal \
battles with inevitably follow. Aside from reporting, the agency is also known for inventing and manufacturing the \
starcaster, a cheap device capable of accessing news articles from almost anywhere in the galaxy without need for \
a stable exonet connection."
value = CATALOGUER_REWARD_TRIVIAL
/obj/item/device/starcaster_news
name = "\improper Starcaster"
desc = "A device from the Starfire Report for reading the news and nothing else."
icon = 'icons/obj/library.dmi'
icon_state = "newscodex-open"
// catalogue_data = list(/datum/category_item/catalogue/information/starfire_news) Commented out until I can figure out why this won't scan.
var/datum/computer_file/data/news_article/loaded_article = null //You must specify the variable this far to avoid compilation errors.
var/show_archived = null
/obj/item/device/starcaster_news/attack_self(mob/user as mob)
user.set_machine(src)
ui_interact(user) //Activates nanoUI. Fuck nanoUI.
return
/obj/item/device/starcaster_news/Topic(href, href_list) //Mostly ripped off from news_browser.dm
if(..())
return 1
if(href_list["PRG_openarticle"])
. = 1
if(loaded_article)
return 1
for(var/datum/computer_file/data/news_article/N in ntnet_global.available_news)
if(N.uid == text2num(href_list["PRG_openarticle"]))
loaded_article = N.clone()
break
if(href_list["PRG_reset"])
. = 1
loaded_article = null
if(href_list["PRG_toggle_archived"]) //Fuck nanoUI
. = 1
show_archived = !show_archived
if(.)
SSnanoui.update_uis(src)
/obj/item/device/starcaster_news/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) //Also ripped from news_browser.dm. Fuck nanoUI
var/obj/item/device/starcaster_news/PRG = src //If you're trying to understand this shit go to nano/templates/starcaster_ch.tmpl
var/list/data = list()
if(PRG.loaded_article) // Viewing an article.
data["title"] = PRG.loaded_article.filename
data["cover"] = PRG.loaded_article.cover
data["article"] = PRG.loaded_article.stored_data
else // Viewing list of articles
var/list/all_articles[0]
for(var/datum/computer_file/data/news_article/F in ntnet_global.available_news)
if(!PRG.show_archived && F.archived)
continue
all_articles.Add(list(list(
"name" = F.filename,
"uid" = F.uid,
"archived" = F.archived
)))
data["all_articles"] = all_articles
data["showing_archived"] = PRG.show_archived
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "starcaster_ch.tmpl", "Starcaster News Browser", 575, 750)
ui.auto_update_layout = 1
ui.set_initial_data(data)
ui.open()

View File

@@ -0,0 +1,5 @@
/datum/gear/utility/news_ch
display_name = "starcaster"
path = /obj/item/device/starcaster_news
cost = 0

View File

@@ -23,7 +23,7 @@
server_file_path = 'news_articles/space_magazine_1.html'
*/
/* CHOMPedit: commenting out YW articles because they don't make sense here and adding our own.
//YAWN ADDS - All from discord
/datum/computer_file/data/news_article/archives/vol_gwa_one
filename = "Galaxy Wide Archives"
@@ -37,4 +37,10 @@
/datum/computer_file/data/news_article/tss/vol_two
filename = "The Sleepy Sergal vol. 2"
server_file_path = 'news_articles/the_sleepy_sergal_2.html'
server_file_path = 'news_articles/the_sleepy_sergal_2.html'
*/
/datum/computer_file/data/news_article/starfire/year_2564
filename = "Starfire Report: Year 2564"
server_file_path = 'news_articles/starfire_report_2564.html'
//End CHOMPedit

View File

@@ -0,0 +1,45 @@
<!--
Interface for the starcaster news device.
See: code/game/objects/items/devices/starcaster_ch.dm
-->
<link href="spacemag.css" rel="stylesheet" type="text/css">
{{if data.article}}
Viewing: {{:data.title}}<br>
{{:helper.link('CLOSE', null, { "PRG_reset" : 1 })}}
<br><br>
{{if data.cover}}
<img src='{{:data.cover}}' class="cover" />
{{/if}}
{{:data.article}}
{{else}}
<h3>Listing available files</h3>
<div class='item'>
<div class='itemLabel'>
Show archived files:
</div>
<div class='itemContent'>
{{if data.showing_archived}}
{{:helper.link('YES', null, { "PRG_toggle_archived" : 1 })}}
{{else}}
{{:helper.link('NO', null, { "PRG_toggle_archived" : 1 })}}
{{/if}}
</div>
</div>
<br><hr>
{{for data.all_articles}}
<div class='item'>
<div class='itemLabel'>
Name:
</div>
<div class='itemContent'>
{{:value.name}}
</div>
<div class='itemLabel'>
Actions:
</div>
<div class='itemContent'>
{{:helper.link('OPEN', null, { "PRG_openarticle" : value.uid })}}
</div>
</div>
{{/for}}
{{/if}}

View File

@@ -1165,6 +1165,7 @@
#include "code\game\objects\items\devices\scanners.dm"
#include "code\game\objects\items\devices\scanners_vr.dm"
#include "code\game\objects\items\devices\spy_bug.dm"
#include "code\game\objects\items\devices\starcaster_ch.dm"
#include "code\game\objects\items\devices\suit_cooling.dm"
#include "code\game\objects\items\devices\t_scanner.dm"
#include "code\game\objects\items\devices\taperecorder.dm"
@@ -1856,6 +1857,7 @@
#include "code\modules\client\preference_setup\loadout\loadout_uniform_vr.dm"
#include "code\modules\client\preference_setup\loadout\loadout_uniform_yw.dm"
#include "code\modules\client\preference_setup\loadout\loadout_utility.dm"
#include "code\modules\client\preference_setup\loadout\loadout_utility_ch.dm"
#include "code\modules\client\preference_setup\loadout\loadout_utility_vr.dm"
#include "code\modules\client\preference_setup\loadout\loadout_vr.dm"
#include "code\modules\client\preference_setup\loadout\loadout_xeno.dm"