fix weapon descriptions like Lions Arma Luminous
This commit is contained in:
+42
-16
@@ -50,11 +50,11 @@ const getPrimaryColor = (catalog) => {
|
|||||||
case "Adeptus Mechanicus":
|
case "Adeptus Mechanicus":
|
||||||
return "#536766";
|
return "#536766";
|
||||||
case "Astra Militarum":
|
case "Astra Militarum":
|
||||||
return "#536766";
|
return "#375441";
|
||||||
case "Chaos Daemons":
|
case "Chaos Daemons":
|
||||||
return "#536766";
|
return "#536766";
|
||||||
case "Chaos Space Marines":
|
case "Chaos Space Marines":
|
||||||
return "#536766";
|
return "#1d3138";
|
||||||
case "Death Guard":
|
case "Death Guard":
|
||||||
return "#536766";
|
return "#536766";
|
||||||
case "Drukhari":
|
case "Drukhari":
|
||||||
@@ -68,9 +68,9 @@ const getPrimaryColor = (catalog) => {
|
|||||||
case "Imperial Knights":
|
case "Imperial Knights":
|
||||||
return "#536766";
|
return "#536766";
|
||||||
case "Necrons":
|
case "Necrons":
|
||||||
return "#536766";
|
return "#005c2f";
|
||||||
case "Orks":
|
case "Orks":
|
||||||
return "#536766";
|
return "#4b6621";
|
||||||
case "Sisters of Battle":
|
case "Sisters of Battle":
|
||||||
return "#536766";
|
return "#536766";
|
||||||
case "Space Marines":
|
case "Space Marines":
|
||||||
@@ -126,14 +126,11 @@ const Unit = ({ unit, index, catalog, onePerPage }) => {
|
|||||||
cost,
|
cost,
|
||||||
} = unit;
|
} = unit;
|
||||||
|
|
||||||
const hasDifferentProfiles = weapons.some(
|
|
||||||
(weapon) =>
|
|
||||||
weapon.selectionName !== weapon.name &&
|
|
||||||
!weapon.name.includes("(Shooting)") &&
|
|
||||||
!weapon.name.includes("(Melee)")
|
|
||||||
);
|
|
||||||
const meleeWeapons = weapons
|
const meleeWeapons = weapons
|
||||||
.filter((weapon) => weapon.range === "Melee" && weapon.range !== "-")
|
.filter(
|
||||||
|
(weapon) =>
|
||||||
|
weapon.range === "Melee" && weapon.range !== "-" && weapon.range !== ""
|
||||||
|
)
|
||||||
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
|
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
|
||||||
if (meleeWeapons.length === 0) {
|
if (meleeWeapons.length === 0) {
|
||||||
meleeWeapons.push({
|
meleeWeapons.push({
|
||||||
@@ -147,9 +144,22 @@ const Unit = ({ unit, index, catalog, onePerPage }) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const rangedWeapons = weapons
|
const rangedWeapons = weapons
|
||||||
.filter((weapon) => weapon.range !== "Melee" && weapon.range !== "-")
|
.filter(
|
||||||
|
(weapon) =>
|
||||||
|
weapon.range !== "Melee" && weapon.range !== "-" && weapon.range !== ""
|
||||||
|
)
|
||||||
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
|
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
|
||||||
|
|
||||||
|
const weaponDescriptions = weapons
|
||||||
|
.filter((weapon) => weapon.range === "-" || weapon.range === "")
|
||||||
|
.sort((a, b) => a.selectionName.localeCompare(b.selectionName));
|
||||||
|
const modelsWithDifferentProfiles = weapons.filter(
|
||||||
|
(weapon) =>
|
||||||
|
weapon.selectionName !== weapon.name &&
|
||||||
|
!weapon.name.includes("(Shooting)") &&
|
||||||
|
!weapon.name.includes("(Melee)")
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
@@ -284,9 +294,24 @@ const Unit = ({ unit, index, catalog, onePerPage }) => {
|
|||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
<div style={{ flex: "1" }}></div>
|
<div style={{ flex: "1" }}></div>
|
||||||
{hasDifferentProfiles && (
|
|
||||||
<table className="weapons-table" style={{ width: "100%" }}>
|
<table className="weapons-table" style={{ width: "100%" }}>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{weaponDescriptions.map((weapon, index) => (
|
||||||
|
<tr key={index} className="emptyRow noBorderTop">
|
||||||
|
<td style={{ width: 37, borderTop: "none" }}>{Arrow}</td>
|
||||||
|
<td
|
||||||
|
style={{
|
||||||
|
textAlign: "left",
|
||||||
|
fontSize: ".8em",
|
||||||
|
paddingLeft: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{weapon.name} - {weapon.abilities}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
{modelsWithDifferentProfiles.length > 0 &&
|
||||||
|
!weaponDescriptions.length && (
|
||||||
<tr className="emptyRow noBorderTop">
|
<tr className="emptyRow noBorderTop">
|
||||||
<td style={{ width: 37, borderTop: "none" }}>{Arrow}</td>
|
<td style={{ width: 37, borderTop: "none" }}>{Arrow}</td>
|
||||||
<td
|
<td
|
||||||
@@ -297,13 +322,14 @@ const Unit = ({ unit, index, catalog, onePerPage }) => {
|
|||||||
paddingLeft: 0,
|
paddingLeft: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Before selecting targets for this weapon, select one of its
|
Before selecting targets for this weapon, select one of
|
||||||
profiles to make attacks with.
|
its profiles to make attacks with.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
)}
|
|
||||||
<Keywords keywords={keywords} />
|
<Keywords keywords={keywords} />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ export class Upgrade extends BaseNotes {
|
|||||||
export class Weapon extends Upgrade {
|
export class Weapon extends Upgrade {
|
||||||
selectionName = "";
|
selectionName = "";
|
||||||
|
|
||||||
range = "Melee";
|
range = "";
|
||||||
type = "Melee";
|
type = "Melee";
|
||||||
str = "user";
|
str = "user";
|
||||||
ap = "";
|
ap = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user