feat(webui): acquire flawed mods & imposters via add mods #1040
@ -20,6 +20,7 @@ interface ListedItem {
 | 
			
		||||
    name: string;
 | 
			
		||||
    fusionLimit?: number;
 | 
			
		||||
    exalted?: string[];
 | 
			
		||||
    badReason?: "starter" | "frivolous" | "notraw";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const getItemListsController: RequestHandler = (req, response) => {
 | 
			
		||||
@ -132,16 +133,20 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    res.mods = [];
 | 
			
		||||
    const badItems: Record<string, boolean> = {};
 | 
			
		||||
    for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
 | 
			
		||||
        res.mods.push({
 | 
			
		||||
        const mod: ListedItem = {
 | 
			
		||||
            uniqueName,
 | 
			
		||||
            name: getString(upgrade.name, lang),
 | 
			
		||||
            fusionLimit: upgrade.fusionLimit
 | 
			
		||||
        });
 | 
			
		||||
        if (upgrade.isStarter || upgrade.isFrivolous || upgrade.upgradeEntries) {
 | 
			
		||||
            badItems[uniqueName] = true;
 | 
			
		||||
        };
 | 
			
		||||
        if (upgrade.isStarter) {
 | 
			
		||||
            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)) {
 | 
			
		||||
        res.mods.push({
 | 
			
		||||
@ -151,13 +156,14 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    for (const [uniqueName, arcane] of Object.entries(ExportArcanes)) {
 | 
			
		||||
        res.mods.push({
 | 
			
		||||
        const mod: ListedItem = {
 | 
			
		||||
            uniqueName,
 | 
			
		||||
            name: getString(arcane.name, lang)
 | 
			
		||||
        });
 | 
			
		||||
        };
 | 
			
		||||
        if (arcane.isFrivolous) {
 | 
			
		||||
            badItems[uniqueName] = true;
 | 
			
		||||
            mod.badReason = "frivolous";
 | 
			
		||||
        }
 | 
			
		||||
        res.mods.push(mod);
 | 
			
		||||
    }
 | 
			
		||||
    for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
 | 
			
		||||
        res.Syndicates.push({
 | 
			
		||||
@ -167,7 +173,6 @@ const getItemListsController: RequestHandler = (req, response) => {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    response.json({
 | 
			
		||||
        badItems,
 | 
			
		||||
        archonCrystalUpgrades,
 | 
			
		||||
        uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
 | 
			
		||||
        ...res
 | 
			
		||||
 | 
			
		||||
@ -207,11 +207,16 @@ function fetchItemList() {
 | 
			
		||||
                        document.getElementById("changeSyndicate").appendChild(option);
 | 
			
		||||
                        itemMap[item.uniqueName] = { ...item, type };
 | 
			
		||||
                    });
 | 
			
		||||
                } else if (type != "badItems") {
 | 
			
		||||
                } else {
 | 
			
		||||
                    items.forEach(item => {
 | 
			
		||||
                        if (item.uniqueName in data.badItems) {
 | 
			
		||||
                            item.name += " " + loc("code_badItem");
 | 
			
		||||
                        } else if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/") {
 | 
			
		||||
                        if ("badReason" in item) {
 | 
			
		||||
                            if (item.badReason == "starter") {
 | 
			
		||||
                                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");
 | 
			
		||||
                            option.setAttribute("data-key", item.uniqueName);
 | 
			
		||||
                            option.value = item.name;
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,7 @@ dict = {
 | 
			
		||||
    code_kDrive: `K-Drive`,
 | 
			
		||||
    code_legendaryCore: `Legendary Core`,
 | 
			
		||||
    code_traumaticPeculiar: `Traumatic Peculiar`,
 | 
			
		||||
    code_starter: `|MOD| (Flawed)`,
 | 
			
		||||
    code_badItem: `(Imposter)`,
 | 
			
		||||
    code_maxRank: `Max Rank`,
 | 
			
		||||
    code_rename: `Rename`,
 | 
			
		||||
 | 
			
		||||
@ -19,6 +19,7 @@ dict = {
 | 
			
		||||
    code_kDrive: `К-Драйв`,
 | 
			
		||||
    code_legendaryCore: `Легендарное ядро`,
 | 
			
		||||
    code_traumaticPeculiar: `Травмирующая Странность`,
 | 
			
		||||
    code_starter: `[UNTRANSLATED] |MOD| (Flawed)`,
 | 
			
		||||
    code_badItem: `(Самозванец)`,
 | 
			
		||||
    code_maxRank: `Максимальный ранг`,
 | 
			
		||||
    code_rename: `Переименовать`,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user