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,
|
Customization: crewShipCustomizationSchema,
|
||||||
RailjackImage: FlavourItemSchema,
|
RailjackImage: FlavourItemSchema,
|
||||||
CrewMembers: crewShipMembersSchema,
|
CrewMembers: crewShipMembersSchema,
|
||||||
Details: detailsSchema
|
Details: detailsSchema,
|
||||||
|
IsNew: Boolean
|
||||||
},
|
},
|
||||||
{ id: false }
|
{ id: false }
|
||||||
);
|
);
|
||||||
|
@ -907,7 +907,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