Merge pull request #437 from TheFurryFeline/TFF-Commlink_Manifest

Communicators with Manifest
This commit is contained in:
Vollybally
2019-02-23 17:53:35 -05:00
committed by GitHub
7 changed files with 147 additions and 142 deletions
@@ -655,6 +655,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
ui = new(user, src, ui_key, "pda.tmpl", title, 520, 400, state = inventory_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
ui.add_template("crewManifest", "crew_manifest.tmpl") //TFF Port from VOREStation
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
@@ -13,8 +13,7 @@
var/im_contacts_ui[0] //List of communicators that have been messaged.
var/im_list_ui[0] //List of messages.
var/weather[0]
var/injection = null
// var/weather[0] //Unneeded variable since there's no weather at all!
var/modules_ui[0] //Home screen info.
//First we add other 'local' communicators.
@@ -68,7 +67,7 @@
for(var/I in im_list)
im_list_ui[++im_list_ui.len] = list("address" = I["address"], "to_address" = I["to_address"], "im" = I["im"])
//Weather reports.
/*//Weather reports.
if(planet_controller)
for(var/datum/planet/planet in planet_controller.planets)
if(planet.weather_holder && planet.weather_holder.current_weather)
@@ -80,9 +79,11 @@
"High" = planet.weather_holder.current_weather.temp_high - T0C,
"Low" = planet.weather_holder.current_weather.temp_low - T0C)
weather[++weather.len] = W
injection = "<div>Test</div>"
*/ //No planets with an atmosphere, doofus!
// Update manifest
data_core.get_manifest_list()
//Modules for homescreen.
for(var/list/R in modules)
modules_ui[++modules_ui.len] = R
@@ -107,19 +108,22 @@
data["ring"] = ringer
data["homeScreen"] = modules_ui
data["note"] = note // current notes
data["weather"] = weather
//data["weather"] = weather //Unneeded portion: no planets with an atmosphere that HAS weather!
data["aircontents"] = src.analyze_air()
data["flashlight"] = fon
data["injection"] = injection
data["manifest"] = PDA_Manifest
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
data["currentTab"] = 1 // Reset the current tab, because we're going to home page //TFF VOREStation port
ui = new(user, src, ui_key, "communicator.tmpl", "Communicator", 475, 700, state = key_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
// TheFurryFeline: Adds Manifest listing
ui.add_template("crewManifest","crew_manifest.tmpl")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
@@ -244,6 +248,14 @@
else
note = ""
notehtml = note
if(href_list["switch_template"])
var/datum/nanoui/ui = nanomanager.get_open_ui(usr, src, "main")
if(ui)
switch(href_list["switch_template"])
if("1")
ui.reinitialise("communicator.tmpl")
if("2")
ui.reinitialise("comm2.tmpl")
if(href_list["Light"])
fon = !fon
@@ -4,6 +4,16 @@
var/global/list/obj/item/device/communicator/all_communicators = list()
// List of core tabs the communicator can switch to //TFF Port from VOREStation
#define HOMETAB 1
#define PHONTAB 2
#define CONTTAB 3
#define MESSTAB 4
#define NOTETAB 5
#define ATMSTAB 6
#define MANITAB 7
#define SETTTAB 8
/obj/item/device/communicator
name = "communicator"
desc = "A personal device used to enable long range dialog between two people, utilizing existing telecommunications infrastructure to allow \
@@ -36,15 +46,16 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
var/flum = 2 // Brightness
var/list/modules = list(
list("module" = "Phone", "icon" = "phone64", "number" = 2),
list("module" = "Contacts", "icon" = "person64", "number" = 3),
list("module" = "Messaging", "icon" = "comment64", "number" = 4),
list("module" = "Note", "icon" = "note64", "number" = 5),
list("module" = "Weather", "icon" = "sun64", "number" = 6),
list("module" = "Settings", "icon" = "gear64", "number" = 7)
list("module" = "Phone", "icon" = "phone64", "number" = PHONTAB),
list("module" = "Contacts", "icon" = "person64", "number" = CONTTAB),
list("module" = "Messaging", "icon" = "comment64", "number" = MESSTAB),
list("module" = "Note", "icon" = "note64", "number" = NOTETAB),
list("module" = "Atmos", "icon" = "sun64", "number" = ATMSTAB),
list("module" = "Crew Manifest", "icon" = "note64", "number" = MANITAB), // Need a different icon, //TFF Port from VOREStation
list("module" = "Settings", "icon" = "gear64", "number" = SETTTAB),
) //list("module" = "Name of Module", "icon" = "icon name64", "number" = "what tab is the module")
var/selected_tab = 1
var/selected_tab = HOMETAB
var/owner = ""
var/occupation = ""
var/alert_called = 0
@@ -221,9 +232,6 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
if(video_source)
watch_video(user)
/obj/item/device/communicator/AltClick(mob/user) //Chomp edit.
attack_self(user) //wow big skill
// Proc: MouseDrop()
//Same thing PDAs do
/obj/item/device/communicator/MouseDrop(obj/over_object as obj)
+77 -104
View File
@@ -3,20 +3,6 @@ Title: Communicator UI
Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
-->
<div class="statusDisplayComm">
<div class="item">
<div class="itemContent" style="width: 100%; text-align: center;">
<span class="average">{{:data.time}} | </span>
{{if data.connectionStatus == 1}}
<img class='uiIcon16 icon-signal-green' style='float: none; vertical-align: top'></img>
{{else}}
<img class='uiIcon16 icon-alert-red' style='float: none; vertical-align: top'></img>
{{/if}}
<span class="average"> | {{:data.owner}} | {{:data.occupation}}</span>
</div>
</div>
</div>
{{if data.currentTab == 1}}
<div class='homeContainer'>
@@ -32,11 +18,10 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{else data.currentTab == 2}}
<h3>Manual Dial</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="item">
<div class="itemLabelWide">
Target EPv2 Address:
@@ -82,47 +67,51 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
</div>
</div>
</div>
<HR>
<h3>Connection Management</h3>
<HR>
<h3>External Connections</h3>
{{for data.voice_mobs}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
<div class="itemContent">
<div style="float: left; width: 200px;">{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}</div>
</div>
{{for data.voice_mobs}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
{{/for}}
<div class="itemContent">
<div style="float: left; width: 200px;">{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}</div>
</div>
</div>
{{/for}}
<h3>Internal Connections</h3>
{{for data.communicating}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
<div class="itemContent">
{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}
{{if data.video_comm == null}}
{{:helper.link('Start Video', 'signal-diag', {'startvideo' : value.ref})}}
{{else data.video_comm == value.ref}}
{{:helper.link('End Video', 'signal-diag', {'endvideo' : value.true_name}, null, 'redButton')}}
{{/if}}
</div>
{{for data.communicating}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
{{/for}}
<div class="itemContent">
{{:helper.link('Disconnect', 'close', {'disconnect' : value.true_name}, null, 'redButton')}}
{{if data.video_comm == null}}
{{:helper.link('Start Video', 'signal-diag', {'startvideo' : value.ref})}}
{{else data.video_comm == value.ref}}
{{:helper.link('End Video', 'signal-diag', {'endvideo' : value.true_name}, null, 'redButton')}}
{{/if}}
</div>
</div>
{{/for}}
<h3>Requests Received</h3>
{{for data.requestsReceived}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
<div class="itemContent">
<div style="float: left; width: 300px;">{{:value.address}}</div> {{:helper.link('Accept', 'signal-diag', {'dial' : value.address})}}{{:helper.link('Decline', 'close', {'decline' : value.ref})}}
</div>
{{for data.requestsReceived}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
{{/for}}
<div class="itemContent">
<div style="float: left; width: 300px;">{{:value.address}}</div> {{:helper.link('Accept', 'signal-diag', {'dial' : value.address})}}{{:helper.link('Decline', 'close', {'decline' : value.ref})}}
</div>
</div>
{{/for}}
<h3>Invites Sent</h3>
{{for data.invitesSent}}
@@ -142,33 +131,33 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{else data.currentTab == 3}}
<h3>Known Devices</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
{{for data.knownDevices}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
<div class="itemContent">
<div style="float: left; width: 100%;">{{:value.address}}</div>
{{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}}
{{:helper.link('Call', 'phone', {'dial' : value.address, 'copy' : value.address, 'switch_tab' : 2})}}
{{:helper.link('Msg', 'mail-closed', {'copy' : value.address, 'copy_name' : value.name, 'switch_tab' : 40})}}
</div>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
{{for data.knownDevices}}
<div class='item'>
<div class="itemLabel">
{{:value.name}}
</div>
{{/for}}
<div class="itemContent">
<div style="float: left; width: 100%;">{{:value.address}}</div>
{{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}}
{{:helper.link('Call', 'phone', {'dial' : value.address, 'copy' : value.address, 'switch_tab' : 2})}}
{{:helper.link('Msg', 'mail-closed', {'copy' : value.address, 'copy_name' : value.name, 'switch_tab' : 40})}}
</div>
</div>
{{/for}}
<!-- Fourth Tab, Messaging -->
{{else data.currentTab == 4}}
<h3>Messaging</h3>
<HR>
<div class="itemContent" style="width: 100%; margin-bottom: 5px;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="itemContent" style="width: 100%; margin-bottom: 5px;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
{{for data.imContacts}}
<div class='item' style="margin-top: 5px;">
<div class="itemGroup" style="float: left;">
@@ -184,10 +173,10 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{else data.currentTab == 40}}
<h3>Conversation With: {{:data.targetAddressName}}</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Back', 'arrowreturnthick-1-w', {'switch_tab' : 4})}}</div><BR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class='statusDisplay' style='overflow: auto; float: left; width: 95%;'>
<div class='item' style='width: 100%;'>
<div class='itemLabel' style='width: 100%;'>
@@ -212,9 +201,9 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
{{else data.currentTab == 5}}
<h3>Note Keeper</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="item">
<div class="itemLabel">
@@ -234,43 +223,28 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
</div>
</div>
<!-- Sixth Tab, Weather -->
<!-- Sixth Tab, Atmos -->
{{else data.currentTab == 6}}
<h3>Weather</h3>
<h3>Atmospheric Readings</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<h4>Current Conditions:</h4>
{{#def.atmosphericScan}}
<h4>Weather Reports:</h4>
{{for data.weather}}
<div class="item">
<div class="itemLabel">
{{:value.Planet}}:
</div>
<div class="itemContent">
Time: {{:value.Time}}<BR>
Weather: {{:value.Weather}}, {{:helper.fixed(value.Temperature)}}&deg;C<BR>
High: {{:helper.fixed(value.High)}}&deg;C | Low: {{:helper.fixed(value.Low)}}&deg;C
</div>
</div>
{{empty}}
<div class="item">
<div class="itemLabel">
Error
</div>
<div class="itemContent">
No weather reports available. Please try again later.
</div>
</div>
{{/for}}
<!-- Seventh Tab, Settings -->
<!-- Seventh Tab, Crew Manifest -->
{{else data.currentTab == 7}}
{{#def.crewManifest}}
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<!-- Eighth Tab, Settings -->
{{else data.currentTab == 8}}
<h3>Settings</h3>
@@ -337,13 +311,12 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm
<div style="float: left; width: 180px;">{{:helper.link(data.flashlight==1 ? 'Disable Flashlight' : 'Enable Flashlight', 'lightbulb', {'Light' : 1}, null,'fixedLeftWide')}}</div>
</div>
</div>
<!-- Eighth Tab, External Device -->
<!-- Eighth Tab, External Device -->
{{else data.currentTab == 8}}
{{else data.currentTab == 8}}
{{/if}}
{{/if}}
+3 -2
View File
@@ -1,5 +1,7 @@
<!-- pAI manifest
<!-- Crew manifest
code/modules/mob/living/silicon/pai/software_modules.dm
code/game/objects/items/devices/communicator/UI.dm
code/game/objects/items/devices/PDA/PDA.dm
Copy-pasted from pda.tmpl
-->
@@ -7,7 +9,6 @@ Copy-pasted from pda.tmpl
<h3>Crew Manifest</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="item">
<center><table class="pmon"><tbody>
+27
View File
@@ -0,0 +1,27 @@
<!-- pAI manifest
code/modules/mob/living/silicon/pai/software_modules.dm
Copy-pasted from pda.tmpl
-->
<h3>Crew Manifest</h3>
<HR>
<div class="itemContent" style="width: 100%;">{{:helper.link('Home', 'home', {'switch_tab' : 1})}}</div><BR>
<div class="item">
<center><table class="pmon"><tbody>
{{for data.manifest}}
{{if value.elems.length}}
<tr><th colspan="3" class={{:value.cat}}>{{:value.cat}}</th></tr>
{{for value.elems :itemValue:itemIndex}}
<tr>
<td><span class="average">{{:itemValue.name}}</span></td>
<td><span class="average">{{:itemValue.rank}}</span></td>
<td><span class="average">{{:itemValue.active}}</span></td>
</tr>
{{/for}}
{{/if}}
{{/for}}
</tbody></table></center>
</div>
+1 -18
View File
@@ -295,24 +295,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{else data.mode== 41}} <!-- Manifest uses cached data so we only use nanowriter when shit changes.-->
<div class="item">
<center><table class="pmon"><tbody>
{{for data.manifest}}
{{if value.elems.length}}
<tr><th colspan="3" class={{:value.cat}}>{{:value.cat}}</th></tr>
{{for value.elems :itemValue:itemIndex}}
<tr>
<td><span class="average">{{:itemValue.name}}</span></td>
<td><span class="average">{{:itemValue.rank}}</span></td>
<td><span class="average">{{:itemValue.active}}</span></td>
</tr>
{{/for}}
{{/if}}
{{/for}}
</tbody></table></center>
</div>
{{#def.crewManifest}}
{{else data.mode == 3}}