diff --git a/src/blueprint/parser.ts b/src/blueprint/parser.ts index fa02399..c8a586b 100644 --- a/src/blueprint/parser.ts +++ b/src/blueprint/parser.ts @@ -698,6 +698,42 @@ const MonitorParamParser: ParamParser = { } } +export enum DispenserPlayerMode { + NONE = 0, + RECYCLE = 1, + BOTH = 2, + SUPPLY = 3, +} +export enum DispenserStorageMode { + NONE = 0, + SUPPLY = 1, + DEMAND = 2, +} +export interface DispenserParameters { + playerMode: DispenserPlayerMode; + storageMode: DispenserStorageMode; + workEnergyPerTick: number; + courierAutoReplenish: boolean; +} + +const dispenserParamParser: ParamParser = { + encodedSize() { return 128; }, + encode(p, a) { + setParam(a, 0, p.playerMode); + setParam(a, 1, p.storageMode); + setParam(a, 2, p.workEnergyPerTick); + setParam(a, 3, p.courierAutoReplenish ? 1 : 0); + }, + decode(a) { + return { + playerMode: getParam(a, 0), + storageMode: getParam(a, 1), + workEnergyPerTick: getParam(a, 2), + courierAutoReplenish: getParam(a, 3) > 0, + } + } +} + interface UnknownParamerters { parameters: Int32Array, } @@ -722,7 +758,7 @@ type AllParameters = AssembleParamerters | StationParameters | AdvancedMiningMac SplitterParameters | LabParamerters | BeltParameters | InserterParameters | TankParameters | StorageParameters | EjectorParameters | PowerGeneratorParameters | ArtifacialStarParameters | EnergyExchangerParameters | - MonitorParameters | BattleBaseParameters | UnknownParamerters; + MonitorParameters | BattleBaseParameters | DispenserParameters | UnknownParamerters; const parameterParsers = new Map>([ [2103, stationParamsParser(stationDesc)], @@ -745,6 +781,7 @@ const parameterParsers = new Map>([ [2209, energyExchangerParamParser], [2030, MonitorParamParser], [3009, battleBaseParamParser()], + [2107, dispenserParamParser], ]); for (const id of allAssemblers) { parameterParsers.set(id, assembleParamParser); diff --git a/src/components/BattleBaseInfo.vue b/src/components/BattleBaseInfo.vue index a05f247..e6fd5f7 100644 --- a/src/components/BattleBaseInfo.vue +++ b/src/components/BattleBaseInfo.vue @@ -25,10 +25,7 @@ {{ truth(p.autoReplenishFleet) }} -
- - {{(p.workEnergyPerTick * 60 / 1_000_000).toLocaleString([], { minimumSignificantDigits: 3, maximumSignificantDigits: 3 })}} MW -
+ @@ -37,6 +34,7 @@ import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { BattleBaseParameters, BlueprintBuilding, BattleBaseDroneConstructPriority } from '@/blueprint/parser'; import BuildingIcon from './BuildingIcon.vue'; +import WorkEnergyParam from './WorkEnergyParam.vue'; import { itemIconId } from '@/data/icons'; import { truth } from '@/utils'; diff --git a/src/components/BuildingInfoPanel.vue b/src/components/BuildingInfoPanel.vue index c19e9d7..2039457 100644 --- a/src/components/BuildingInfoPanel.vue +++ b/src/components/BuildingInfoPanel.vue @@ -54,6 +54,7 @@ {{ t('储液罐输出') }} {{ t('储液罐输入') }} + + + diff --git a/src/components/StationInfo.vue b/src/components/StationInfo.vue index 556812f..662c004 100644 --- a/src/components/StationInfo.vue +++ b/src/components/StationInfo.vue @@ -22,7 +22,7 @@
{{ truth(p.shipAutoReplenish) }}
-
{{(p.workEnergyPerTick * 60 / 1_000_000).toLocaleString([], { minimumFractionDigits: 1, maximumFractionDigits: 1 })}} MW
+
{{(Math.acos(p.tripRangeOfDrones) / Math.PI * 180.0).toLocaleString([], { maximumFractionDigits: 0 })}}°
{{tripRangeOfShips}}
{{truth(p.includeOrbitCollector)}}
@@ -40,6 +40,7 @@ import { LogisticRole, BlueprintBuilding, StationParameters, BlueprintData } fro import { Command, Updater } from '@/command'; import { BuildingInfo } from '@/blueprint/buildingInfo'; import { itemIconId } from '@/data/icons'; +import WorkEnergyParam from './WorkEnergyParam.vue'; const roleText = new Map([ [LogisticRole.None, '仓储'], diff --git a/src/components/WorkEnergyParam.vue b/src/components/WorkEnergyParam.vue new file mode 100644 index 0000000..2f4a924 --- /dev/null +++ b/src/components/WorkEnergyParam.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/data/items.ts b/src/data/items.ts index 87aad5d..21f2e66 100644 --- a/src/data/items.ts +++ b/src/data/items.ts @@ -67,6 +67,10 @@ export function isBattleBase(id: number) { return id === 3009; } +export function isDispenser(id: number) { + return id === 2107; +} + export const allAssemblers = new Set([ 2303, // 制造台 2304, diff --git a/src/locales/en.json b/src/locales/en.json index 61ba652..978be08 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -184,6 +184,7 @@ "齿轮": "Gear", "不满足": "Fail", "不选轨道": "None", + "不限回收类型": "Collect all types", "低音贝斯": "Sub Bass", "储液罐关": "OFF", "储液罐开": "ON", @@ -199,6 +200,13 @@ "包括轨道采集器": " Orbital Collector", "十倍射速": "10x Speed", "吉他": "Guitar", + "向玩家配送模式0": "Distribute to Icarus", + "向玩家配送模式1": "Provide to Icarus", + "向玩家配送模式2": "Collect from Icarus", + "向玩家配送模式3": "Provide to and collect from Icarus", + "向箱子配送模式0": "Distribute to other distributors", + "向箱子配送模式1": "Provide to other distributors", + "向箱子配送模式2": "Request from other distributors", "周期秒": " seconds", "图标布局": "Icon Layout", "基站建设无人机提示标题": "Construction Drone", diff --git a/src/locales/zh.json b/src/locales/zh.json index 0679764..fa50f29 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -184,6 +184,7 @@ "齿轮": "齿轮", "不满足": "不满足", "不选轨道": "无", + "不限回收类型": "回收所有类型", "低音贝斯": "低音贝斯", "储液罐关": "关", "储液罐开": "开", @@ -199,6 +200,13 @@ "包括轨道采集器": " 轨道采集器", "十倍射速": "十倍射速", "吉他": "吉他", + "向玩家配送模式0": "向伊卡洛斯配送", + "向玩家配送模式1": "向伊卡洛斯供应", + "向玩家配送模式2": "从伊卡洛斯回收", + "向玩家配送模式3": "向伊卡洛斯供应和回收", + "向箱子配送模式0": "向其他配送器配送", + "向箱子配送模式1": "向其他配送器供应", + "向箱子配送模式2": "向其他配送器需求", "周期秒": " 秒", "图标布局": "图标布局", "基站建设无人机提示标题": "建设无人机",