Slight Adjustments, Added Fuels Output
This commit is contained in:
parent
42628b6a57
commit
f85faeb6ad
3 changed files with 89 additions and 30 deletions
|
@ -169,6 +169,30 @@ const localization = new Map([
|
||||||
["en-GB", "Atmospheric Density"],
|
["en-GB", "Atmospheric Density"],
|
||||||
["de-DE", "Atmosphärendichte"]
|
["de-DE", "Atmosphärendichte"]
|
||||||
])],
|
])],
|
||||||
|
["results", new Map([
|
||||||
|
["en-GB", "Results"],
|
||||||
|
["de-DE", "Ergebnisse"],
|
||||||
|
])],
|
||||||
|
["settings", new Map([
|
||||||
|
["en-GB", "Settings"],
|
||||||
|
["de-DE", "Einstellungen"],
|
||||||
|
])],
|
||||||
|
["fuels", new Map([
|
||||||
|
["en-GB", "Fuels"],
|
||||||
|
["de-DE", "Treibstoffe"],
|
||||||
|
])],
|
||||||
|
["electric", new Map([
|
||||||
|
["en-GB", "Electricity"],
|
||||||
|
["de-DE", "Elektrizität"],
|
||||||
|
])],
|
||||||
|
["hydrogen", new Map([
|
||||||
|
["en-GB", "Hydrogen"],
|
||||||
|
["de-DE", "Wasserstoff"],
|
||||||
|
])],
|
||||||
|
["deuterium", new Map([
|
||||||
|
["en-GB", "Deuterium"],
|
||||||
|
["de-DE", "Deuterium"],
|
||||||
|
])]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {Thruster, THRUSTER_LIST} from "$lib/thruster.svelte";
|
import {Thruster, THRUSTER_LIST, THRUSTER_TYPE_LIST} from "$lib/thruster.svelte";
|
||||||
import {Grid} from "$lib/grid";
|
import {Grid} from "$lib/grid";
|
||||||
import {INVENTORIES, Inventory} from "$lib/containers.svelte";
|
import {INVENTORIES, Inventory} from "$lib/containers.svelte";
|
||||||
|
import type {Fuel} from "$lib/fuel";
|
||||||
|
|
||||||
export class Ship {
|
export class Ship {
|
||||||
thrusters: Array<Thruster> = $state([]);
|
thrusters: Array<Thruster> = $state([]);
|
||||||
|
@ -91,4 +92,14 @@ export class Ship {
|
||||||
});
|
});
|
||||||
return thrust;
|
return thrust;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFuelTypes(): Array<Fuel> {
|
||||||
|
let fuels: Array<Fuel> = [];
|
||||||
|
this.thrusters.forEach((thruster) => {
|
||||||
|
if (!fuels.includes(thruster.details.type.details.fuel)) {
|
||||||
|
fuels.push(thruster.details.type.details.fuel)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return fuels;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -145,35 +145,59 @@
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
<Card.Content class="flex flex-col gap-3">
|
<Card.Content class="flex flex-col gap-3">
|
||||||
<Separator />
|
<Separator />
|
||||||
<Label for="gravity">{i18n.localize("gravity")}</Label>
|
<Card.Root>
|
||||||
<Input type="number" step="0.01" id="gravity" bind:value={gravity}/>
|
<Card.Header>
|
||||||
<Label for="atmosDensity">{i18n.localize("atmosDensity")}</Label>
|
<Card.Title>{i18n.localize("settings")}</Card.Title>
|
||||||
<Input type="number" step="0.01" id="atmosDensity" bind:value={atmosphericDensity}/>
|
</Card.Header>
|
||||||
<Separator />
|
<Card.Content class="flex flex-col gap-3">
|
||||||
<Label for="gridSize">{i18n.localize("gridSize")}</Label>
|
<Separator />
|
||||||
<div id="gridSize" class="flex gap-2">
|
<Label for="grid">{i18n.localize("gridSize")}</Label>
|
||||||
{#each Object.values(Grid) as size}
|
<div id="grid" class="flex gap-2">
|
||||||
{#if ship.grid === size}
|
{#each Object.values(Grid) as size}
|
||||||
<Button class="bg-primary">{i18n.localize(size)}</Button>
|
{#if ship.grid === size}
|
||||||
{:else}
|
<Button class="bg-primary">{i18n.localize(size)}</Button>
|
||||||
<Button variant="secondary" onclick={() => ship.grid = size}>{i18n.localize(size)}</Button>
|
{:else}
|
||||||
{/if}
|
<Button variant="secondary" onclick={() => ship.grid = size}>{i18n.localize(size)}</Button>
|
||||||
{/each}
|
{/if}
|
||||||
</div>
|
{/each}
|
||||||
<Separator />
|
</div>
|
||||||
<Label for="density">{i18n.localize("density")}</Label>
|
<Label for="gravity">{i18n.localize("gravity")}</Label>
|
||||||
<div id="density" class="flex gap-2">
|
<Input type="number" step="0.01" id="gravity" bind:value={gravity}/>
|
||||||
{#each Object.values(CargoMaterial) as value}
|
<Label for="density">{i18n.localize("density")}</Label>
|
||||||
{#if material === value}
|
<div id="density" class="flex gap-2">
|
||||||
<Button class="bg-primary">{i18n.localize(value.name)}</Button>
|
{#each Object.values(CargoMaterial) as value}
|
||||||
{:else}
|
{#if material === value}
|
||||||
<Button variant="secondary" onclick={() => material = value}>{i18n.localize(value.name)}</Button>
|
<Button class="bg-primary">{i18n.localize(value.name)}</Button>
|
||||||
{/if}
|
{:else}
|
||||||
{/each}
|
<Button variant="secondary" onclick={() => material = value}>{i18n.localize(value.name)}</Button>
|
||||||
</div>
|
{/if}
|
||||||
<Separator />
|
{/each}
|
||||||
<p>{i18n.localize("liftableVehcileWeight")}: {weightConversion(i18n, maxVehicleWeight)}</p>
|
</div>
|
||||||
<p>{i18n.localize("liftableWeight")}: {weightConversion(i18n, maxWeight)}</p>
|
<Label for="atmosDensity">{i18n.localize("atmosDensity")}</Label>
|
||||||
|
<Input type="number" step="0.01" id="atmosDensity" bind:value={atmosphericDensity}/>
|
||||||
|
</Card.Content>
|
||||||
|
</Card.Root>
|
||||||
|
<Card.Root>
|
||||||
|
<Card.Header>
|
||||||
|
<Card.Title>{i18n.localize("results")}</Card.Title>
|
||||||
|
</Card.Header>
|
||||||
|
<Card.Content class="flex flex-col gap-3">
|
||||||
|
<Separator />
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<p>{i18n.localize("liftableVehcileWeight")}:</p>
|
||||||
|
{#if maxVehicleWeight < 0}
|
||||||
|
<p class="text-destructive">{weightConversion(i18n, maxVehicleWeight)}</p>
|
||||||
|
{:else}
|
||||||
|
<p>{weightConversion(i18n, maxVehicleWeight)}</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<p>{i18n.localize("liftableWeight")}: {weightConversion(i18n, maxWeight)}</p>
|
||||||
|
<Separator />
|
||||||
|
<p>{i18n.localize("fuels")}:
|
||||||
|
{ship.getFuelTypes().map((fuel) => i18n.localize(fuel.name)).join(", ") }
|
||||||
|
</p>
|
||||||
|
</Card.Content>
|
||||||
|
</Card.Root>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card.Root>
|
</Card.Root>
|
||||||
<Card.Root class="flex-1 flex flex-col flex-grow">
|
<Card.Root class="flex-1 flex flex-col flex-grow">
|
||||||
|
|
Loading…
Reference in a new issue