diff --git a/data/coi/grabber/captain-of-data b/data/coi/grabber/captain-of-data index 256f840..55d7e90 160000 --- a/data/coi/grabber/captain-of-data +++ b/data/coi/grabber/captain-of-data @@ -1 +1 @@ -Subproject commit 256f84092ba283af8288bd5f56f1294b5ace825b +Subproject commit 55d7e901854a017c99a99b108bfcf0bcfc28ad40 diff --git a/data/coi/grabber/coi-types.ts b/data/coi/grabber/coi-types.ts index 643e582..45b6af8 100644 --- a/data/coi/grabber/coi-types.ts +++ b/data/coi/grabber/coi-types.ts @@ -19,6 +19,7 @@ export interface BuildingDef { storage_capacity: number; unity_cost: number; research_speed: number; + icon_path?: string; build_costs: BuildCost[]; recipes: RecipeDef[]; } @@ -51,6 +52,7 @@ export interface ProductDef { name: string; icon: string; type: string; + icon_path?: string; } export interface ContractsJson { diff --git a/data/coi/grabber/grab-data.ts b/data/coi/grabber/grab-data.ts index 924b498..6748558 100644 --- a/data/coi/grabber/grab-data.ts +++ b/data/coi/grabber/grab-data.ts @@ -109,7 +109,7 @@ const whiteImages: Set = new Set([ 'Anesthetics', 'Antibiotics', 'BasicServerRack', - //'Computing', + 'Computing', 'ConstructionParts', 'ChickenCarcass', 'LabEquipment', @@ -123,7 +123,7 @@ const whiteImages: Set = new Set([ 'SiliconWafer', 'Upoints', 'VehicleParts', - //'Worker', + 'Worker', 'AnyCountableProduct', 'AnyFluidProduct', @@ -188,7 +188,6 @@ async function prepareImages(productIdsToDefs: Map, items: G type ImageDef = { id: string; icon: string; - alt: string[]; dir: ReturnType; }; @@ -196,6 +195,12 @@ async function prepareImages(productIdsToDefs: Map, items: G const productsDir = dirToMapCaseInsensitive(path.join(_images, 'products')); const staticDir = dirToMapCaseInsensitive(_static); const imagesPaths: ImageDef[] = []; + const getIconName = (iconPath: string | undefined, itemId: string) => { + if(!iconPath) + return itemId; + return path.basename(iconPath, path.extname(iconPath)); + }; + /* const overrides: Record = { Antibiotics: 'Penicillin', ChilledWater: 'WaterChilled', @@ -239,31 +244,22 @@ async function prepareImages(productIdsToDefs: Map, items: G UraniumReprocessed: 'ReprocessedUranium', VehicleParts: 'VehicleParts1', }; + */ + const machineDefs = new Map(machines.machines_and_buildings.map((p) => [p.id, p])); for(const item of items) { if(item.recipe) { + const def = machineDefs.get(item.name); imagesPaths.push({ id: item.name, - icon: item.name + '.png', - alt: [], + icon: getIconName(def?.icon_path, item.name) + '.png', dir: buildingsDir, }); } else { - //TODO - migrate icons to internal game asset names - const iconName = item.name; - const alt = []; - const overrideName = overrides[item.name]; - if(overrideName) { - alt.push(overrideName + '.png'); - } const def = productIdsToDefs.get(item.name); - if(def?.icon) { - alt.push(def.icon + '.png'); - } imagesPaths.push({ id: item.name, - icon: iconName + '.png', - alt, + icon: getIconName(def?.icon_path, item.name) + '.png', dir: productsDir, }); } @@ -277,16 +273,6 @@ async function prepareImages(productIdsToDefs: Map, items: G let imagePath: string | undefined; if(realImageName) { imagePath = path.join(image.dir.dir, realImageName); - } else { - for(const altName of image.alt) { - realImageName = image.dir.map.get(altName.toLowerCase()); - if(realImageName) { - imagePath = path.join(image.dir.dir, realImageName); - break; - } - } - } - if(realImageName) { usedImages.add(realImageName); } if(!imagePath) { diff --git a/data/coi/keys.json b/data/coi/keys.json index 252f08c..471b121 100644 --- a/data/coi/keys.json +++ b/data/coi/keys.json @@ -828,7 +828,12 @@ "TreeSapling": "dj", "WastePressed": "dk", "Woodchips": "dl", - "Yellowcake": "dm" + "Yellowcake": "dm", + "NuclearReactorT22": "dn", + "NuclearReactorT23": "do", + "NuclearReactor1": "dp", + "FastBreederReactor2": "dq", + "FastBreederReactor3": "dr" }, - "lastKey": 828 + "lastKey": 833 } \ No newline at end of file diff --git a/data/coi/parsed/data.json b/data/coi/parsed/data.json index 8e55384..d45d222 100644 --- a/data/coi/parsed/data.json +++ b/data/coi/parsed/data.json @@ -17563,6 +17563,11 @@ "name": "MaintenanceT2", "count": 36, "flags": 12 + }, + { + "name": "Computing", + "count": 12, + "flags": 12 } ], "output": [ @@ -17597,6 +17602,11 @@ "name": "MaintenanceT2", "count": 36, "flags": 12 + }, + { + "name": "Computing", + "count": 12, + "flags": 12 } ], "output": [ @@ -17610,6 +17620,84 @@ } ], "time": 30 + }, + { + "name": "NuclearReactorT22", + "input": [ + { + "name": "Water", + "count": 192 + }, + { + "name": "MoxRod", + "count": 1 + }, + { + "name": "Worker", + "count": 110, + "flags": 28 + }, + { + "name": "MaintenanceT2", + "count": 36, + "flags": 12 + }, + { + "name": "Computing", + "count": 12, + "flags": 12 + } + ], + "output": [ + { + "name": "SteamHi", + "count": 192 + }, + { + "name": "SpentMox", + "count": 1 + } + ], + "time": 120 + }, + { + "name": "NuclearReactorT23", + "input": [ + { + "name": "Water", + "count": 192 + }, + { + "name": "UraniumRod", + "count": 1 + }, + { + "name": "Worker", + "count": 110, + "flags": 28 + }, + { + "name": "MaintenanceT2", + "count": 36, + "flags": 12 + }, + { + "name": "Computing", + "count": 12, + "flags": 12 + } + ], + "output": [ + { + "name": "SteamHi", + "count": 192 + }, + { + "name": "SpentFuel", + "count": 1 + } + ], + "time": 120 } ] }, @@ -17649,6 +17737,40 @@ } ], "time": 40 + }, + { + "name": "NuclearReactor1", + "input": [ + { + "name": "Water", + "count": 192 + }, + { + "name": "UraniumRod", + "count": 1 + }, + { + "name": "Worker", + "count": 80, + "flags": 28 + }, + { + "name": "MaintenanceT2", + "count": 24, + "flags": 12 + } + ], + "output": [ + { + "name": "SteamHi", + "count": 192 + }, + { + "name": "SpentFuel", + "count": 1 + } + ], + "time": 120 } ] }, @@ -17660,7 +17782,7 @@ "input": [ { "name": "Water", - "count": 64 + "count": 96 }, { "name": "CoreFuel", @@ -17675,12 +17797,17 @@ "name": "MaintenanceT3", "count": 36, "flags": 12 + }, + { + "name": "Computing", + "count": 18, + "flags": 12 } ], "output": [ { "name": "SteamSp", - "count": 64 + "count": 96 }, { "name": "CoreFuelDirty", @@ -17694,7 +17821,7 @@ "input": [ { "name": "BlanketFuel", - "count": 0 + "count": 1.200195 }, { "name": "Worker", @@ -17705,15 +17832,90 @@ "name": "MaintenanceT3", "count": 36, "flags": 12 + }, + { + "name": "Computing", + "count": 18, + "flags": 12 } ], "output": [ { "name": "BlanketFuelEnriched", - "count": 0 + "count": 1.200195 } ], "time": 15 + }, + { + "name": "FastBreederReactor2", + "input": [ + { + "name": "Water", + "count": 96 + }, + { + "name": "CoreFuel", + "count": 1 + }, + { + "name": "Worker", + "count": 200, + "flags": 28 + }, + { + "name": "MaintenanceT3", + "count": 36, + "flags": 12 + }, + { + "name": "Computing", + "count": 18, + "flags": 12 + } + ], + "output": [ + { + "name": "SteamSp", + "count": 96 + }, + { + "name": "CoreFuelDirty", + "count": 1 + } + ], + "time": 60 + }, + { + "name": "FastBreederReactor3", + "input": [ + { + "name": "BlanketFuel", + "count": 1.200195 + }, + { + "name": "Worker", + "count": 200, + "flags": 28 + }, + { + "name": "MaintenanceT3", + "count": 36, + "flags": 12 + }, + { + "name": "Computing", + "count": 18, + "flags": 12 + } + ], + "output": [ + { + "name": "BlanketFuelEnriched", + "count": 1.200195 + } + ], + "time": 60 } ] }, diff --git a/data/coi/parsed/images.png b/data/coi/parsed/images.png index 346366a..6be4634 100644 Binary files a/data/coi/parsed/images.png and b/data/coi/parsed/images.png differ