diff --git a/code/modules/admin/admin_verb_lists_vr.dm b/code/modules/admin/admin_verb_lists_vr.dm index 8bbe7f8294..50c734f043 100644 --- a/code/modules/admin/admin_verb_lists_vr.dm +++ b/code/modules/admin/admin_verb_lists_vr.dm @@ -174,7 +174,8 @@ var/list/admin_verbs_fun = list( /client/proc/narrate_mob, //VOREStation Add /client/proc/narrate_mob_args, //VOREStation Add /client/proc/getPlayerStatus, //VORESTation Add - /client/proc/manage_event_triggers + /client/proc/manage_event_triggers, + /client/proc/fake_pdaconvos ) diff --git a/code/modules/admin/view_variables/helpers.dm b/code/modules/admin/view_variables/helpers.dm index a678271e88..9ee161b0dc 100644 --- a/code/modules/admin/view_variables/helpers.dm +++ b/code/modules/admin/view_variables/helpers.dm @@ -86,6 +86,11 @@ "} +/obj/item/device/pda/get_view_variables_options() + return ..() + {" + + "} + /datum/proc/get_variables() . = vars - VV_hidden() if(!usr || !check_rights(R_ADMIN|R_DEBUG, FALSE)) diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index 8a3f8811c2..09e15f7162 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -274,6 +274,15 @@ return log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") message_admins("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") + else if(href_list["fakepdapropconvo"]) + if(!check_rights(R_FUN)) return + + var/obj/item/device/pda/P = locate(href_list["fakepdapropconvo"]) + if(!istype(P)) + to_chat(usr, span_warning("This can only be done to instances of type /pda")) + return + + P.createPropFakeConversation_admin(usr) else if(href_list["rotatedatum"]) if(!check_rights(0)) return diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index fa78e8d29a..e112fd13f4 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -47,6 +47,7 @@ var/last_message_count = 0 var/ircreplyamount = 0 var/entity_narrate_holder //Holds /datum/entity_narrate when using the relevant admin verbs. + var/fakeConversations //Holds fake PDA conversations for event set-up ///////// //OTHER// diff --git a/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm b/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm new file mode 100644 index 0000000000..e6ff399c01 --- /dev/null +++ b/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm @@ -0,0 +1,95 @@ +/datum/eventkit/fake_pdaconvos + var/list/names = list() //Assoc list of refs in fakeRefs = name + var/list/fakeRefs = list() //Used to find elements in other lists and tracking conversations. MUST BE UNIQUE. + var/list/fakeJobs = list() //Assoc list of name in names = job + + +/client/proc/fake_pdaconvos() + set category = "EventKit" + set name = "Manage PDA identities" + set desc = "Creates fake identities for use in setting up PDA props" + + if(!check_rights(R_FUN)) + return + + var/choice = tgui_input_list(usr, "What do you wish to do?", "Options", + list("Add new identity", "Edit existing identity", "Delete existing identity", "Delete holder", "Cancel")) + + if(choice == "Delete holder") + qdel(fakeConversations) + fakeConversations = null + return + if(choice == "Cancel") + return + + if(!fakeConversations || !istype(fakeConversations, /datum/eventkit/fake_pdaconvos)) + fakeConversations = new /datum/eventkit/fake_pdaconvos + + var/datum/eventkit/fake_pdaconvos/FPC = fakeConversations + + if(choice == "Add new identity") + var/newRef = sanitize(tgui_input_text(usr, "Input unique reference. Duplicates are FORBIDDEN!. Players can't see this.\ + Used to uniquely identify conversations in PDAs", null)) + if(!newRef) return + FPC.fakeRefs.Add(newRef) + FPC.names[newRef] = sanitize(tgui_input_text(usr, "Input fake name",newRef)) + FPC.fakeJobs[newRef] = sanitize(tgui_input_text(usr, "Input fake assignment.",newRef)) + to_chat(usr, span_notice("You have created [newRef]. Current name: [FPC.names[newRef]]. Current assignment: [FPC.fakeJobs[newRef]]")) + return + + if(choice == "Edit existing identity") + var/ref = tgui_input_list(usr, "Pick which identity to edit (details are printed to chat)", "identities", FPC.fakeRefs) + to_chat(usr, span_notice("You are editing [ref]. Current name: [FPC.names[ref]]. Current assignment: [FPC.fakeJobs[ref]]")) + var/editChoice = tgui_alert(usr, "What do you wish to edit?", "Details", list("Name", "Job", "Cancel")) + if(editChoice == "Name") + FPC.names[ref] = sanitize(tgui_input_text(usr, "Input fake name", FPC.names[ref])) + to_chat(usr, span_notice("Current data for [ref] are : Current name: [FPC.names[ref]]. Current assignment: [FPC.fakeJobs[ref]]")) + if(editChoice == "Job") + FPC.fakeJobs[ref] = sanitize(tgui_input_text(usr, "Input fake name", FPC.fakeJobs[ref])) + to_chat(usr, span_notice("Current data for [ref] are : Current name: [FPC.names[ref]]. Current assignment: [FPC.fakeJobs[ref]]")) + return + if(choice == "Delete existing identity") + var/ref = tgui_input_list(usr, "Pick which identity to delete (details are printed to chat)", "identities", FPC.fakeRefs) + if(tgui_alert(usr, "You are deleting [ref]. Current name: [FPC.names[ref]]. Current assignment: [FPC.fakeJobs[ref]]", + "are you sure?", list("Yes", "No"))=="Yes") + FPC.fakeRefs =- ref + FPC.fakeJobs =- ref + FPC.names =- ref + return + + + +/* +Invoked by vv topic "fakepdapropconvo" in code\modules\admin\view_variables\topic.dm found in PDA vv dropdown. +*/ +/obj/item/device/pda/proc/createPropFakeConversation_admin(mob/M) + if(!M.client || !check_rights_for(M.client,R_FUN)) + return + + var/datum/eventkit/fake_pdaconvos/FPC = M.client.fakeConversations + + if(!FPC || !istype(FPC, /datum/eventkit/fake_pdaconvos)) + to_chat(M, span_warning("First you must create a new identity with Manage PDA identities in EventKit")) + return + + var/choice = tgui_alert(M,"Use TGUI or dialogue boxes?", "TGUI?", list("TGUI", "Dialogue", "Cancel")) + if(choice == "Cancel") return + + var/datum/data/pda/app/messenger/ourPDA = find_program(/datum/data/pda/app/messenger) + + if(choice == "Dialogue") + var/identity = tgui_input_list(M, "Pick which identity to use(details are printed to chat)", "identities", FPC.fakeRefs) + var/job = FPC.fakeJobs[identity] + var/name = FPC.names[identity] + to_chat(M, span_notice("You are using [identity]. Current name: [name]. Current assignment: [job]")) + var/safetyLimit = 0 + while(safetyLimit < 30) + safetyLimit += 1 + var/message = sanitize(tgui_input_text(M, "Input fake message. Leave empty to cancel. Can create up to 30 messages in a row",null), + MAX_MESSAGE_LEN) + if(!message) return + var/receipent = ((tgui_alert(M, "Received or Sent?", "Direction", list("Received", "Sent"))=="Sent") ? 1 : 0) + ourPDA.createFakeMessage(name,identity,job,receipent, message) + + if(choice == "TGUI") + to_chat(M, span_notice("Sorry, the TGUI functionality is not yet implemented - use Dialogue mode!")) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 73e0944a65..829fc9a431 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -12,6 +12,7 @@ var/m_hidden = 0 // Is the PDA hidden from the PDA list? var/active_conversation = null // New variable that allows us to only view a single conversation. var/list/conversations = list() // For keeping up with who we have PDA messsages from. + var/list/fakepdas = list() //So that fake PDAs show up in conversations for props. Namedlist of "fakeName" = fakeRef /datum/data/pda/app/messenger/start() . = ..() @@ -42,6 +43,8 @@ convopdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "1"))) else pdas.Add(list(list("Name" = "[P]", "Reference" = "\ref[P]", "Detonate" = "[P.detonate]", "inconvo" = "0"))) + for(var/fakeRef in fakepdas) + convopdas.Add(list(list("Name" = "[fakepdas[fakeRef]]", "Reference" = "[fakeRef]", "Detonate" = "0", "inconvo" = "1"))) data["convopdas"] = convopdas data["pdas"] = pdas @@ -241,4 +244,14 @@ for(var/obj/item/device/pda/target in targets) var/datum/data/pda/app/messenger/P = target.find_program(/datum/data/pda/app/messenger) if(P) - P.receive_message(modified_message, "\ref[M]") \ No newline at end of file + P.receive_message(modified_message, "\ref[M]") + +/* +Generalized proc to handle GM fake prop messages, or future fake prop messages from mapping landmarks. +We need a separate proc for this due to the "target" component and creation of a fake conversation entry. +Invoked by /obj/item/device/pda/proc/createPropFakeConversation_admin(var/mob/M) +*/ +/datum/data/pda/app/messenger/proc/createFakeMessage(fakeName, fakeRef, fakeJob, sent, message) + receive_message(list("sent" = sent, "owner" = "[fakeName]", "job" = "[fakeJob]", "message" = "[message]", "target" = "[fakeRef]"), fakeRef) + if(!fakepdas[fakeRef]) + fakepdas[fakeRef] = fakeName diff --git a/vorestation.dme b/vorestation.dme index e522575e21..4824f8c6c9 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2394,6 +2394,7 @@ #include "code\modules\error_handler\error_viewer.dm" #include "code\modules\error_handler\~defines.dm" #include "code\modules\eventkit\event_machinery.dm" +#include "code\modules\eventkit\gm_interfaces\fake_pda_conversations.dm" #include "code\modules\eventkit\gm_interfaces\mob_spawner.dm" #include "code\modules\events\apc_damage.dm" #include "code\modules\events\atmos_leak.dm"