Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 38 additions & 18 deletions src/features/government/components/UpkeepPriceCalculator.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script setup lang="ts">
import { ComputedRef, Ref, computed, ref, watch } from "vue";

import { useI18n } from "vue-i18n";
const { t } = useI18n();

// Composables
import { useUpkeepBuildings } from "@/features/government/composables/useUpkeepBuildings";
import { useUpkeepPriceCalculator } from "@/features/government/composables/useUpkeepPriceCalculator";

// Util
import { formatNumber } from "@/util/numbers";
import { capitalizeString } from "@/util/text";

// Components
import MaterialTile from "@/features/material_tile/components/MaterialTile.vue";
Expand Down Expand Up @@ -82,7 +84,7 @@
<div class="text-center w-100 py-3">
<PProgressBar :step="1" :total="2" />
<div class="pt-3 text-xs text-white/60">
Calculating Upkeep Material Prices
{{ $t("upkeep_price_calculator.calculator.calculating") }}
</div>
</div>
</div>
Expand All @@ -97,23 +99,31 @@
selectedNeedType === needType ? 'primary' : 'secondary'
"
@click="selectedNeedType = needType">
{{ capitalizeString(needType) }}
{{
$t(
`upkeep_price_calculator.calculator.needs.${needType}`
)
}}
</PButton>
</PButtonGroup>
</div>

<!-- Material Details Section -->
<div>
<h3 class="text-sm font-semibold text-white/80 mb-3">
Material Details
{{ $t("upkeep_price_calculator.calculator.details.title") }}
</h3>
<XNDataTable
:data="currentResults"
striped
:pagination="{ pageSize: 50 }">
<XNDataTableColumn
key="ticker"
title="Material"
:title="
t(
'upkeep_price_calculator.calculator.details.table.material'
)
"
sorter="default">
<template #render-cell="{ rowData }">
<MaterialTile
Expand All @@ -123,7 +133,11 @@
</XNDataTableColumn>
<XNDataTableColumn
key="buildingTicker"
title="Building"
:title="
t(
'upkeep_price_calculator.calculator.details.table.building'
)
"
sorter="default">
<template #render-cell="{ rowData }">
<span class="font-bold">{{
Expand All @@ -133,11 +147,13 @@
</XNDataTableColumn>
<XNDataTableColumn
key="pricePerNeed"
title="ȼ/Need"
:title="
t(
'upkeep_price_calculator.calculator.details.table.price_need'
)
"
title-align="right"
sorter="default">
<template #title>
<div class="text-end">ȼ/Need</div>
</template>
<template #render-cell="{ rowData }">
<div
class="text-end text-nowrap"
Expand All @@ -153,11 +169,13 @@
</XNDataTableColumn>
<XNDataTableColumn
key="cxPrice"
title="CX Price"
:title="
t(
'upkeep_price_calculator.calculator.details.table.cx_price'
)
"
title-align="right"
sorter="default">
<template #title>
<div class="text-end">CX Price</div>
</template>
<template #render-cell="{ rowData }">
<div
class="text-end text-nowrap"
Expand All @@ -177,11 +195,13 @@

<XNDataTableColumn
key="qtyPerDay"
title="Qty/Day"
:title="
t(
'upkeep_price_calculator.calculator.details.table.qty_day'
)
"
title-align="right"
sorter="default">
<template #title>
<div class="text-end">Qty/Day</div>
</template>
<template #render-cell="{ rowData }">
<div class="text-end text-nowrap">
{{ formatNumber(rowData.qtyPerDay, 2) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,27 @@
</script>

<template>
<h3 class="font-bold pb-3">Building Expertises</h3>
<h3 class="font-bold pb-3">
{{ $t("production_chains.analysis_expertise.title") }}
</h3>

<PTable striped>
<thead>
<tr>
<th>Expertise</th>
<th class="text-end!">Materials</th>
<th>
{{
$t(
"production_chains.analysis_expertise.table.expertise"
)
}}
</th>
<th class="text-end!">
{{
$t(
"production_chains.analysis_expertise.table.materials"
)
}}
</th>
</tr>
</thead>
<tbody>
Expand All @@ -39,8 +53,7 @@
<span
class="py-1 px-2"
:style="`background-color:
${EXPERTISECOLORS[expertise as
BUILDING_EXPERTISE_TYPE]};`">
${EXPERTISECOLORS[expertise as BUILDING_EXPERTISE_TYPE]};`">
{{ capitalizeString(expertise) }}
</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@
</script>

<template>
<h3 class="font-bold py-3">Materials</h3>
<h3 class="font-bold py-3">
{{ $t("production_chains.analysis_materials.title") }}
</h3>
<PTable striped>
<thead>
<tr>
<th>Material</th>
<th>Amount</th>
<th>
{{
$t(
"production_chains.analysis_materials.table.material"
)
}}
</th>
<th>
{{
$t("production_chains.analysis_materials.table.amount")
}}
</th>
</tr>
</thead>
<tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,26 @@
</script>

<template>
<h3 class="font-bold py-3">Workforce</h3>
<h3 class="font-bold py-3">
{{ $t("production_chains.analysis_workforce.title") }}
</h3>
<PTable striped>
<thead>
<tr>
<th>Workforce</th>
<th class="text-end!">Required</th>
<th>
{{
$t(
"production_chains.analysis_workforce.table.workforce"
)
}}
</th>
<th class="text-end!">
{{
$t(
"production_chains.analysis_workforce.table.required"
)
}}
</th>
</tr>
</thead>
<tbody>
Expand Down
7 changes: 7 additions & 0 deletions src/locales/en_US/game.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,12 @@
"WORKFORCE_TECHNICIANS": "TEC",
"WORKFORCE_ENGINEERS": "ENG",
"WORKFORCE_SCIENTISTS": "SCI"
},
"upkeep": {
"safety": "Safety",
"health": "Health",
"comfort": "Comfort",
"culture": "Culture",
"education": "Education"
}
}
25 changes: 25 additions & 0 deletions src/locales/en_US/hq_upgrade_calculator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"view_title": "HQ",
"title": "HQ Upgrade Calculator",
"form": {
"from_level": "From HQ Level",
"to_level": "To HQ Level",
"cx_preference": "@:terms.cx Preference",
"show_locations": "Show Locations"
},
"cost": {
"total_cost": "Total @:terms.cost",
"total_weight": "Total @:terms.weight",
"total_volume": "Total @:terms.volume"
},
"table": {
"material": "@:terms.materials",
"amount": "@:terms.amount",
"storage": "@:terms.storage",
"override_stock": "Override Stock",
"required": "Required",
"cost_unit": "Cost / Unit",
"cost_total": "Total Cost",
"storage_locations": "@:terms.storage Locations"
}
}
35 changes: 35 additions & 0 deletions src/locales/en_US/production_chains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"view_title": "Production Chains",
"title": "Production Chains",
"configuration": {
"title": "Configuration",
"material": "@:terms.materials",
"recipe_runs": "Recipe Runs",
"node_color": "Node Color",
"terminals": "Terminals",
"terminals_placeholder": "Comma-separated material tickers",
"terminals_info": "Terminals are materials whose inputs are excluded from the graph, useful if you buy them on the CX or locally and don't need to produce them.",
"recipe_selection": "Recipe Selection"
},
"analysis_materials": {
"title": "Materials",
"table": {
"material": "@:terms.materials",
"amount": "@:terms.amount"
}
},
"analysis_expertise": {
"title": "Building Expertises",
"table": {
"expertise": "Expertise",
"materials": "@:terms.materials_plural"
}
},
"analysis_workforce": {
"title": "Workforce",
"table": {
"workforce": "Workforce",
"required": "Required"
}
}
}
Loading
Loading