mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-16 13:13:03 +00:00
Final version of Mech Bay Charging Console NanoUI implementation
This commit is contained in:
@@ -196,13 +196,14 @@
|
|||||||
var/list/data = list()
|
var/list/data = list()
|
||||||
data["has_floor"] = recharge_floor
|
data["has_floor"] = recharge_floor
|
||||||
data["has_port"] = recharge_port
|
data["has_port"] = recharge_port
|
||||||
data["has_mech"] = !isnull(recharge_floor.recharging_mecha)
|
if(recharge_floor && recharge_floor.recharging_mecha && recharge_floor.recharging_mecha.cell)
|
||||||
if(recharge_floor && recharge_floor.recharging_mecha)
|
data["has_mech"] = 1
|
||||||
data["mecha_name"] = recharge_floor.recharging_mecha || "None"
|
data["mecha_name"] = recharge_floor.recharging_mecha || "None"
|
||||||
data["mecha_charge"] = isnull(recharge_floor.recharging_mecha) ? 0 : recharge_floor.recharging_mecha.cell.charge
|
data["mecha_charge"] = isnull(recharge_floor.recharging_mecha) ? 0 : recharge_floor.recharging_mecha.cell.charge
|
||||||
data["mecha_maxcharge"] = isnull(recharge_floor.recharging_mecha) ? 0 : recharge_floor.recharging_mecha.cell.maxcharge
|
data["mecha_maxcharge"] = isnull(recharge_floor.recharging_mecha) ? 0 : recharge_floor.recharging_mecha.cell.maxcharge
|
||||||
data["mecha_charge_percentage"] = round(recharge_floor.recharging_mecha.cell.percent())
|
data["mecha_charge_percentage"] = isnull(recharge_floor.recharging_mecha) ? 0 : round(recharge_floor.recharging_mecha.cell.percent())
|
||||||
|
else
|
||||||
|
data["has_mech"] = 0
|
||||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||||
if (!ui)
|
if (!ui)
|
||||||
// the ui does not exist, so we'll create a new() one
|
// the ui does not exist, so we'll create a new() one
|
||||||
|
|||||||
67
nano/templates/mech_bay_console.tmpl
Normal file
67
nano/templates/mech_bay_console.tmpl
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<h3>Subsystems</h3>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Recharge Station:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{if data.has_floor}}
|
||||||
|
<span class='good'>OK</span>
|
||||||
|
{{else}}
|
||||||
|
<span class='bad'>ERROR</span>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Power Port:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{if data.has_port}}
|
||||||
|
<span class='good'>OK</span>
|
||||||
|
{{else}}
|
||||||
|
<span class='bad'>ERROR</span>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Mecha:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{if data.has_mech}}
|
||||||
|
<span class='good'>LOCATED ({{:data.mecha_name}})</span>
|
||||||
|
{{else}}
|
||||||
|
<span class='average'>NONE</span>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{if data.has_mech}}
|
||||||
|
<h3>Charging</h3>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Charge Level:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{:helper.displayBar(data.mecha_charge_percentage, 0, 100)}}
|
||||||
|
<div class="statusValue">
|
||||||
|
{{:data.mecha_charge_percentage}}%<br>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Cell Rating:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{:data.mecha_maxcharge}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="itemLabel">
|
||||||
|
Cell Charge:
|
||||||
|
</div>
|
||||||
|
<div class="itemContent">
|
||||||
|
{{:data.mecha_charge}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
Reference in New Issue
Block a user