diff --git a/code/modules/shuttle/shuttle_manipulator.dm b/code/modules/shuttle/shuttle_manipulator.dm index 0c9495f7359..9259ac5051e 100644 --- a/code/modules/shuttle/shuttle_manipulator.dm +++ b/code/modules/shuttle/shuttle_manipulator.dm @@ -60,7 +60,19 @@ /obj/machinery/shuttle_manipulator/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + 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, "shuttle_manipulator.tmpl", "Shuttle Manipulator", 660, 700) + // when the ui is first opened this is the data it will use + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/shuttle_manipulator/ui_data(mob/user, datum/topic_state/state) var/data[0] data["selectedMenuKey"] = selected_menu_key @@ -117,20 +129,7 @@ data["existing_shuttle"] = L data["shuttles"] += list(L) - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - 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, "shuttle_manipulator.tmpl", "Shuttle Manipulator", 660, 700) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) - + return data /obj/machinery/shuttle_manipulator/Topic(href, href_list) if(..()) diff --git a/nano/templates/shuttle_manipulator.tmpl b/nano/templates/shuttle_manipulator.tmpl index 2fefd0ff648..538eff94d27 100644 --- a/nano/templates/shuttle_manipulator.tmpl +++ b/nano/templates/shuttle_manipulator.tmpl @@ -40,7 +40,7 @@ Title: Shuttle Manipulator UI {{else data.selectedMenuKey == 'stemp'}}
{{for data.templates_tabs}} - {{:helper.link(value, 'space-shuttle', {'select_template_category' : value}, (data.existing_shuttle && data.existing_shuttle.id == value) ? 'selected' : null)}} + {{:helper.link(value, 'space-shuttle', {'select_template_category' : value}, (data.existing_shuttle && data.existing_shuttle.id == value) ? (data.selected && data.selected.shuttle_id == value.shuttle_id) )}} {{/for}}
{{if data.existing_shuttle}}