mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
Fix RIG crashes & Chem Injector
This commit is contained in:
@@ -98,12 +98,13 @@
|
|||||||
|
|
||||||
if(module.charges && module.charges.len)
|
if(module.charges && module.charges.len)
|
||||||
module_data["charges"] = list()
|
module_data["charges"] = list()
|
||||||
var/datum/rig_charge/selected = module.charges[module.charge_selected]
|
var/datum/rig_charge/selected = module.charges["[module.charge_selected]"]
|
||||||
|
module_data["realchargetype"] = module.charge_selected
|
||||||
module_data["chargetype"] = selected ? "[selected.display_name]" : "none"
|
module_data["chargetype"] = selected ? "[selected.display_name]" : "none"
|
||||||
|
|
||||||
for(var/chargetype in module.charges)
|
for(var/chargetype in module.charges)
|
||||||
var/datum/rig_charge/charge = module.charges[chargetype]
|
var/datum/rig_charge/charge = module.charges[chargetype]
|
||||||
module_data["charges"] += list(list("caption" = "[chargetype] ([charge.charges])", "index" = "[chargetype]"))
|
module_data["charges"] += list(list("caption" = "[charge.display_name] ([charge.charges])", "index" = "[chargetype]"))
|
||||||
|
|
||||||
module_list += list(module_data)
|
module_list += list(module_data)
|
||||||
i++
|
i++
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ const RIGSuitHardware = (props, context) => {
|
|||||||
selected={helmetDeployed}
|
selected={helmetDeployed}
|
||||||
onClick={() => act("toggle_piece", { piece: 'helmet' })} />
|
onClick={() => act("toggle_piece", { piece: 'helmet' })} />
|
||||||
)}>
|
)}>
|
||||||
{capitalize(helmet)}
|
{helmet ? capitalize(helmet) : "ERROR"}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item
|
<LabeledList.Item
|
||||||
label="Gauntlets"
|
label="Gauntlets"
|
||||||
@@ -165,7 +165,7 @@ const RIGSuitHardware = (props, context) => {
|
|||||||
selected={gauntletsDeployed}
|
selected={gauntletsDeployed}
|
||||||
onClick={() => act("toggle_piece", { piece: 'gauntlets' })} />
|
onClick={() => act("toggle_piece", { piece: 'gauntlets' })} />
|
||||||
)}>
|
)}>
|
||||||
{capitalize(gauntlets)}
|
{gauntlets ? capitalize(gauntlets) : "ERROR"}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item
|
<LabeledList.Item
|
||||||
label="Boots"
|
label="Boots"
|
||||||
@@ -177,7 +177,7 @@ const RIGSuitHardware = (props, context) => {
|
|||||||
selected={bootsDeployed}
|
selected={bootsDeployed}
|
||||||
onClick={() => act("toggle_piece", { piece: 'boots' })} />
|
onClick={() => act("toggle_piece", { piece: 'boots' })} />
|
||||||
)}>
|
)}>
|
||||||
{capitalize(boots)}
|
{boots ? capitalize(boots) : "ERROR"}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item
|
<LabeledList.Item
|
||||||
label="Chestpiece"
|
label="Chestpiece"
|
||||||
@@ -189,7 +189,7 @@ const RIGSuitHardware = (props, context) => {
|
|||||||
selected={chestDeployed}
|
selected={chestDeployed}
|
||||||
onClick={() => act("toggle_piece", { piece: 'chest' })} />
|
onClick={() => act("toggle_piece", { piece: 'chest' })} />
|
||||||
)}>
|
)}>
|
||||||
{capitalize(chest)}
|
{chest ? capitalize(chest) : "ERROR"}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
</LabeledList>
|
</LabeledList>
|
||||||
</Section>
|
</Section>
|
||||||
@@ -269,7 +269,7 @@ const RIGSuitModules = (props, context) => {
|
|||||||
{module.damage >= 2 ? (
|
{module.damage >= 2 ? (
|
||||||
<Box color="bad">-- MODULE DESTROYED --</Box>
|
<Box color="bad">-- MODULE DESTROYED --</Box>
|
||||||
) : (
|
) : (
|
||||||
<Flex>
|
<Flex spacing={1}>
|
||||||
<Flex.Item grow={1}>
|
<Flex.Item grow={1}>
|
||||||
<Box color="average">Engage: {module.engagecost}</Box>
|
<Box color="average">Engage: {module.engagecost}</Box>
|
||||||
<Box color="average">Active: {module.activecost}</Box>
|
<Box color="average">Active: {module.activecost}</Box>
|
||||||
@@ -278,33 +278,33 @@ const RIGSuitModules = (props, context) => {
|
|||||||
<Flex.Item grow={1}>
|
<Flex.Item grow={1}>
|
||||||
{module.desc}
|
{module.desc}
|
||||||
</Flex.Item>
|
</Flex.Item>
|
||||||
{module.charges ? (
|
|
||||||
<Flex.Item grow={1}>
|
|
||||||
<Section title="Module Charges">
|
|
||||||
<LabeledList>
|
|
||||||
<LabeledList.Item label="Selected">
|
|
||||||
{capitalize(module.chargetype)}
|
|
||||||
</LabeledList.Item>
|
|
||||||
{module.charges.map((charge, i) => (
|
|
||||||
<LabeledList.Item
|
|
||||||
key={charge.caption}
|
|
||||||
label={capitalize(charge.caption)}
|
|
||||||
buttons={(
|
|
||||||
<Button
|
|
||||||
icon="arrow-right"
|
|
||||||
onClick={() => act("interact_module", {
|
|
||||||
"module": module.index,
|
|
||||||
"module_mode": "select_charge_type",
|
|
||||||
"charge_type": i,
|
|
||||||
})} />
|
|
||||||
)} />
|
|
||||||
))}
|
|
||||||
</LabeledList>
|
|
||||||
</Section>
|
|
||||||
</Flex.Item>
|
|
||||||
) : null}
|
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
{module.charges ? (
|
||||||
|
<Flex.Item>
|
||||||
|
<Section title="Module Charges">
|
||||||
|
<LabeledList>
|
||||||
|
<LabeledList.Item label="Selected">
|
||||||
|
{capitalize(module.chargetype)}
|
||||||
|
</LabeledList.Item>
|
||||||
|
{module.charges.map((charge, i) => (
|
||||||
|
<LabeledList.Item
|
||||||
|
key={charge.caption}
|
||||||
|
label={capitalize(charge.caption)}>
|
||||||
|
<Button
|
||||||
|
selected={module.realchargetype === charge.index}
|
||||||
|
icon="arrow-right"
|
||||||
|
onClick={() => act("interact_module", {
|
||||||
|
"module": module.index,
|
||||||
|
"module_mode": "select_charge_type",
|
||||||
|
"charge_type": charge.index,
|
||||||
|
})} />
|
||||||
|
</LabeledList.Item>
|
||||||
|
))}
|
||||||
|
</LabeledList>
|
||||||
|
</Section>
|
||||||
|
</Flex.Item>
|
||||||
|
) : null}
|
||||||
</Section>
|
</Section>
|
||||||
))}
|
))}
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user