@xingjisoft/neutrino 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pro/config.js +7 -3
- package/package.json +1 -1
package/dist/pro/config.js
CHANGED
|
@@ -170,16 +170,20 @@ export function loadProModels() {
|
|
|
170
170
|
throw new Error(`Pro model.json is missing; it is downloaded from ${PRO_MODELS_URL} on first use`);
|
|
171
171
|
}
|
|
172
172
|
const { tier } = readProModels(PRO_MODEL_FILE, "model.json");
|
|
173
|
-
// Presets the user keeps in model-custom.json are merged in
|
|
174
|
-
//
|
|
173
|
+
// Presets the user keeps in model-custom.json are merged in. Their place in the
|
|
174
|
+
// list is read as strength (the slider runs from weak to strong), so entries that
|
|
175
|
+
// are not official rungs lead it: a preset named after an official one edits that
|
|
176
|
+
// rung in place, every other one sits left of the graded presets.
|
|
175
177
|
if (fs.existsSync(PRO_CUSTOM_MODEL_FILE)) {
|
|
178
|
+
const own = [];
|
|
176
179
|
for (const preset of readProModels(PRO_CUSTOM_MODEL_FILE, "model-custom.json").tier) {
|
|
177
180
|
const index = tier.findIndex((entry) => entry.name === preset.name);
|
|
178
181
|
if (index === -1)
|
|
179
|
-
|
|
182
|
+
own.push(preset);
|
|
180
183
|
else
|
|
181
184
|
tier[index] = preset;
|
|
182
185
|
}
|
|
186
|
+
tier.unshift(...own);
|
|
183
187
|
}
|
|
184
188
|
if (tier.length === 0)
|
|
185
189
|
throw new Error("Pro model.json must contain a nonempty tier array");
|