mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
* Enhance export functionality and add icon reference page - Expanded exported assets to include additional spritesheets and metadata for recipes, signals, technologies, planets, qualities, and entities. - added logging metrics to game logs - Introduced a new Icon Reference page to display available icons with filtering capabilities. - Updated ExportManifest documentation to reflect new asset categories. * Add support for exporting static icons and update metadata handling * -added data export snapshot metrics * Fix HTML attribute syntax in IconReferencePage component * Applied PR sugestions: -removed un needed x === "string"s -removed isntancename / modpack from icon reference and export -logging per line on export -fixed variable names -linting * linted * Shows "no export data available" when no export happens * -single sprite sheet -removed static icons with no prototype * Fix formatting * Rename types to allowedTypes for clarity * -removed duplication check (redundant) -fixed bug overwriting metadata with same name from previous categories * Rename asset keys for consistency in export validation test --------- Co-authored-by: Solar <solar@homelab.local>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { Type, Static } from "@sinclair/typebox";
|
|
|
|
/**
|
|
* Export manifest for a mod pack
|
|
*
|
|
* Tracks files stored on disk for data that extracted from Factorio using a
|
|
* given mod pack.
|
|
*/
|
|
export default class ExportManifest {
|
|
constructor(
|
|
/**
|
|
* Mapping between known assets and their file names.
|
|
*
|
|
* Currently exported assets are:
|
|
* - settings: JSON of mod settings prototypes.
|
|
* - prototypes: JSON of all game prototypes except settings.
|
|
* - locale: JSON of flattened Map entries of en locale strings from the game.
|
|
* - spritesheet: Single PNG spritesheet containing all icon categories.
|
|
* - metadata: JSON array of [name, {x, y, size, category, path?}] entries
|
|
* describing sprite coordinates and category membership. Categories:
|
|
* item, recipe, signal, technology, planet, quality, entity, static.
|
|
*/
|
|
public assets: Record<string, string>,
|
|
/** ISO 8601 timestamp of when the export was uploaded. */
|
|
public exportedAt?: string,
|
|
) { }
|
|
|
|
static jsonSchema = Type.Object({
|
|
"assets": Type.Record(Type.String(), Type.String()),
|
|
"exportedAt": Type.Optional(Type.String()),
|
|
});
|
|
|
|
static fromJSON(json: Static<typeof ExportManifest.jsonSchema>) {
|
|
return new this(json.assets, json.exportedAt);
|
|
}
|
|
}
|