The new NanoUI PDA will now update automatically, eliminating the need for a Refresh button.

When a user sends or recieves a Message using a PDA, the UI (if open) will now update instantly to show the sent/received message (this uses the new nanomanager.update_user_uis proc).
This commit is contained in:
Mark Aherne (Faerdan)
2014-01-04 02:12:18 +00:00
parent fa085705ab
commit c1ed93cf29
2 changed files with 5 additions and 1 deletions

View File

@@ -485,6 +485,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
// When the UI is first opened this is the data it will use
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
else
// The UI is already open so push the new data to it
ui.push_data(data)
@@ -882,6 +883,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(L)
L << "\icon[P] <b>Message from [src.owner] ([ownjob]), </b>\"[t]\" (<a href='byond://?src=\ref[P];choice=Message;skiprefresh=1;target=\ref[src]'>Reply</a>)"
nanomanager.update_user_uis(L, P) // Update the recieving user's PDA UI so that they can see the new message
nanomanager.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message
log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]")
P.overlays.Cut()

View File

@@ -9,7 +9,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
<b>Functions</b>:
</div>
<div class="itemContent">
{^{:~link('Refresh', 'refresh', {'choice' : "Refresh"}, null, 'fixedLeft')}}
<!--{^{:~link('Refresh', 'refresh', {'choice' : "Refresh"}, null, 'fixedLeft')}}-->
{^{:~link('Close', 'gear', {'choice' : "Close"}, null, 'fixedLeft')}}
{^{if idInserted}} {^{:~link('Update PDA Info', 'eject', {'choice' : "UpdateInfo"}, null, 'fixedLeftWide')}} {{/if}}
{^{if mode != 0}} {^{:~link('Return', 'arrowreturn-1-w', {'choice' : "Return"}, null, 'fixedLeft')}} {{/if}}