mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-23 12:42:34 +00:00
Improved glyph preset load (#3421)
This commit is contained in:
parent
0e5d26c79b
commit
dce5659c50
@ -71,7 +71,7 @@ export default {
|
|||||||
// preset match, and leniently when matching greedily may lead to an incomplete set being loaded
|
// preset match, and leniently when matching greedily may lead to an incomplete set being loaded
|
||||||
loadGlyphSet(set, id) {
|
loadGlyphSet(set, id) {
|
||||||
if (!this.setLengthValid(set)) return;
|
if (!this.setLengthValid(set)) return;
|
||||||
let glyphsToLoad = [...set];
|
let glyphsToLoad = [...set].sort((a, b) => -a.level * a.strength + b.level * b.strength);
|
||||||
const activeGlyphs = [...Glyphs.active.filter(g => g)];
|
const activeGlyphs = [...Glyphs.active.filter(g => g)];
|
||||||
|
|
||||||
// Create an array where each entry contains a single active glyph and all its matches in the preset which it
|
// Create an array where each entry contains a single active glyph and all its matches in the preset which it
|
||||||
@ -144,11 +144,10 @@ export default {
|
|||||||
for (let index = 0; index < optionList.length; index++) {
|
for (let index = 0; index < optionList.length; index++) {
|
||||||
if (slotsLeft === 0) break;
|
if (slotsLeft === 0) break;
|
||||||
const entry = optionList[index];
|
const entry = optionList[index];
|
||||||
const greedyPick = index === optionList.length - 1 || optionList[index + 1].options.length > 1;
|
|
||||||
|
|
||||||
const filteredOptions = entry.options.filter(g => !toLoad.includes(g));
|
const filteredOptions = entry.options.filter(g => !toLoad.includes(g));
|
||||||
if (filteredOptions.length === 0) continue;
|
if (filteredOptions.length === 0) continue;
|
||||||
const selectedGlyph = filteredOptions[greedyPick ? 0 : (filteredOptions.length - 1)];
|
const selectedGlyph = filteredOptions[filteredOptions.length - 1];
|
||||||
toLoad.push(selectedGlyph);
|
toLoad.push(selectedGlyph);
|
||||||
slotsLeft--;
|
slotsLeft--;
|
||||||
}
|
}
|
||||||
|
@ -815,9 +815,9 @@ window.player = {
|
|||||||
highContrastRarity: false,
|
highContrastRarity: false,
|
||||||
swapGlyphColors: false,
|
swapGlyphColors: false,
|
||||||
hideAlterationEffects: false,
|
hideAlterationEffects: false,
|
||||||
ignoreGlyphEffects: false,
|
ignoreGlyphEffects: true,
|
||||||
ignoreGlyphLevel: false,
|
ignoreGlyphLevel: true,
|
||||||
ignoreGlyphRarity: false,
|
ignoreGlyphRarity: true,
|
||||||
glyphBG: GLYPH_BG_SETTING.AUTO,
|
glyphBG: GLYPH_BG_SETTING.AUTO,
|
||||||
glyphBorders: true,
|
glyphBorders: true,
|
||||||
showHintText: {
|
showHintText: {
|
||||||
|
Loading…
Reference in New Issue
Block a user