mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Support shorthand notation for colours
Implement the shorthand notations that Factorio recognises for colours where individual components may be left out or the colour specified as an array of values instead of an object.
This commit is contained in:
1 parent
96082e32b7
commit
1021e29c98
8 files changed
+80
-12
No files matched your search
@@ -2,6 +2,7 @@ import zlib from "zlib";
|
||||
import { Type, Static } from "@sinclair/typebox";
|
||||
|
||||
import * as libSchema from "../schema";
|
||||
import * as libLuaTools from "../lua_tools";
|
||||
|
||||
import ExportManifest from "./ExportManifest";
|
||||
import { integerFactorioVersion } from "./version";
|
||||
@@ -363,7 +364,11 @@ export default class ModPack {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.settings[settingType].set(prototype.name, { value: prototype.default_value });
|
||||
let value = prototype.default_value;
|
||||
if (prototype.type === "color-setting") {
|
||||
value = libLuaTools.normalizeColor(value);
|
||||
}
|
||||
this.settings[settingType].set(prototype.name, { value });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user