返回提交历史
Modified
src/models/inventoryModels/inventoryModel.ts
+2
-1
Modified
src/services/inventoryService.ts
+2
-1
Modified
src/services/saveLoadoutService.ts
+6
-1
Modified
src/types/inventoryTypes/commonInventoryTypes.ts
+1
-0
Modified
src/types/saveLoadoutTypes.ts
+3
-3
XFEstudio/SpaceNinjaServer
feat: equipment IsNew flag (#1309)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1309
a56ff89b
代码差异
5 个文件
+14
-6
@@ -849,7 +849,8 @@ const EquipmentSchema = new Schema<IEquipmentDatabase>(
849
849
Customization: crewShipCustomizationSchema,
850
850
RailjackImage: FlavourItemSchema,
851
851
CrewMembers: crewShipMembersSchema,
852
Details: detailsSchema
852
Details: detailsSchema,
853
IsNew: Boolean
853
854
},
854
855
{ id: false }
855
856
);
@@ -907,7 +907,8 @@ export const addEquipment = (
907
907
ItemType: type,
908
908
Configs: [],
909
909
XP: 0,
910
ModularParts: modularParts
910
ModularParts: modularParts,
911
IsNew: true
911
912
},
912
913
defaultOverwrites
913
914
);
@@ -155,7 +155,12 @@ export const handleInventoryItemConfigChange = async (
155
155
}
156
156
157
157
for (const [configId, config] of Object.entries(itemConfigEntries)) {
158
inventoryItem.Configs[parseInt(configId)] = config;
158
if (typeof config !== "boolean") {
159
inventoryItem.Configs[parseInt(configId)] = config;
160
}
161
}
162
if ("IsNew" in itemConfigEntries) {
163
inventoryItem.IsNew = itemConfigEntries.IsNew;
159
164
}
160
165
}
161
166
break;
@@ -140,6 +140,7 @@ export interface IEquipmentDatabase {
140
140
RailjackImage?: IFlavourItem;
141
141
CrewMembers?: ICrewShipMembersDatabase;
142
142
Details?: IKubrowPetDetailsDatabase;
143
IsNew?: boolean;
143
144
_id: Types.ObjectId;
144
145
}
145
146
@@ -48,9 +48,9 @@ export interface IItemEntry {
48
48
[itemId: string]: IConfigEntry;
49
49
}
50
50
51
export interface IConfigEntry {
52
[configId: string]: IItemConfig;
53
}
51
export type IConfigEntry = {
52
[configId in "0" | "1" | "2" | "3" | "4" | "5"]: IItemConfig;
53
} & { IsNew?: boolean };
54
54
55
55
export interface ILoadoutClient extends Omit<ILoadoutDatabase, "_id" | "loadoutOwnerId"> {}
56
56