diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 0a8ea086a1..3c66cdca92 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -124,7 +124,7 @@ Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!) /obj/machinery/turretid/AICtrlClick() //turns off/on Turrets - Topic(src, list("src"= "\ref[src]", "operation"="toggleon"), 1) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "command"="enable", "value"="[!enabled]"), 1) // 1 meaning no window (consistency!) /atom/proc/AIAltClick(var/atom/A) AltClick(A) @@ -139,7 +139,7 @@ return /obj/machinery/turretid/AIAltClick() //toggles lethal on turrets - Topic(src, list("src"= "\ref[src]", "operation"="togglelethal"), 1) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "command"="lethal", "value"="[!lethal]"), 1) // 1 meaning no window (consistency!) /atom/proc/AIMiddleClick() return diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm index c9c2331e6d..1965d10243 100644 --- a/code/game/machinery/portable_tag_turret.dm +++ b/code/game/machinery/portable_tag_turret.dm @@ -42,25 +42,19 @@ shot_delay = 30 iconholder = 1 -/obj/machinery/porta_turret/tag/interact(mob/user) - var/dat +/obj/machinery/porta_turret/tag/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + var/data[0] + data["access"] = !isLocked(user) + data["locked"] = locked + data["enabled"] = enabled + data["is_lethal"] = 0 - if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - if(lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag)) - return - if(lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag)) - return - dat += text({" - Automatic Portable Turret Installation

- Status: []
"}, - - "[on ? "On" : "Off"]" ) - - - user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") - onclose(user, "autosec") - return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if (!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) /obj/machinery/porta_turret/tag/update_icon() if(!anchored) @@ -70,7 +64,7 @@ icon_state = "[lasercolor]destroyed_target_prism" else if(powered()) - if(on) + if(enabled) if(iconholder) //lasers have a orange icon icon_state = "[lasercolor]orange_target_prism" diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 8c04da619b..2268561ed0 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -46,7 +46,7 @@ var/attacked = 0 //if set to 1, the turret gets pissed off and shoots at people nearby (unless they have sec access!) - var/on = 1 //determines if the turret is on + var/enabled = 1 //determines if the turret is on var/lethal = 0 //whether in lethal or stun mode var/disabled = 0 @@ -132,7 +132,7 @@ icon_state = "destroyed_target_prism" else if(powered()) - if(on) + if(enabled) if(iconholder) //lasers have a orange icon icon_state = "orange_target_prism" @@ -149,109 +149,98 @@ del(cover) // qdel ..() -/obj/machinery/porta_turret/proc/can_use(mob/user) - if(ailock && issilicon(user)) +/obj/machinery/porta_turret/proc/isLocked(mob/user) + if(ailock && user.isSilicon()) user << "There seems to be a firewall preventing you from accessing this device." - return 0 + return 1 - if (get_dist(src, user) > 1 && !issilicon(user)) - user << "You are too far away." - user.unset_machine() - user << browse(null, "window=turretid") - return 0 - - if(locked && !issilicon(user)) + if(locked && !user.isSilicon()) user << "Access denied." - return 0 + return 1 - return 1 + return 0 /obj/machinery/porta_turret/attack_ai(mob/user) - return attack_hand(user) + if(isLocked(user)) + return + + ui_interact(user) /obj/machinery/porta_turret/attack_hand(mob/user) - if(..()) - return 1 - if(!can_use(user)) - return 1 - interact(user) + if(isLocked(user)) + return -/obj/machinery/porta_turret/interact(mob/user) - var/dat = text({" - Automatic Portable Turret Installation

- Status: []
- Behaviour controls are [locked ? "locked" : "unlocked"]"}, - "[on ? "On" : "Off"]" ) + ui_interact(user) - if(!locked || issilicon(user)) - dat += text({"

- Lethal Mode: []
- Neutralize All Non-Synthetics: []
"}, +/obj/machinery/porta_turret/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + var/data[0] + data["access"] = !isLocked(user) + data["locked"] = locked + data["enabled"] = enabled + data["is_lethal"] = 1 + data["lethal"] = lethal - "[lethal ? "Enabled" : "Disabled"]", - "[check_synth ? "Yes" : "No"]") - if(!check_synth) - dat += text({"Check for Weapon Authorization: []
- Check Security Records: []
- Check Arrest Status: []
- Neutralize All Non-Authorized Personnel: []
- Neutralize All Unidentified Life Signs: []
"}, + if(data["access"]) + var/settings[0] + settings[++settings.len] = list("category" = "Neutralize All Non-Synthetics", "setting" = "check_synth", "value" = check_synth) + settings[++settings.len] = list("category" = "Check Weapon Authorization", "setting" = "check_weapons", "value" = check_weapons) + settings[++settings.len] = list("category" = "Check Security Records", "setting" = "check_records", "value" = check_records) + settings[++settings.len] = list("category" = "Check Arrest Status", "setting" = "check_arrest", "value" = check_arrest) + settings[++settings.len] = list("category" = "Check Access Authorization", "setting" = "check_access", "value" = check_access) + settings[++settings.len] = list("category" = "Check misc. Lifeforms", "setting" = "check_anomalies", "value" = check_anomalies) + data["settings"] = settings - "[check_weapons ? "Yes" : "No"]", - "[check_records ? "Yes" : "No"]", - "[check_arrest ? "Yes" : "No"]", - "[check_access ? "Yes" : "No"]", - "[check_anomalies ? "Yes" : "No"]" ) - else - dat += "
Swipe ID card to unlock interface
" - - user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") - onclose(user, "autosec") - return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if (!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) /obj/machinery/porta_turret/proc/HasController() var/area/A = get_area(src) return A && A.turret_controls.len > 0 -/obj/machinery/porta_turret/Topic(href, href_list) +/obj/machinery/porta_turret/CanUseTopic(var/mob/user) + if(HasController()) + user << "Turrets can only be controlled using the assigned turret controller." + return STATUS_CLOSE + + if(isLocked(user)) + return STATUS_CLOSE + + if(!anchored) + usr << "\The [src] has to be secured first!" + return STATUS_CLOSE + + return STATUS_INTERACTIVE + + +/obj/machinery/porta_turret/Topic(href, href_list, var/nowindow = 0) if(..()) return 1 - if(!can_use(usr)) + + if(href_list["command"] && href_list["value"]) + var/value = text2num(href_list["value"]) + if(href_list["command"] == "enable") + enabled = value + else if(href_list["command"] == "lethal") + lethal = value + else if(href_list["command"] == "check_synth") + check_synth = value + else if(href_list["command"] == "check_weapons") + check_weapons = value + else if(href_list["command"] == "check_records") + check_records = value + else if(href_list["command"] == "check_arrest") + check_arrest = value + else if(href_list["command"] == "check_access") + check_access = value + else if(href_list["command"] == "check_anomalies") + check_anomalies = value + return 1 - if(HasController()) - usr << "Turrets can only be controlled using the assigned turret controller." - return - - usr.set_machine(src) - if(href_list["power"]) - if(anchored) //you can't turn a turret on/off if it's not anchored/secured - on = !on //toggle on/off - else - usr << "It has to be secured first!" - - attack_hand(usr) - return - - switch(href_list["operation"]) //toggles customizable behavioural protocols - if("togglelethal") - if(!controllock) - lethal = !lethal - if("toggleai") - check_synth = !check_synth - if("authweapon") - check_weapons = !check_weapons - if("checkrecords") - check_records = !check_records - if("checkarrests") - check_arrest = !check_arrest - if("checkaccess") - check_access = !check_access - if("checkxenos") - check_anomalies = !check_anomalies - attack_hand(usr) - - /obj/machinery/porta_turret/power_change() if(powered()) stat &= ~NOPOWER @@ -291,12 +280,12 @@ emagged = 1 iconholder = 1 controllock = 1 - on = 0 //turns off the turret temporarily + enabled = 0 //turns off the turret temporarily sleep(60) //6 seconds for the traitor to gtfo of the area before the turret decides to ruin his shit - on = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here + enabled = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here else if((istype(I, /obj/item/weapon/wrench))) - if(on || raised) + if(enabled || raised) user << "You cannot unsecure an active turret!" return if(wrenching) @@ -363,7 +352,7 @@ if(Proj.damage_type == HALLOSS) return - if(on) + if(enabled) if(!attacked && !emagged) attacked = 1 spawn() @@ -376,7 +365,7 @@ take_damage(Proj.damage) /obj/machinery/porta_turret/emp_act(severity) - if(on) + if(enabled) //if the turret is on, the EMP no matter how severe disables the turret for a while //and scrambles its settings, with a slight chance of having an emag effect check_arrest = prob(50) @@ -387,10 +376,10 @@ if(prob(5)) emagged = 1 - on=0 + enabled=0 sleep(rand(60,600)) - if(!on) - on=1 + if(!enabled) + enabled=1 ..() @@ -437,7 +426,7 @@ popDown() return - if(!on) + if(!enabled) //if the turret is off, make it pop down popDown() return @@ -615,7 +604,7 @@ A.process() /datum/turret_checks - var/on + var/enabled var/lethal var/check_synth var/check_access @@ -628,7 +617,7 @@ /obj/machinery/porta_turret/proc/setState(var/datum/turret_checks/TC) if(controllock) return - src.on = TC.on + src.enabled = TC.enabled src.lethal = TC.lethal src.iconholder = TC.lethal @@ -804,7 +793,7 @@ Turret.name = finish_name Turret.installation = installation Turret.gun_charge = gun_charge - Turret.on = 0 + Turret.enabled = 0 Turret.setup() // Turret.cover=new/obj/machinery/porta_turret_cover(loc) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 41a98103be..c463c3c497 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -16,7 +16,7 @@ var/enabled = 0 var/lethal = 0 var/locked = 1 - var/control_area //can be area name, path or nothing. + var/area/control_area //can be area name, path or nothing. var/check_arrest = 1 //checks if the perp is set to arrest var/check_records = 1 //checks if a security record exists at all @@ -24,7 +24,7 @@ var/check_access = 1 //if this is active, the turret shoots everything that does not meet the access requirements var/check_anomalies = 1 //checks if it can shoot at unidentified lifeforms (ie xenos) var/check_synth = 0 //if active, will shoot at anything not an AI or cyborg - var/ailock = 0 // AI cannot use this + var/ailock = 0 //Silicons cannot use this req_access = list(access_ai_upload) @@ -47,159 +47,127 @@ /obj/machinery/turretid/initialize() if(!control_area) var/area/CA = get_area(src) - if(CA.master && CA.master != CA) - control_area = CA.master - else - control_area = CA + control_area = CA.master else if(istext(control_area)) for(var/area/A in world) if(A.name && A.name==control_area) - control_area = A + control_area = A.master break - power_change() //Checks power and initial settings - //don't have to check if control_area is path, since get_area_all_atoms can take path. if(control_area) var/area/A = control_area - if(A && istype(A)) + if(istype(A)) A.turret_controls += src + else + control_area = null + + power_change() //Checks power and initial settings return -/obj/machinery/turretid/proc/can_use(mob/user) - if(ailock && issilicon(user)) +/obj/machinery/turretid/proc/isLocked(mob/user) + if(ailock && user.isSilicon()) user << "There seems to be a firewall preventing you from accessing this device." - return 0 + return 1 - if (get_dist(src, user) > 0 && !issilicon(user)) - user << "You are too far away." - user.unset_machine() - user << browse(null, "window=turretid") - return 0 - - if(locked && !issilicon(user)) + if(locked && !user.isSilicon()) user << "Access denied." - return 0 + return 1 - return 1 + return 0 + +/obj/machinery/turretid/CanUseTopic(mob/user) + if(isLocked(user)) + return STATUS_CLOSE + + return STATUS_INTERACTIVE /obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) - if(stat & BROKEN) return - if (istype(user, /mob/living/silicon)) - return src.attack_hand(user) + if(stat & BROKEN) + return - if (istype(W, /obj/item/weapon/card/emag) && !emagged) + if(!emagged && istype(W, /obj/item/weapon/card/emag)) user << "You short out the turret controls' access analysis module." emagged = 1 locked = 0 - if(user.machine==src) - src.attack_hand(user) - + ailock = 0 return - else if( get_dist(src, user) == 0 ) // trying to unlock the interface - if (src.allowed(usr)) + if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) + if(src.allowed(usr)) if(emagged) user << "The turret control is unresponsive." - return - - locked = !locked - user << "You [ locked ? "lock" : "unlock"] the panel." - if (locked) - if (user.machine==src) - user.unset_machine() - user << browse(null, "window=turretid") else - if (user.machine==src) - src.attack_hand(user) - else - user << "Access denied." + locked = !locked + user << "You [ locked ? "lock" : "unlock"] the panel." + return + return ..() /obj/machinery/turretid/attack_ai(mob/user as mob) - return attack_hand(user) + if(isLocked(user)) + return + + ui_interact(user) /obj/machinery/turretid/attack_hand(mob/user as mob) - if(!can_use(user)) + if(isLocked(user)) return - user.set_machine(src) - var/loc = src.loc - if (istype(loc, /turf)) - var/turf/T = loc - loc = T.loc - if (!istype(loc, /area)) - return - var/area/area = loc - var/dat = text({"Status: []
- Behaviour controls are [locked ? "locked" : "unlocked"]"}, - "[enabled ? "On" : "Off"]" ) + ui_interact(user) - if(!locked || issilicon(user)) - dat += text({"

- Lethal Mode: []
- Neutralize All Non-Synthetics: []
"}, +/obj/machinery/turretid/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + var/data[0] + data["access"] = !isLocked(user) + data["locked"] = locked + data["enabled"] = enabled + data["is_lethal"] = 1 + data["lethal"] = lethal - "[lethal ? "Enabled" : "Disabled"]", - "[check_synth ? "Yes" : "No"]") - if(!check_synth) - dat += text({"Check for Weapon Authorization: []
- Check Security Records: []
- Check Arrest Status: []
- Neutralize All Non-Authorized Personnel: []
- Neutralize All Unidentified Life Signs: []
"}, + if(data["access"]) + var/settings[0] + settings[++settings.len] = list("category" = "Neutralize All Non-Synthetics", "setting" = "check_synth", "value" = check_synth) + settings[++settings.len] = list("category" = "Check Weapon Authorization", "setting" = "check_weapons", "value" = check_weapons) + settings[++settings.len] = list("category" = "Check Security Records", "setting" = "check_records", "value" = check_records) + settings[++settings.len] = list("category" = "Check Arrest Status", "setting" = "check_arrest", "value" = check_arrest) + settings[++settings.len] = list("category" = "Check Access Authorization", "setting" = "check_access", "value" = check_access) + settings[++settings.len] = list("category" = "Check misc. Lifeforms", "setting" = "check_anomalies", "value" = check_anomalies) + data["settings"] = settings - "[check_weapons ? "Yes" : "No"]", - "[check_records ? "Yes" : "No"]", - "[check_arrest ? "Yes" : "No"]", - "[check_access ? "Yes" : "No"]", - "[check_anomalies ? "Yes" : "No"]" ) - else - dat += "
Swipe ID card to unlock interface
" - - //user << browse(t, "window=turretid") - //onclose(user, "turretid") - var/datum/browser/popup = new(user, "turretid", "Turret Control Panel ([area.name])", 500, 500) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if (!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) /obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0) if(..()) return 1 - if(!can_use(usr)) + if(href_list["command"] && href_list["value"]) + var/value = text2num(href_list["value"]) + if(href_list["command"] == "enable") + enabled = value + else if(href_list["command"] == "lethal") + lethal = value + else if(href_list["command"] == "check_synth") + check_synth = value + else if(href_list["command"] == "check_weapons") + check_weapons = value + else if(href_list["command"] == "check_records") + check_records = value + else if(href_list["command"] == "check_arrest") + check_arrest = value + else if(href_list["command"] == "check_access") + check_access = value + else if(href_list["command"] == "check_anomalies") + check_anomalies = value + + updateTurrets() return 1 - switch(href_list["operation"]) //toggles customizable behavioural protocols - if("toggleon") - enabled = !enabled - if("togglelethal") - lethal = !lethal - if("toggleai") - check_synth = !check_synth - if("authweapon") - check_weapons = !check_weapons - if("checkrecords") - check_records = !check_records - if("checkarrest") - check_arrest = !check_arrest - if("checkaccess") - check_access = !check_access - if("checkxenos") - check_anomalies = !check_anomalies - - src.updateTurrets() - - if(!nowindow) - attack_hand(usr) - -/obj/machinery/turretid/updateDialog() - if (stat & (BROKEN|MAINT)) - return - ..() - /obj/machinery/turretid/proc/updateTurrets() var/datum/turret_checks/TC = new - TC.on = enabled + TC.enabled = enabled TC.lethal = lethal TC.check_synth = check_synth TC.check_access = check_access @@ -209,10 +177,12 @@ TC.check_anomalies = check_anomalies TC.ailock = ailock - if(control_area) - for (var/obj/machinery/porta_turret/aTurret in get_area_all_atoms(control_area)) - aTurret.setState(TC) - src.update_icon() + if(istype(control_area)) + for(var/area/sub_area in control_area.related) + for (var/obj/machinery/porta_turret/aTurret in sub_area) + aTurret.setState(TC) + + update_icon() /obj/machinery/turretid/power_change() ..() diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 71cb84edef..0a588e9b51 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -146,10 +146,10 @@ nanoui is used to open and update nano browser uis var/new_status = host.CanUseTopic(user, list(), custom_state) if(master_ui) new_status = min(new_status, master_ui.status) + + set_status(new_status, push_update) if(new_status == STATUS_CLOSE) close() - else - set_status(new_status, push_update) /** * Set the ui to auto update (every master_controller tick) @@ -396,6 +396,9 @@ nanoui is used to open and update nano browser uis if (width && height) window_size = "size=[width]x[height];" update_status(0) + if(status == STATUS_CLOSE) + return + user << browse(get_html(), "window=[window_id];[window_size][window_options]") winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map on_close_winset() diff --git a/maps/exodus-2.dmm b/maps/exodus-2.dmm index 01b4f044a3..443ae9f66f 100644 --- a/maps/exodus-2.dmm +++ b/maps/exodus-2.dmm @@ -1198,7 +1198,7 @@ "xb" = (/obj/structure/table/reinforced,/obj/item/weapon/gun/energy/gun/nuclear,/obj/item/weapon/hand_tele,/turf/unsimulated/floor{icon_state = "vault"; dir = 8},/area/centcom) "xc" = (/obj/machinery/door/airlock/centcom{name = "Armory Special Operations"; opacity = 1; req_access_txt = "103"},/turf/unsimulated/floor{icon_state = "vault"; dir = 8},/area/centcom) "xd" = (/obj/machinery/door/airlock/centcom{name = "Engineering Special Operations"; opacity = 1; req_access_txt = "103"},/turf/unsimulated/floor{icon_state = "vault"; dir = 8},/area/centcom) -"xe" = (/obj/machinery/porta_turret{anchored = 0; check_records = 0; on = 0; req_one_access = list(103); req_one_access_txt = "103"; use_power = 0},/turf/unsimulated/floor{icon_state = "vault"; dir = 1},/area/centcom) +"xe" = (/obj/machinery/porta_turret{anchored = 0; check_records = 0; enabled = 0; req_one_access = list(103); req_one_access_txt = "103"; use_power = 0},/turf/unsimulated/floor{icon_state = "vault"; dir = 1},/area/centcom) "xf" = (/turf/unsimulated/floor{icon_state = "bot"},/area/centcom/specops) "xg" = (/obj/machinery/door/airlock/centcom{name = "Special Operations"; opacity = 1; req_access_txt = "103"},/turf/unsimulated/floor{icon_state = "delivery"},/area/centcom/specops) "xh" = (/obj/machinery/door/airlock/centcom{name = "Bridge"; opacity = 1; req_access_txt = "109"},/turf/unsimulated/floor{icon_state = "floor"},/area/centcom/control) @@ -2011,7 +2011,7 @@ "Ny" = (/obj/machinery/hologram/holopad,/turf/unsimulated/floor{tag = "icon-wood"; icon_state = "wood"},/area/centcom/holding) "Nz" = (/obj/structure/table/woodentable{dir = 5},/obj/item/weapon/flame/lighter/zippo,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/ashtray/bronze{pixel_x = -1; pixel_y = 1},/obj/machinery/camera{c_tag = "Crescent Bar East"; dir = 4},/turf/unsimulated/floor{tag = "icon-wood"; icon_state = "wood"},/area/centcom/holding) "NA" = (/obj/machinery/hologram/holopad,/turf/unsimulated/floor{icon_state = "floor"},/area/centcom/control) -"NB" = (/obj/machinery/porta_turret{anchored = 0; check_records = 0; on = 0; req_one_access = list(103); req_one_access_txt = "103"; use_power = 0},/turf/unsimulated/floor{icon_state = "bot"},/area/centcom/evac) +"NB" = (/obj/machinery/porta_turret{anchored = 0; check_records = 0; enabled = 0; req_one_access = list(103); req_one_access_txt = "103"; use_power = 0},/turf/unsimulated/floor{icon_state = "bot"},/area/centcom/evac) "NC" = (/obj/machinery/status_display{pixel_y = -30},/turf/simulated/shuttle/floor,/area/shuttle/escape/centcom) "ND" = (/obj/machinery/atmospherics/portables_connector,/obj/machinery/portable_atmospherics/canister/oxygen/prechilled,/turf/unsimulated/floor{icon_state = "floor"},/area/centcom/holding) "NE" = (/obj/structure/closet/walllocker/emerglocker{pixel_x = -28},/turf/simulated/shuttle/floor{icon_state = "floor2"},/area/shuttle/escape/centcom) diff --git a/nano/css/shared.css b/nano/css/shared.css index c4f9d1acd9..9ff97dd02c 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -248,17 +248,31 @@ div.notice { clear: both; } -.itemLabel { +.itemLabel, .itemLabelWide { float: left; - width: 30%; color: #e9c183; } -.itemContent { - float: left; +.itemLabel { + width: 30%; +} + +.itemLabelWide { width: 69%; } +.itemContent, .itemContentThin { + float: left; +} + +.itemContent { + width: 69%; +} + +.itemContentThin { + width: 30%; +} + .itemLabelNarrow { float: left; width: 20%; diff --git a/nano/templates/omni_filter.tmpl b/nano/templates/omni_filter.tmpl index 731340db02..393102548f 100644 --- a/nano/templates/omni_filter.tmpl +++ b/nano/templates/omni_filter.tmpl @@ -1,86 +1,86 @@ -
-
- {{:helper.link(data.power ? 'On' : 'Off', null, {'command' : 'power'})}} -
-
- {{:helper.link('Configure', null, {'command' : 'configure'}, null, data.config ? 'selected' : null)}} -
- - {{if data.config}} - -
-
-
Port
- {{for data.ports}} -
{{:value.dir}} Port
- {{/for}} -
-
-
Input
- {{for data.ports}} -
- {{:helper.link(' ', null, {'command' : 'switch_mode', 'mode' : 'in', 'dir' : value.dir}, null, value.input ? 'selected' : null)}} -
- {{/for}} -
-
-
Output
- {{for data.ports}} -
- {{:helper.link(' ', null, {'command' : 'switch_mode', 'mode' : 'out', 'dir' : value.dir}, null, value.output ? 'selected' : null)}} -
- {{/for}} -
-
-
Filter
- {{for data.ports}} -
- {{:helper.link(value.f_type ? value.f_type : 'None', null, {'command' : 'switch_filter', 'mode' : value.f_type, 'dir' : value.dir}, value.filter ? null : 'disabled', value.f_type ? 'selected' : null)}} -
- {{/for}} -
-
- -
- Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s -
-
- {{:helper.link('Set Flow Rate Limit', null, {'command' : 'set_flow_rate'})}} -
- - {{else}} - -
-
-
Port
- {{for data.ports}} -
{{:value.dir}} Port
- {{/for}} -
-
-
Mode
- {{for data.ports}} -
- {{if value.input}} - Input - {{else value.output}} - Output - {{else value.f_type}} - {{:value.f_type}} - {{else}} - Disabled - {{/if}} -
- {{/for}} -
-
- -
- Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s -
- -
- Flow Rate: {{:(data.last_flow_rate/10)}} L/s -
- {{/if}} +
+
+ {{:helper.link(data.power ? 'On' : 'Off', null, {'command' : 'power'}, data.config ? 'disabled' : null)}} +
+
+ {{:helper.link('Configure', null, {'command' : 'configure'}, null, data.config ? 'selected' : null)}} +
+ + {{if data.config}} + +
+
+
Port
+ {{for data.ports}} +
{{:value.dir}} Port
+ {{/for}} +
+
+
Input
+ {{for data.ports}} +
+ {{:helper.link(' ', null, {'command' : 'switch_mode', 'mode' : 'in', 'dir' : value.dir}, null, value.input ? 'selected' : null)}} +
+ {{/for}} +
+
+
Output
+ {{for data.ports}} +
+ {{:helper.link(' ', null, {'command' : 'switch_mode', 'mode' : 'out', 'dir' : value.dir}, null, value.output ? 'selected' : null)}} +
+ {{/for}} +
+
+
Filter
+ {{for data.ports}} +
+ {{:helper.link(value.f_type ? value.f_type : 'None', null, {'command' : 'switch_filter', 'mode' : value.f_type, 'dir' : value.dir}, value.filter ? null : 'disabled', value.f_type ? 'selected' : null)}} +
+ {{/for}} +
+
+ +
+ Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s +
+
+ {{:helper.link('Set Flow Rate Limit', null, {'command' : 'set_flow_rate'})}} +
+ + {{else}} + +
+
+
Port
+ {{for data.ports}} +
{{:value.dir}} Port
+ {{/for}} +
+
+
Mode
+ {{for data.ports}} +
+ {{if value.input}} + Input + {{else value.output}} + Output + {{else value.f_type}} + {{:value.f_type}} + {{else}} + Disabled + {{/if}} +
+ {{/for}} +
+
+ +
+ Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s +
+ +
+ Flow Rate: {{:(data.last_flow_rate/10)}} L/s +
+ {{/if}}
\ No newline at end of file diff --git a/nano/templates/omni_mixer.tmpl b/nano/templates/omni_mixer.tmpl index 770af7fc12..e9ac60e1ba 100644 --- a/nano/templates/omni_mixer.tmpl +++ b/nano/templates/omni_mixer.tmpl @@ -1,101 +1,101 @@ -
-
- {{:helper.link(data.power ? 'On' : 'Off', null, {'command' : 'power'})}} -
-
- {{:helper.link('Configure', null, {'command' : 'configure'}, null, data.config ? 'selected' : null)}} -
- - {{if data.config}} - -
-
-
Port
- {{for data.ports}} -
{{:value.dir}} Port
- {{/for}} -
-
-
Input
- {{for data.ports}} -
- {{:helper.link(' ', null, value.input ? {'command' : 'switch_mode', 'mode' : 'none', 'dir' : value.dir} : {'command' : 'switch_mode', 'mode' : 'in', 'dir' : value.dir}, value.output ? 'disabled' : null, value.input ? 'selected' : null)}} -
- {{/for}} -
-
-
Output
- {{for data.ports}} -
- {{:helper.link(' ', null, value.output ? null : {'command' : 'switch_mode', 'mode' : 'out', 'dir' : value.dir}, null, value.output ? 'selected' : null)}} -
- {{/for}} -
-
-
Concentration
- {{for data.ports}} -
- {{:helper.link( value.input ? helper.round(value.concentration*100)+' %' : '-', null, {'command' : 'switch_con', 'dir' : value.dir}, value.input ? null : 'disabled')}} -
- {{/for}} -
-
-
Lock
- {{for data.ports}} -
- {{:helper.link(' ', value.con_lock ? 'locked' : 'unlocked', {'command' : 'switch_conlock', 'dir' : value.dir}, value.input ? null : 'disabled', value.con_lock ? 'selected' : null)}} -
- {{/for}} -
-
- -
- Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s -
-
- {{:helper.link('Set Flow Rate Limit', null, {'command' : 'set_flow_rate'})}} -
- - {{else}} - -
-
-
Port
- {{for data.ports}} -
{{:value.dir}} Port
- {{/for}} -
-
-
Mode
- {{for data.ports}} -
- {{if value.input}} - Input - {{else value.output}} - Output - {{else}} - Disabled - {{/if}} -
- {{/for}} -
-
-
Concentration
- {{for data.ports}} -
- {{if value.input}} - {{:helper.round(value.concentration*100)}} % - {{else}} - - - {{/if}} -
- {{/for}} -
-
- -
- Flow Rate: {{:(data.last_flow_rate/10)}} L/s -
- - {{/if}} +
+
+ {{:helper.link(data.power ? 'On' : 'Off', null, {'command' : 'power'}, data.config ? 'disabled' : null)}} +
+
+ {{:helper.link('Configure', null, {'command' : 'configure'}, null, data.config ? 'selected' : null)}} +
+ + {{if data.config}} + +
+
+
Port
+ {{for data.ports}} +
{{:value.dir}} Port
+ {{/for}} +
+
+
Input
+ {{for data.ports}} +
+ {{:helper.link(' ', null, value.input ? {'command' : 'switch_mode', 'mode' : 'none', 'dir' : value.dir} : {'command' : 'switch_mode', 'mode' : 'in', 'dir' : value.dir}, value.output ? 'disabled' : null, value.input ? 'selected' : null)}} +
+ {{/for}} +
+
+
Output
+ {{for data.ports}} +
+ {{:helper.link(' ', null, value.output ? null : {'command' : 'switch_mode', 'mode' : 'out', 'dir' : value.dir}, null, value.output ? 'selected' : null)}} +
+ {{/for}} +
+
+
Concentration
+ {{for data.ports}} +
+ {{:helper.link( value.input ? helper.round(value.concentration*100)+' %' : '-', null, {'command' : 'switch_con', 'dir' : value.dir}, value.input ? null : 'disabled')}} +
+ {{/for}} +
+
+
Lock
+ {{for data.ports}} +
+ {{:helper.link(' ', value.con_lock ? 'locked' : 'unlocked', {'command' : 'switch_conlock', 'dir' : value.dir}, value.input ? null : 'disabled', value.con_lock ? 'selected' : null)}} +
+ {{/for}} +
+
+ +
+ Set Flow Rate Limit: {{:(data.set_flow_rate/10)}} L/s +
+
+ {{:helper.link('Set Flow Rate Limit', null, {'command' : 'set_flow_rate'})}} +
+ + {{else}} + +
+
+
Port
+ {{for data.ports}} +
{{:value.dir}} Port
+ {{/for}} +
+
+
Mode
+ {{for data.ports}} +
+ {{if value.input}} + Input + {{else value.output}} + Output + {{else}} + Disabled + {{/if}} +
+ {{/for}} +
+
+
Concentration
+ {{for data.ports}} +
+ {{if value.input}} + {{:helper.round(value.concentration*100)}} % + {{else}} + - + {{/if}} +
+ {{/for}} +
+
+ +
+ Flow Rate: {{:(data.last_flow_rate/10)}} L/s +
+ + {{/if}}
\ No newline at end of file diff --git a/nano/templates/turret_control.tmpl b/nano/templates/turret_control.tmpl new file mode 100644 index 0000000000..d8ff133d27 --- /dev/null +++ b/nano/templates/turret_control.tmpl @@ -0,0 +1,41 @@ +
+
+ Behaviour controls are {{:data.locked ? "locked" : "unlocked"}}. +
+
+
+{{if data.access}} +
+
+ Turret Status: +
+
+ {{:helper.link('Enabled', null, {'command' : 'enable', 'value' : 1}, null, data.enabled ?'redButton' : null)}} + {{:helper.link('Disabled',null, {'command' : 'enable', 'value' : 0}, null,!data.enabled ? 'selected' : null)}} +
+
+ + {{if data.is_lethal}} +
+
+ Lethal Mode: +
+
+ {{:helper.link('On', null, {'command' : 'lethal', 'value' : 1}, null, data.lethal ?'redButton' : null)}} + {{:helper.link('Off',null, {'command' : 'lethal', 'value' : 0}, null,!data.lethal ? 'selected' : null)}} +
+
+ {{/if}} + + {{for data.settings}} +
+
+ {{:value.category}} +
+
+ {{:helper.link('On', null, {'command' : value.setting, 'value' : 1}, null, value.value ? 'selected' : null)}} + {{:helper.link('Off',null, {'command' : value.setting, 'value' : 0}, null,!value.value ? 'selected' : null)}} +
+
+ {{/for}} +{{/if}}