feat(webui): acquire flawed mods & imposters via add mods #1040
@ -20,6 +20,7 @@ interface ListedItem {
 | 
				
			|||||||
    name: string;
 | 
					    name: string;
 | 
				
			||||||
    fusionLimit?: number;
 | 
					    fusionLimit?: number;
 | 
				
			||||||
    exalted?: string[];
 | 
					    exalted?: string[];
 | 
				
			||||||
 | 
					    badReason?: "starter" | "frivolous" | "notraw";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const getItemListsController: RequestHandler = (req, response) => {
 | 
					const getItemListsController: RequestHandler = (req, response) => {
 | 
				
			||||||
@ -132,16 +133,20 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    res.mods = [];
 | 
					    res.mods = [];
 | 
				
			||||||
    const badItems: Record<string, boolean> = {};
 | 
					 | 
				
			||||||
    for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
 | 
					    for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
 | 
				
			||||||
        res.mods.push({
 | 
					        const mod: ListedItem = {
 | 
				
			||||||
            uniqueName,
 | 
					            uniqueName,
 | 
				
			||||||
            name: getString(upgrade.name, lang),
 | 
					            name: getString(upgrade.name, lang),
 | 
				
			||||||
            fusionLimit: upgrade.fusionLimit
 | 
					            fusionLimit: upgrade.fusionLimit
 | 
				
			||||||
        });
 | 
					        };
 | 
				
			||||||
        if (upgrade.isStarter || upgrade.isFrivolous || upgrade.upgradeEntries) {
 | 
					        if (upgrade.isStarter) {
 | 
				
			||||||
            badItems[uniqueName] = true;
 | 
					            mod.badReason = "starter";
 | 
				
			||||||
 | 
					        } else if (upgrade.isFrivolous) {
 | 
				
			||||||
 | 
					            mod.badReason = "frivolous";
 | 
				
			||||||
 | 
					        } else if (upgrade.upgradeEntries) {
 | 
				
			||||||
 | 
					            mod.badReason = "notraw";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        res.mods.push(mod);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (const [uniqueName, upgrade] of Object.entries(ExportAvionics)) {
 | 
					    for (const [uniqueName, upgrade] of Object.entries(ExportAvionics)) {
 | 
				
			||||||
        res.mods.push({
 | 
					        res.mods.push({
 | 
				
			||||||
@ -151,13 +156,14 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (const [uniqueName, arcane] of Object.entries(ExportArcanes)) {
 | 
					    for (const [uniqueName, arcane] of Object.entries(ExportArcanes)) {
 | 
				
			||||||
        res.mods.push({
 | 
					        const mod: ListedItem = {
 | 
				
			||||||
            uniqueName,
 | 
					            uniqueName,
 | 
				
			||||||
            name: getString(arcane.name, lang)
 | 
					            name: getString(arcane.name, lang)
 | 
				
			||||||
        });
 | 
					        };
 | 
				
			||||||
        if (arcane.isFrivolous) {
 | 
					        if (arcane.isFrivolous) {
 | 
				
			||||||
            badItems[uniqueName] = true;
 | 
					            mod.badReason = "frivolous";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        res.mods.push(mod);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
 | 
					    for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
 | 
				
			||||||
        res.Syndicates.push({
 | 
					        res.Syndicates.push({
 | 
				
			||||||
@ -167,7 +173,6 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    response.json({
 | 
					    response.json({
 | 
				
			||||||
        badItems,
 | 
					 | 
				
			||||||
        archonCrystalUpgrades,
 | 
					        archonCrystalUpgrades,
 | 
				
			||||||
        uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
 | 
					        uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
 | 
				
			||||||
        ...res
 | 
					        ...res
 | 
				
			||||||
 | 
				
			|||||||
@ -207,11 +207,16 @@ function fetchItemList() {
 | 
				
			|||||||
                        document.getElementById("changeSyndicate").appendChild(option);
 | 
					                        document.getElementById("changeSyndicate").appendChild(option);
 | 
				
			||||||
                        itemMap[item.uniqueName] = { ...item, type };
 | 
					                        itemMap[item.uniqueName] = { ...item, type };
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                } else if (type != "badItems") {
 | 
					                } else {
 | 
				
			||||||
                    items.forEach(item => {
 | 
					                    items.forEach(item => {
 | 
				
			||||||
                        if (item.uniqueName in data.badItems) {
 | 
					                        if ("badReason" in item) {
 | 
				
			||||||
                            item.name += " " + loc("code_badItem");
 | 
					                            if (item.badReason == "starter") {
 | 
				
			||||||
                        } else if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/") {
 | 
					                                item.name = loc("code_starter").split("|MOD|").join(item.name);
 | 
				
			||||||
 | 
					                            } else {
 | 
				
			||||||
 | 
					                                item.name += " " + loc("code_badItem");
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/" && item.badReason != "notraw") {
 | 
				
			||||||
                            const option = document.createElement("option");
 | 
					                            const option = document.createElement("option");
 | 
				
			||||||
                            option.setAttribute("data-key", item.uniqueName);
 | 
					                            option.setAttribute("data-key", item.uniqueName);
 | 
				
			||||||
                            option.value = item.name;
 | 
					                            option.value = item.name;
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,7 @@ dict = {
 | 
				
			|||||||
    code_kDrive: `K-Drive`,
 | 
					    code_kDrive: `K-Drive`,
 | 
				
			||||||
    code_legendaryCore: `Legendary Core`,
 | 
					    code_legendaryCore: `Legendary Core`,
 | 
				
			||||||
    code_traumaticPeculiar: `Traumatic Peculiar`,
 | 
					    code_traumaticPeculiar: `Traumatic Peculiar`,
 | 
				
			||||||
 | 
					    code_starter: `|MOD| (Flawed)`,
 | 
				
			||||||
    code_badItem: `(Imposter)`,
 | 
					    code_badItem: `(Imposter)`,
 | 
				
			||||||
    code_maxRank: `Max Rank`,
 | 
					    code_maxRank: `Max Rank`,
 | 
				
			||||||
    code_rename: `Rename`,
 | 
					    code_rename: `Rename`,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user