This should wrap it up.

This commit is contained in:
Shadow Quill
2020-07-28 22:25:55 -05:00
parent 6a98408032
commit 8aee7c47db
3 changed files with 21 additions and 12 deletions
+4 -2
View File
@@ -47,8 +47,10 @@
var/laws[0]
for(var/datum/ai_law/law in occupant.laws.all_laws())
laws.Add(num2text(law.get_index()) + ". " + law.law)
if(law in occupant.laws.ion_laws) // If we're an ion law, give it an ion index code
laws.Add(ionnum() + ". " + law.law)
else
laws.Add(num2text(law.get_index()) + ". " + law.law)
data["laws"] = laws
return data
+14 -7
View File
@@ -15,18 +15,23 @@ export const AIFixer = (props, context) => {
</Window>
);
} else {
let workingAI = null;
let workingAI = null; // If the AI is dead (stat = 2) or isn't existent
if (data.stat === 2 || data.stat === null) {
workingAI = false;
} else {
workingAI = true;
}
let integrityColor = null;
let integrityColor = null; // Handles changing color of the integrity bar
if (data.integrity >= 75) { integrityColor = 'green'; }
else if (data.integrity >= 25) { integrityColor = 'yellow'; }
else { integrityColor = 'red'; }
let integrityFull = null; // If integrity >= 100, prevents overchar
if (data.integrity >= 100) { integrityFull = true; }
else { integrityFull = false; }
return (
<Window>
<Window.Content>
@@ -38,7 +43,9 @@ export const AIFixer = (props, context) => {
<Section title="Information">
<LabeledList>
<LabeledList.Item label="Integrity">
<ProgressBar color={integrityColor} value={data.integrity/100} />
<ProgressBar
color={integrityColor}
value={data.integrity/100} />
</LabeledList.Item>
<LabeledList.Item
label="Status"
@@ -46,12 +53,12 @@ export const AIFixer = (props, context) => {
{workingAI ? "Functional" : "Non-Functional"}
</LabeledList.Item>
</LabeledList>
</Section>
</Section>
<Section title="Laws">
<Box>
{data.laws.map((value, key) => (
<Box kay={key} display="inline-block">
<Box key={key} display="inline-block">
{value}
</Box>
))}
@@ -77,8 +84,8 @@ export const AIFixer = (props, context) => {
<LabeledList.Item label="Start Repairs">
<Button
icon="wrench"
disabled={data.integrity >= 100 || data.active}
content={data.integrity >= 100 ? 'Already Repaired' : 'Repair'}
disabled={integrityFull || data.active}
content={integrityFull ? 'Already Repaired' : 'Repair'}
onClick={() => act("fix")} />
</LabeledList.Item>
</LabeledList>
File diff suppressed because one or more lines are too long