From 37a9c6756045ac92f202beff1e0a49f16ba9a91a Mon Sep 17 00:00:00 2001 From: GeneralChaos81 Date: Mon, 15 Aug 2016 15:58:23 +1000 Subject: [PATCH] Corrected points Fox raised. Updated nanoUI for the new screen. --- code/game/mecha/mech_bay.dm | 19 +++++++++---------- .../items/stacks/sheets/sheet_types.dm | 1 - code/modules/admin/admin.dm | 3 --- nano/templates/mech_bay_console.tmpl | 14 +------------- 4 files changed, 10 insertions(+), 27 deletions(-) diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index b4f6748bde8..da8ca9787b9 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -20,7 +20,6 @@ var/obj/machinery/computer/mech_bay_power_console/recharge_console var/max_charge = 50 var/on = 0 - var/repairability = 0 //What's this? I don't think this is a thing on paradise var/turf/recharging_turf = null /obj/machinery/mech_bay_recharge_port/New() @@ -59,6 +58,7 @@ return if(default_change_direction_wrench(user, I)) + recharging_turf = get_step(loc, dir) return if(exchange_parts(user, I)) @@ -86,7 +86,6 @@ if(recharging_mecha.loc != recharging_turf) recharging_mecha = null recharge_console.update_icon() - return //This was missing... Is it not needed? Appeared in the original, but not in the port. Added it back in, to be safe. /obj/machinery/computer/mech_bay_power_console/proc/reconnect() @@ -140,12 +139,13 @@ if(recharge_port.recharging_mecha && !qdeleted(recharge_port.recharging_mecha)) data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mecha.health, "maxhealth" = initial(recharge_port.recharging_mecha.health), "cell" = null) if(recharge_port.recharging_mecha.cell && !qdeleted(recharge_port.recharging_mecha.cell)) - data["recharge_port"]["mech"]["cell"] = list( - "critfail" = recharge_port.recharging_mecha.cell.crit_fail, - "charge" = recharge_port.recharging_mecha.cell.charge, - "maxcharge" = recharge_port.recharging_mecha.cell.maxcharge - ) -/* Need to update the nanoUI for these new data types. + data["has_mech"] = 1 //Copied + data["mecha_name"] = recharge_port.recharging_mecha || "None" + data["mecha_charge"] = isnull(recharge_port.recharging_mecha) ? 0 : recharge_port.recharging_mecha.cell.charge + data["mecha_maxcharge"] = isnull(recharge_port.recharging_mecha) ? 0 : recharge_port.recharging_mecha.cell.maxcharge + data["mecha_charge_percentage"] = isnull(recharge_port.recharging_mecha) ? 0 : round(recharge_port.recharging_mecha.cell.percent()) + else + data["has_mech"] = 0 //Copied 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 @@ -158,8 +158,7 @@ // auto update every Master Controller tick ui.set_auto_update(1) return data -*/ /obj/machinery/computer/mech_bay_power_console/initialize() reconnect() - update_icon() //this the right place for it? Otherwise the computer sits there with a black screen. \ No newline at end of file + update_icon() \ No newline at end of file diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 763ea7bdf93..76ac7cc252e 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -113,7 +113,6 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list( new /datum/stack_recipe("Surgery Table", /obj/machinery/optable, 5, time = 50, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1), new /datum/stack_recipe("Mass Driver frame", /obj/machinery/mass_driver_frame, 3, time = 50, one_per_turf = 1), - new /datum/stack_recipe("Mech Recharge Bay", /turf/simulated/floor/mech_bay_recharge_floor, 2, time = 50, one_per_turf = 1), ) /obj/item/stack/sheet/plasteel diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d0eab325481..9fe2e6e911c 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -897,9 +897,6 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space toArea = locate(/area/shuttle/gamma/space) fromArea.move_contents_to(toArea) -// for(var/turf/simulated/floor/mech_bay_recharge_floor/F in toArea) -// F.init_devices() - for(var/obj/machinery/power/apc/A in toArea) A.init() diff --git a/nano/templates/mech_bay_console.tmpl b/nano/templates/mech_bay_console.tmpl index cd80983469a..2a4cf5d6085 100644 --- a/nano/templates/mech_bay_console.tmpl +++ b/nano/templates/mech_bay_console.tmpl @@ -1,22 +1,10 @@

Subsystems

-
-
- Recharge Station: -
-
- {{if data.has_floor}} - OK - {{else}} - ERROR - {{/if}} -
-
Power Port:
- {{if data.has_port}} + {{if data.recharge_port}} OK {{else}} ERROR