From b5f74be72574b1311e24e8e22ba5cdc11ed61636 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Wed, 14 Sep 2016 03:32:42 -0400 Subject: [PATCH] MORE ui stuff --- code/modules/shuttle/emergency.dm | 1 + code/modules/shuttle/shuttle_manipulator.dm | 51 ++++++++++++++++++--- nano/templates/shuttle_manipulator.tmpl | 42 ++++++++++------- 3 files changed, 71 insertions(+), 23 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 60a46407992..9639cd6ab4f 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -5,6 +5,7 @@ icon_keyboard = "tech_key" var/auth_need = 3 var/list/authorized = list() + var/canrecall = TRUE /obj/machinery/computer/emergency_shuttle/attackby(obj/item/weapon/card/W, mob/user, params) if(stat & (BROKEN|NOPOWER)) diff --git a/code/modules/shuttle/shuttle_manipulator.dm b/code/modules/shuttle/shuttle_manipulator.dm index 5e601c1611f..14b72bad821 100644 --- a/code/modules/shuttle/shuttle_manipulator.dm +++ b/code/modules/shuttle/shuttle_manipulator.dm @@ -43,6 +43,23 @@ return attack_hand(user) +/proc/shuttlemode2str(mode) + switch(mode) + if(SHUTTLE_IDLE) + . = "idle" + if(SHUTTLE_RECALL) + . = "recalled" + if(SHUTTLE_CALL) + . = "called" + if(SHUTTLE_DOCKED) + . = "docked" + if(SHUTTLE_STRANDED) + . = "stranded" + if(SHUTTLE_ESCAPE) + . = "escape" + if(!.) + throw EXCEPTION("shuttlemode2str(): invalid mode") + /obj/machinery/shuttle_manipulator/attack_hand(mob/user as mob) ui_interact(user) @@ -96,7 +113,7 @@ if(M.timer && M.timeLeft() >= 50) can_fast_travel = TRUE L["can_fast_travel"] = can_fast_travel - L["mode"] = M.mode + L["mode"] = capitalize(shuttlemode2str(M.mode)) L["status"] = M.getStatusText() if(M == existing_shuttle) data["existing_shuttle"] = L @@ -121,28 +138,48 @@ if(..()) return - for(var/thing in href_list) - log_debug("[thing]: [href_list[thing]]") - var/mob/user = usr // Preload some common parameters var/shuttle_id = href_list["shuttle_id"] var/datum/map_template/shuttle/S = shuttle_templates[shuttle_id] + + if(href_list["selectMenuKey"]) + selected_menu_key = href_list["selectMenuKey"] + return 1 // return 1 forces an update to all Nano uis attached to src + if(href_list["select_template"]) if(S) existing_shuttle = shuttle_master.getShuttle(S.port_id) selected = S . = TRUE + if(href_list["jump_to"]) - . = TRUE + + if(href_list["type"] == "mobile") + for(var/i in shuttle_master.mobile) + var/obj/docking_port/mobile/M = i + if(M.id == href_list["id"]) + user.forceMove(get_turf(M)) + . = TRUE + break + + + if(href_list["fast_travel"]) + for(var/i in shuttle_master.mobile) var/obj/docking_port/mobile/M = i - if(M.id == href_list["id"]) - user.forceMove(get_turf(M)) + if(M.id == href_list["id"] && M.timer && M.timeLeft() >= 50) + M.setTimer(50) + . = TRUE + message_admins("[key_name_admin(usr)] fast travelled \ + [M]") + log_admin("[key_name(usr)] fast travelled [M]") + feedback_add_details("shuttle_fasttravel", M.name) break + if(href_list["preview"]) if(S) . = TRUE diff --git a/nano/templates/shuttle_manipulator.tmpl b/nano/templates/shuttle_manipulator.tmpl index 5d607fc0201..9e83853c089 100644 --- a/nano/templates/shuttle_manipulator.tmpl +++ b/nano/templates/shuttle_manipulator.tmpl @@ -13,32 +13,43 @@ Title: Shuttle Manipulator UI {{if !data.selectedMenuKey || data.selectedMenuKey == 'stat'}} - -
- - {{for data.shuttles}} + {{for data.shuttles}} +
+
Name: {{:value.name}} - ID: {{:value.shuttle_id}} +
+
+ ID: {{:value.id}} +
+
Shuttle Timer: {{:value.timeleft}} +
+
Shuttle Mode: {{:value.mode}} +
+
Shuttle Status: {{:value.status}} - {{:helper.link('Jump to', 'exclamation-circle', {'jump_to' : 1, 'id' : value.shuttle_id} : null)}} - {{:helper.link('Fast Travel', 'exclamation-circle', {'fast_travel' : 1},: null)}} - {{/for}} -
+
+
+ {{:helper.link('Jump to', 'space-shuttle', {'jump_to' : 1, 'type' : 'mobile', 'id' : data.selected.shuttle_id}, null)}} + {{:helper.link('Fast Travel', 'rocket', {'fast_travel' : 1}, null)}} +
+
+ {{/for}} {{else data.selectedMenuKey == 'stemp'}}
{{for data.templates}} + Name: {{:value.name}} {{if data.description}} - Description: {{:data.description}} + Description: {{:value.description}} {{/if}} {{if data.admin_notes}} - Admin Notes: {{:data.admin_notes}} + Admin Notes: {{:value.admin_notes}} {{/if}} - {{:helper.link('select template', 'exclamation-circle', {'use_template' : 1}: null)}} + {{:helper.link('select template', 'space-shuttle', {'select_template' : 1, 'shuttle_id' : data.shuttle_id}, null)}} {{/for}}
@@ -54,7 +65,7 @@ Title: Shuttle Manipulator UI - {{:helper.link('Jump to', 'exclamation-circle', {'jump_to' : 1, 'id' : data.selected.shuttle_id} : null)}} + {{:helper.link('Jump to', 'space-shuttle', {'jump_to' : 1, 'type' : 'mobile', 'id' : data.selected.shuttle_id}, null)}} {{if data.existing_shuttle}} @@ -65,9 +76,8 @@ Title: Shuttle Manipulator UI {{/if}} {{/if}} - {{:helper.link('Preview', 'exclamation-circle', {'preview' : 1, 'id' : data.selected.shuttle_id} : null)}} - {{:helper.link('Load', 'exclamation-circle', {'load' : 1, 'id' : data.selected.shuttle_id} : null)}} + {{:helper.link('Preview', 'exclamation-circle', {'preview' : 1, 'shuttle_id' : data.selected.shuttle_id}, null)}} + {{:helper.link('Load', 'exclamation-circle', {'load' : 1, 'shuttle_id' : data.selected.shuttle_id}, null)}} {{/if}} -