NTIRC Communicators (#11658)

This commit is contained in:
Geeves
2021-04-28 16:56:16 +02:00
committed by GitHub
parent 044fb79497
commit 1dd5b25354
7 changed files with 41 additions and 10 deletions
+3 -5
View File
@@ -305,11 +305,9 @@ proc/get_radio_key_from_channel(var/channel)
INVOKE_ASYNC(GLOBAL_PROC, /proc/animate_speechbubble, speech_bubble, hear_clients, 30)
do_animate_chat(message, speaking, italics, hear_clients, 30)
for(var/o in listening_obj)
var/obj/O = o
spawn(0)
if(O) //It's possible that it could be deleted in the meantime.
O.hear_talk(src, message, verb, speaking)
for(var/obj/O as anything in listening_obj)
if(O) //It's possible that it could be deleted in the meantime.
INVOKE_ASYNC(O, /obj/.proc/hear_talk, src, message, verb, speaking)
if(mind)
mind.last_words = message
@@ -125,6 +125,8 @@ var/global/ntnrc_uid = 0
/datum/ntnet_conversation/proc/cl_leave(var/datum/computer_file/program/chat_client/Cl)
if(!istype(Cl) || !istype(Cl.my_user) || !(Cl.my_user in users) || !can_interact(Cl) || direct)
return
if(Cl.focused_conv == src)
Cl.focused_conv = null
var/datum/ntnet_message/leave/msg = new(Cl)
Cl.my_user.channels.Remove(src)
users.Remove(Cl.my_user)
@@ -102,6 +102,7 @@
for(var/obj/item/computer_hardware/CH in src.get_all_components())
uninstall_component(null, CH)
qdel(CH)
listening_objects -= src
STOP_PROCESSING(SSprocessing, src)
QDEL_NULL(listener)
return ..()
@@ -319,3 +319,11 @@
/obj/item/modular_computer/GetID()
if(card_slot)
return card_slot.stored_card
/obj/item/modular_computer/hear_talk(mob/M, text, verb, datum/language/speaking)
if(Adjacent(M))
var/datum/computer_file/program/chat_client/P = hard_drive.find_file_by_name("ntnrc_client")
if(!P || (P.program_state == PROGRAM_STATE_KILLED && P.service_state == PROGRAM_STATE_KILLED))
return
if(P.focused_conv)
P.focused_conv.cl_send(P, text, M)
@@ -13,6 +13,8 @@
silent = FALSE
var/datum/ntnet_user/my_user
var/datum/ntnet_conversation/focused_conv
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
var/set_offline = FALSE // appear "invisible"
@@ -62,6 +64,19 @@
if(ishuman(user))
user.visible_message("[SPAN_BOLD("\The [user]")] taps on [user.get_pronoun("his")] [computer.lexical_name]'s screen.")
conv.cl_send(src, message, user)
if(href_list["focus"])
var/mob/living/user = usr
var/datum/ntnet_conversation/conv = locate(href_list["focus"])
if(istype(conv))
if(ishuman(user))
user.visible_message("[SPAN_BOLD("\The [user]")] taps on [user.get_pronoun("his")] [computer.lexical_name]'s screen.")
if(focused_conv == conv)
focused_conv = null
listening_objects -= computer
else
focused_conv = conv
listening_objects |= computer
SSvueui.check_uis_for_change(src)
if(href_list["join"])
var/datum/ntnet_conversation/conv = locate(href_list["join"]["target"])
var/password = href_list["join"]["password"]
@@ -121,8 +136,7 @@
if(ishuman(user))
user.visible_message("[SPAN_BOLD("\The [user]")] taps on [user.get_pronoun("his")] [computer.lexical_name]'s screen.")
conv.cl_send(src, message, user)
/datum/computer_file/program/chat_client/service_activate()
. = ..()
if(istype(my_user) && get_signal(NTNET_COMMUNICATION))
@@ -220,7 +234,8 @@
"direct" = Channel.direct,
"password" = !!Channel.password,
"can_interact" = can_interact,
"can_manage" = can_manage
"can_manage" = can_manage,
"focused" = focused_conv == Channel ? TRUE : FALSE
)
if(can_interact)
data["channels"][ref]["msg"] = Channel.messages
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Added Speech-To-Text to the NTIRC program. Simply open the desired chat, enable Speech-To-Text, and chat away. You can even close the program, as long as the chat service remains running. Only one chat can have an active STT at a time, and you have to be at least adjacent to the device."
@@ -18,6 +18,7 @@
<vui-button v-else-if="!channel.direct" @click="title = channel.title">Change title</vui-button>
<vui-button :params="{delete: reference}" @click="$emit('on-leave')">Delete channel</vui-button>
</template>
<vui-button :class="{'selected': channel.focused == true}" :params="{focus: reference}">{{ channel.focused == true ? "Disable Speech-To-Text" : "Enable Speech-To-Text" }}</vui-button>
</div>
<div>
<div v-for="(user, uref) in channel.users" :key="uref">
@@ -57,8 +58,8 @@ export default {
props: {
reference: {
type: String,
default: "",
},
default: ""
}
},
methods: {
send_msg() {