From ade7f6c1cd04c3deda193df8b86d5f974d3fc8ed Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sun, 4 Jun 2017 18:00:16 -0400 Subject: [PATCH] Communicator QOL Tweak Call/Msg buttons on contacts list --- code/game/objects/items/devices/communicator/communicator.dm | 4 ++-- nano/templates/communicator.tmpl | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index 018be58705..5df911cba8 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -261,7 +261,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list() // Proc: ui_interact() // Parameters: 4 (standard NanoUI arguments) // Description: Uses a bunch of for loops to turn lists into lists of lists, so they can be displayed in nanoUI, then displays various buttons to the user. -/obj/item/device/communicator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/device/communicator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/key_state = null) // this is the data which will be sent to the ui var/data[0] //General nanoUI information var/communicators[0] //List of communicators @@ -356,7 +356,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list() 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, "communicator.tmpl", "Communicator", 475, 700) + ui = new(user, src, ui_key, "communicator.tmpl", "Communicator", 475, 700, state = key_state) // when the ui is first opened this is the data it will use ui.set_initial_data(data) // open the new ui window diff --git a/nano/templates/communicator.tmpl b/nano/templates/communicator.tmpl index 58b86a30d7..6157f45d61 100644 --- a/nano/templates/communicator.tmpl +++ b/nano/templates/communicator.tmpl @@ -152,7 +152,10 @@ Used In File(s): code\game\objects\items\devices\communicator\communicator.dm {{:value.name}}
-
{{:value.address}}
{{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}} +
{{:value.address}}
+ {{:helper.link('Copy', 'pencil', {'copy' : value.address, 'switch_tab' : 2})}} + {{:helper.link('Call', 'phone', {'dial' : value.address, 'copy' : value.address, 'switch_tab' : 2})}} + {{:helper.link('Msg', 'mail-closed', {'copy' : value.address, 'copy_name' : value.name, 'switch_tab' : 40})}}
{{/for}}