This commit is contained in:
FalseIncarnate
2016-12-29 21:13:00 -05:00
841 changed files with 33426 additions and 30013 deletions
+17 -17
View File
@@ -99,7 +99,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if((!istype(over_object, /obj/screen)) && can_use())
return attack_self(M)
/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state)
ui_tick++
var/datum/nanoui/old_ui = nanomanager.get_open_ui(user, src, "main")
var/auto_update = 1
@@ -115,8 +115,22 @@ var/global/list/obj/item/device/pda/PDAs = list()
var/title = "Personal Data Assistant"
var/data[0] // This is the data that will be sent to the PDA
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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
ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600, state = state)
ui.set_state_key("pda")
// open the new ui window
ui.open()
// auto update every Master Controller tick
ui.set_auto_update(auto_update)
/obj/item/device/pda/ui_data(mob/user, datum/topic_state/state = inventory_state)
var/data[0]
data["owner"] = owner // Who is your daddy...
data["ownjob"] = ownjob // ...and what does he do?
@@ -164,21 +178,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
"template" = current_app.template,
"has_back" = current_app.has_back)
// 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
ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600, state = inventory_state)
ui.set_state_key("pda")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
// auto update every Master Controller tick
ui.set_auto_update(auto_update)
return data
/obj/item/device/pda/attack_self(mob/user as mob)
user.set_machine(src)
+2 -2
View File
@@ -44,9 +44,9 @@
var/HTML = "<html><head><title>AI PDA Message Log</title></head><body>"
for(var/index in M.tnote)
if(index["sent"])
HTML += addtext("<i><b>&rarr; To <a href='byond://?src=\ref[src];choice=Message;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
HTML += addtext("<i><b>&rarr; To <a href='byond://?src=[UID()];choice=Message;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
else
HTML += addtext("<i><b>&larr; From <a href='byond://?src=\ref[src];choice=Message;target=",index["target"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
HTML += addtext("<i><b>&larr; From <a href='byond://?src=[UID()];choice=Message;target=",index["target"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
HTML +="</body></html>"
usr << browse(HTML, "window=log;size=400x444;border=1;can_resize=1;can_close=1;can_minimize=0")
+2 -2
View File
@@ -30,7 +30,7 @@ var/list/chatrooms = list(new /datum/chatroom("General Discussion"))
for(var/datum/data/pda/app/chatroom/u in users)
spawn()
if(u.messaging_available() && !u.toff && user != u)
u.notify("<b>Post from [username] in #[name], </b>\"[message]\" (<a href='?src=\ref[u];choice=Post;target=\ref[src]'>Post</a>)")
u.notify("<b>Post from [username] in #[name], </b>\"[message]\" (<a href='?src=[u.UID()];choice=Post;target=\ref[src]'>Post</a>)")
/datum/chatroom/proc/announce(user, message)
post(user, "<span class='average'>[message]</span>", announcer)
@@ -221,7 +221,7 @@ var/list/chatrooms = list(new /datum/chatroom("General Discussion"))
current_room.invites |= C
spawn()
if(C.messaging_available() && !C.toff)
C.notify("<b>Invite to #[current_room]</b> (<a href='?src=\ref[C];choice=Join;room=\ref[current_room]'>Join</a>)")
C.notify("<b>Invite to #[current_room]</b> (<a href='?src=[C.UID()];choice=Join;room=\ref[current_room]'>Join</a>)")
if("New Room")
if(channels_created >= max_channels_created)
alert("This PDA has already reached its maximum channels created.", name)
+1 -1
View File
@@ -179,7 +179,7 @@
PM.conversations.Add("\ref[pda]")
nanomanager.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message
PM.notify("<b>Message from [pda.owner] ([pda.ownjob]), </b>\"[t]\" (<a href='?src=\ref[PM];choice=Message;target=\ref[pda]'>Reply</a>)")
PM.notify("<b>Message from [pda.owner] ([pda.ownjob]), </b>\"[t]\" (<a href='?src=[PM.UID()];choice=Message;target=\ref[pda]'>Reply</a>)")
log_pda("[usr] (PDA: [src.name]) sent \"[t]\" to [P.name]")
else
to_chat(U, "<span class='notice'>ERROR: Messaging server is not responding.</span>")