mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 00:53:23 +01:00
@@ -59,7 +59,7 @@
|
||||
var/screen // Which screen our main window displays
|
||||
var/subscreen // Which specific function of the main screen is being displayed
|
||||
|
||||
var/obj/item/device/pda/ai/pai/pda = null
|
||||
var/obj/item/device/pda/pai/pda = null
|
||||
|
||||
var/secHUD = 0 // Toggles whether the Security HUD is active or not
|
||||
var/medHUD = 0 // Toggles whether the Medical HUD is active or not
|
||||
@@ -110,6 +110,8 @@
|
||||
pda.name = pda.owner + " (" + pda.ownjob + ")"
|
||||
var/datum/data/pda/app/messenger/M = pda.find_program(/datum/data/pda/app/messenger)
|
||||
M.toff = 1
|
||||
var/datum/data/pda/app/chatroom/C = pda.find_program(/datum/data/pda/app/chatroom)
|
||||
C.toff = 1
|
||||
..()
|
||||
|
||||
/mob/living/silicon/pai/Login()
|
||||
|
||||
@@ -222,6 +222,123 @@
|
||||
M.create_message(P, target, 1)
|
||||
return 1
|
||||
|
||||
/datum/pai_software/chatroom
|
||||
name = "Digital Chatroom"
|
||||
ram_cost = 5
|
||||
id = "chatroom"
|
||||
toggle = 0
|
||||
|
||||
on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1)
|
||||
var/data[0]
|
||||
|
||||
if(!user.pda)
|
||||
return
|
||||
var/datum/data/pda/app/chatroom/M = user.pda.find_program(/datum/data/pda/app/chatroom)
|
||||
if(!M)
|
||||
return
|
||||
|
||||
data["receiver_off"] = M.toff
|
||||
data["ringer_off"] = M.notify_silent
|
||||
|
||||
var/list/rooms[0]
|
||||
for(var/datum/chatroom/c in chatrooms)
|
||||
if((M in c.users) || (M in c.invites) || c.is_public)
|
||||
rooms += list(list(name = "[c]", ref = "\ref[c]"))
|
||||
data["rooms"] = rooms
|
||||
|
||||
if(M.disconnected || !M.messaging_available(1))
|
||||
data["disconnected"] = 1
|
||||
else if(M.current_room)
|
||||
data["current_room"] = "\ref[M.current_room]"
|
||||
data["current_room_name"] = M.current_room.name
|
||||
data["current_room_topic"] = M.current_room.topic
|
||||
data["messages"] = M.current_room.logs
|
||||
var/list/users[0]
|
||||
for(var/U in M.current_room.users)
|
||||
var/datum/data/pda/app/chatroom/ch = U
|
||||
users += "<span class='good'>[ch.pda.owner]</span>"
|
||||
for(var/U in (M.current_room.invites - M.current_room.users))
|
||||
var/datum/data/pda/app/chatroom/ch = U
|
||||
users += "<span class='average'>[ch.pda.owner]</span>"
|
||||
data["users"] = users
|
||||
|
||||
ui = nanomanager.try_update_ui(user, user, id, ui, data, force_open)
|
||||
if(!ui)
|
||||
// Don't copy-paste this unless you're making a pAI software module!
|
||||
ui = new(user, user, id, "pai_chatroom.tmpl", "Digital Chatroom", 450, 600)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
Topic(href, href_list)
|
||||
var/mob/living/silicon/pai/P = usr
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
if(!isnull(P.pda) && P.pda.can_use())
|
||||
var/datum/data/pda/app/chatroom/M = P.pda.find_program(/datum/data/pda/app/chatroom)
|
||||
if(!M)
|
||||
return
|
||||
|
||||
if(href_list["toggler"])
|
||||
M.toff = href_list["toggler"] != "1"
|
||||
return 1
|
||||
else if(href_list["ringer"])
|
||||
M.notify_silent = href_list["ringer"] != "1"
|
||||
return 1
|
||||
else if(href_list["topic"])
|
||||
if(!M.current_room)
|
||||
return 1
|
||||
|
||||
var/t = input("Enter new topic:", M.current_room, M.current_room.topic) as text|null
|
||||
spawn()
|
||||
if(!t || !M.check_messaging_available() || !P.pda.can_use())
|
||||
return
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = readd_quotes(t)
|
||||
if (!t)
|
||||
return
|
||||
|
||||
M.current_room.topic = t
|
||||
M.current_room.announce(M, "Topic has been changed to '[t]' by [P.pda.owner].")
|
||||
return 1
|
||||
else if(href_list["select"])
|
||||
var/s = href_list["select"]
|
||||
if(s == "*NONE*")
|
||||
M.current_room = null
|
||||
else
|
||||
var/datum/chatroom/CR = locate(s)
|
||||
if(istype(CR))
|
||||
if(!(M in CR.users))
|
||||
if(!CR.login(M))
|
||||
return
|
||||
M.current_room = CR
|
||||
return 1
|
||||
else if(href_list["target"])
|
||||
if(P.silence_time)
|
||||
return alert("Communications circuits remain uninitialized.")
|
||||
|
||||
var/datum/chatroom/target = locate(href_list["target"])
|
||||
if(istype(target))
|
||||
if(!(M in target.users))
|
||||
if(!target.login(M))
|
||||
return
|
||||
var/t = input("Please enter message", target) as text|null
|
||||
spawn()
|
||||
if(!t || !M.check_messaging_available())
|
||||
return
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = readd_quotes(t)
|
||||
if (!t || !P.pda.can_use())
|
||||
return
|
||||
|
||||
target.post(M, t)
|
||||
return 1
|
||||
else if(href_list["reconnect"])
|
||||
spawn()
|
||||
M.messaging_available()
|
||||
return 1
|
||||
|
||||
/datum/pai_software/med_records
|
||||
name = "Medical Records"
|
||||
ram_cost = 15
|
||||
|
||||
+10
-2
@@ -85,5 +85,13 @@
|
||||
playsound(loc, 'sound/items/bikehorn.ogg', 30, 1)
|
||||
return
|
||||
|
||||
/obj/item/device/pda/ai/pai
|
||||
ttone = "assist"
|
||||
/obj/item/device/pda/pai
|
||||
icon_state = "NONE"
|
||||
detonate = 0
|
||||
ttone = "assist"
|
||||
|
||||
/obj/item/device/pda/pai/can_use()
|
||||
var/mob/living/silicon/pai/pAI = usr
|
||||
if(!istype(pAI))
|
||||
return 0
|
||||
return ..() && !pAI.silence_time
|
||||
Reference in New Issue
Block a user