addresses comments

This commit is contained in:
Kyep
2020-07-05 01:32:41 -07:00
parent 1a2306572b
commit deccd5ad17
3 changed files with 37 additions and 24 deletions
+8 -6
View File
@@ -336,13 +336,15 @@
/obj/machinery/computer/bsa_control/tgui_act(action, params)
if(..())
return
if(action == "build")
cannon = deploy()
if(action == "fire")
fire(usr)
if(action == "recalibrate")
calibrate(usr)
switch(action)
if("build")
cannon = deploy()
if("fire")
fire(usr)
if("recalibrate")
calibrate(usr)
update_icon()
return TRUE
/obj/machinery/computer/bsa_control/proc/calibrate(mob/user)
var/list/gps_locators = list()
@@ -4,6 +4,26 @@ import { Window } from "../layouts";
export const BlueSpaceArtilleryControl = (props, context) => {
const { act, data } = useBackend(context);
let alertStatus;
if (data.ready) {
alertStatus = (
<LabeledList.Item label="Status" color="green">
Ready
</LabeledList.Item>
);
} else if (data.reloadtime_text) {
alertStatus = (
<LabeledList.Item label="Reloading In" color="red">
{data.reloadtime_text}
</LabeledList.Item>
);
} else {
alertStatus = (
<LabeledList.Item label="Status" color="red">
No cannon connected!
</LabeledList.Item>
);
}
return (
<Window>
<Window.Content>
@@ -23,27 +43,18 @@ export const BlueSpaceArtilleryControl = (props, context) => {
{data.ready === 1 && !!data.target && (
<LabeledList.Item label="Firing">
<Button
icon="burn"
content={"FIRE!"}
color={"red"}
icon="skull"
content="FIRE!"
color="red"
onClick={() => act("fire")} />
</LabeledList.Item>
)}
{!data.ready && data.reloadtime_text && (
<LabeledList.Item label="Reloading In">
{data.reloadtime_text}
</LabeledList.Item>
)}
{!data.ready && !data.reloadtime_text && (
<LabeledList.Item label="Status" color="red">
No cannon connected!
</LabeledList.Item>
)}
{alertStatus}
{!data.connected && (
<LabeledList.Item label="Status">
<LabeledList.Item label="Maintenance">
<Button
icon="wrench"
content={"Complete Deployment"}
content="Complete Deployment"
onClick={() => act("build")} />
</LabeledList.Item>
)}
File diff suppressed because one or more lines are too long