feat: equipment IsNew flag (#1309)
Reviewed-on: OpenWF/SpaceNinjaServer#1309
This commit is contained in:
		
							parent
							
								
									ba795150a9
								
							
						
					
					
						commit
						a56ff89bb9
					
				@ -849,7 +849,8 @@ const EquipmentSchema = new Schema<IEquipmentDatabase>(
 | 
			
		||||
        Customization: crewShipCustomizationSchema,
 | 
			
		||||
        RailjackImage: FlavourItemSchema,
 | 
			
		||||
        CrewMembers: crewShipMembersSchema,
 | 
			
		||||
        Details: detailsSchema
 | 
			
		||||
        Details: detailsSchema,
 | 
			
		||||
        IsNew: Boolean
 | 
			
		||||
    },
 | 
			
		||||
    { id: false }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
@ -907,7 +907,8 @@ export const addEquipment = (
 | 
			
		||||
            ItemType: type,
 | 
			
		||||
            Configs: [],
 | 
			
		||||
            XP: 0,
 | 
			
		||||
            ModularParts: modularParts
 | 
			
		||||
            ModularParts: modularParts,
 | 
			
		||||
            IsNew: true
 | 
			
		||||
        },
 | 
			
		||||
        defaultOverwrites
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
@ -155,7 +155,12 @@ export const handleInventoryItemConfigChange = async (
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
			
		||||
                            inventoryItem.Configs[parseInt(configId)] = config;
 | 
			
		||||
                            if (typeof config !== "boolean") {
 | 
			
		||||
                                inventoryItem.Configs[parseInt(configId)] = config;
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        if ("IsNew" in itemConfigEntries) {
 | 
			
		||||
                            inventoryItem.IsNew = itemConfigEntries.IsNew;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    break;
 | 
			
		||||
 | 
			
		||||
@ -140,6 +140,7 @@ export interface IEquipmentDatabase {
 | 
			
		||||
    RailjackImage?: IFlavourItem;
 | 
			
		||||
    CrewMembers?: ICrewShipMembersDatabase;
 | 
			
		||||
    Details?: IKubrowPetDetailsDatabase;
 | 
			
		||||
    IsNew?: boolean;
 | 
			
		||||
    _id: Types.ObjectId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -48,9 +48,9 @@ export interface IItemEntry {
 | 
			
		||||
    [itemId: string]: IConfigEntry;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IConfigEntry {
 | 
			
		||||
    [configId: string]: IItemConfig;
 | 
			
		||||
}
 | 
			
		||||
export type IConfigEntry = {
 | 
			
		||||
    [configId in "0" | "1" | "2" | "3" | "4" | "5"]: IItemConfig;
 | 
			
		||||
} & { IsNew?: boolean };
 | 
			
		||||
 | 
			
		||||
export interface ILoadoutClient extends Omit<ILoadoutDatabase, "_id" | "loadoutOwnerId"> {}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user