Skip to content

Commit

Permalink
fix pre_terrain reference
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Nov 9, 2024
1 parent 4dadf9b commit f9a298f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
18 changes: 9 additions & 9 deletions src/types/ToolQuality.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { t } from "@transifex/native";
import { getContext } from "svelte";
import { byName, CddaData, singularName } from "../data";
import { byName, CddaData, singularName, i18n } from "../data";
import LimitedList from "../LimitedList.svelte";
import type { Item, VehiclePart, ToolQuality, Construction } from "../types";
import ItemSymbol from "./item/ItemSymbol.svelte";
Expand Down Expand Up @@ -202,14 +202,14 @@ constructionsUsingQualityByLevelList.forEach(([, constructions]) => {
<LimitedList items={constructions} let:item={f}>
<ThingLink id={f.group} type="construction_group" />
{#if f.pre_terrain}
on <ItemSymbol
item={data.byId(
f.pre_terrain.startsWith("f_") ? "furniture" : "terrain",
f.pre_terrain
)} />
<ThingLink
type={f.pre_terrain.startsWith("f_") ? "furniture" : "terrain"}
id={f.pre_terrain} />
on {#each [f.pre_terrain].flat() as preTerrain, i}
{@const itemType = preTerrain.startsWith("f_")
? "furniture"
: "terrain"}
{#if i !== 0}{i18n.__(" OR ")}{/if}
<ItemSymbol item={data.byId(itemType, preTerrain)} />
<ThingLink type={itemType} id={preTerrain} />
{/each}
{/if}
</LimitedList>
</dd>
Expand Down
34 changes: 17 additions & 17 deletions src/types/item/ComponentOf.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { t } from "@transifex/native";
import { getContext } from "svelte";
import { CddaData, singularName } from "../../data";
import { CddaData, i18n, singularName } from "../../data";
import LimitedList from "../../LimitedList.svelte";
import ThingLink from "../ThingLink.svelte";
import ItemSymbol from "./ItemSymbol.svelte";
Expand Down Expand Up @@ -119,14 +119,14 @@ const toolResults = [...toolRecipes].sort((a, b) =>
<LimitedList items={constructions} let:item={f}>
<ThingLink id={f.group} type="construction_group" />
{#if f.pre_terrain}
on <ItemSymbol
item={data.byId(
f.pre_terrain.startsWith("f_") ? "furniture" : "terrain",
f.pre_terrain
)} />
<ThingLink
type={f.pre_terrain.startsWith("f_") ? "furniture" : "terrain"}
id={f.pre_terrain} />
on {#each [f.pre_terrain].flat() as preTerrain, i}
{@const itemType = preTerrain.startsWith("f_")
? "furniture"
: "terrain"}
{#if i !== 0}{i18n.__(" OR ")}{/if}
<ItemSymbol item={data.byId(itemType, preTerrain)} />
<ThingLink type={itemType} id={preTerrain} />
{/each}
{/if}
</LimitedList>
</section>
Expand All @@ -142,14 +142,14 @@ const toolResults = [...toolRecipes].sort((a, b) =>
<LimitedList items={toolConstructions} let:item={f}>
<ThingLink id={f.group} type="construction_group" />
{#if f.pre_terrain}
on <ItemSymbol
item={data.byId(
f.pre_terrain.startsWith("f_") ? "furniture" : "terrain",
f.pre_terrain
)} />
<ThingLink
type={f.pre_terrain.startsWith("f_") ? "furniture" : "terrain"}
id={f.pre_terrain} />
on {#each [f.pre_terrain].flat() as preTerrain, i}
{@const itemType = preTerrain.startsWith("f_")
? "furniture"
: "terrain"}
{#if i !== 0}{i18n.__(" OR ")}{/if}
<ItemSymbol item={data.byId(itemType, preTerrain)} />
<ThingLink type={itemType} id={preTerrain} />
{/each}
{/if}
</LimitedList>
</section>
Expand Down
18 changes: 9 additions & 9 deletions src/types/item/ConstructionByproduct.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { t } from "@transifex/native";
import { getContext } from "svelte";
import { byName, CddaData } from "../../data";
import { byName, CddaData, i18n } from "../../data";
import LimitedList from "../../LimitedList.svelte";
import ThingLink from "../ThingLink.svelte";
import ItemSymbol from "./ItemSymbol.svelte";
Expand All @@ -28,14 +28,14 @@ const constructions = data
<LimitedList items={constructions} let:item={f}>
<ThingLink id={f.group} type="construction_group" />
{#if f.pre_terrain}
on <ItemSymbol
item={data.byId(
f.pre_terrain.startsWith("f_") ? "furniture" : "terrain",
f.pre_terrain
)} />
<ThingLink
type={f.pre_terrain.startsWith("f_") ? "furniture" : "terrain"}
id={f.pre_terrain} />
on {#each [f.pre_terrain].flat() as preTerrain, i}
{@const itemType = preTerrain.startsWith("f_")
? "furniture"
: "terrain"}
{#if i !== 0}{i18n.__(" OR ")}{/if}
<ItemSymbol item={data.byId(itemType, preTerrain)} />
<ThingLink type={itemType} id={preTerrain} />
{/each}
{/if}
</LimitedList>
</section>
Expand Down

0 comments on commit f9a298f

Please sign in to comment.