feat: equipment IsNew flag
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build / build (20) (push) Successful in 1m11s
				
			
		
			
				
	
				Build / build (18) (push) Successful in 48s
				
			
		
			
				
	
				Build / build (22) (push) Successful in 1m27s
				
			
		
			
				
	
				Build / build (18) (pull_request) Successful in 46s
				
			
		
			
				
	
				Build / build (22) (pull_request) Successful in 1m29s
				
			
		
			
				
	
				Build / build (20) (pull_request) Successful in 1m9s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build / build (20) (push) Successful in 1m11s
				
			Build / build (18) (push) Successful in 48s
				
			Build / build (22) (push) Successful in 1m27s
				
			Build / build (18) (pull_request) Successful in 46s
				
			Build / build (22) (pull_request) Successful in 1m29s
				
			Build / build (20) (pull_request) Successful in 1m9s
				
			This commit is contained in:
		
							parent
							
								
									8a29f06207
								
							
						
					
					
						commit
						ffca79a5d9
					
				@ -840,7 +840,8 @@ const EquipmentSchema = new Schema<IEquipmentDatabase>(
 | 
				
			|||||||
        Customization: crewShipCustomizationSchema,
 | 
					        Customization: crewShipCustomizationSchema,
 | 
				
			||||||
        RailjackImage: FlavourItemSchema,
 | 
					        RailjackImage: FlavourItemSchema,
 | 
				
			||||||
        CrewMembers: crewShipMembersSchema,
 | 
					        CrewMembers: crewShipMembersSchema,
 | 
				
			||||||
        Details: detailsSchema
 | 
					        Details: detailsSchema,
 | 
				
			||||||
 | 
					        IsNew: Boolean
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    { id: false }
 | 
					    { id: false }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
				
			|||||||
@ -900,7 +900,8 @@ export const addEquipment = (
 | 
				
			|||||||
            ItemType: type,
 | 
					            ItemType: type,
 | 
				
			||||||
            Configs: [],
 | 
					            Configs: [],
 | 
				
			||||||
            XP: 0,
 | 
					            XP: 0,
 | 
				
			||||||
            ModularParts: modularParts
 | 
					            ModularParts: modularParts,
 | 
				
			||||||
 | 
					            IsNew: true
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        defaultOverwrites
 | 
					        defaultOverwrites
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
				
			|||||||
@ -155,9 +155,14 @@ export const handleInventoryItemConfigChange = async (
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
					                        for (const [configId, config] of Object.entries(itemConfigEntries)) {
 | 
				
			||||||
 | 
					                            if (typeof config !== "boolean") {
 | 
				
			||||||
                                inventoryItem.Configs[parseInt(configId)] = config;
 | 
					                                inventoryItem.Configs[parseInt(configId)] = config;
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					                        if ("IsNew" in itemConfigEntries) {
 | 
				
			||||||
 | 
					                            inventoryItem.IsNew = itemConfigEntries.IsNew;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    logger.warn(`loadout category not implemented, changes may be lost: ${equipmentName}`, {
 | 
					                    logger.warn(`loadout category not implemented, changes may be lost: ${equipmentName}`, {
 | 
				
			||||||
 | 
				
			|||||||
@ -140,6 +140,7 @@ export interface IEquipmentDatabase {
 | 
				
			|||||||
    RailjackImage?: IFlavourItem;
 | 
					    RailjackImage?: IFlavourItem;
 | 
				
			||||||
    CrewMembers?: ICrewShipMembersDatabase;
 | 
					    CrewMembers?: ICrewShipMembersDatabase;
 | 
				
			||||||
    Details?: IKubrowPetDetailsDatabase;
 | 
					    Details?: IKubrowPetDetailsDatabase;
 | 
				
			||||||
 | 
					    IsNew?: boolean;
 | 
				
			||||||
    _id: Types.ObjectId;
 | 
					    _id: Types.ObjectId;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -48,9 +48,9 @@ export interface IItemEntry {
 | 
				
			|||||||
    [itemId: string]: IConfigEntry;
 | 
					    [itemId: string]: IConfigEntry;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IConfigEntry {
 | 
					export type IConfigEntry = {
 | 
				
			||||||
    [configId: string]: IItemConfig;
 | 
					    [configId in "0" | "1" | "2" | "3" | "4" | "5"]: IItemConfig;
 | 
				
			||||||
}
 | 
					} & { IsNew?: boolean };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface ILoadoutClient extends Omit<ILoadoutDatabase, "_id" | "loadoutOwnerId"> {}
 | 
					export interface ILoadoutClient extends Omit<ILoadoutDatabase, "_id" | "loadoutOwnerId"> {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user