XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: equipment IsNew flag (#1309)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1309

a56ff89b
Sainan <sainan@calamity.inc>
提交于

代码差异

5 个文件 +14 -6
Modified src/models/inventoryModels/inventoryModel.ts +2 -1
@@ -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 );
Modified src/services/inventoryService.ts +2 -1
@@ -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 );
Modified src/services/saveLoadoutService.ts +6 -1
@@ -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;
Modified src/types/inventoryTypes/commonInventoryTypes.ts +1 -0
@@ -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
Modified src/types/saveLoadoutTypes.ts +3 -3
@@ -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