feat: railjack skins #2400

Merged
Sainan merged 1 commits from rj-skins into main 2025-07-04 15:18:53 -07:00
3 changed files with 17 additions and 2 deletions

View File

@ -1395,7 +1395,11 @@ export const addSkin = (
if (inventory.WeaponSkins.some(x => x.ItemType == typeName)) { if (inventory.WeaponSkins.some(x => x.ItemType == typeName)) {
logger.debug(`refusing to add WeaponSkin ${typeName} because account already owns it`); logger.debug(`refusing to add WeaponSkin ${typeName} because account already owns it`);
} else { } else {
const index = inventory.WeaponSkins.push({ ItemType: typeName, IsNew: true }) - 1; const index =
inventory.WeaponSkins.push({
ItemType: typeName,
IsNew: typeName.startsWith("/Lotus/Upgrades/Skins/RailJack/") ? undefined : true // railjack skins are incompatible with this flag
}) - 1;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
inventoryChanges.WeaponSkins ??= []; inventoryChanges.WeaponSkins ??= [];
(inventoryChanges.WeaponSkins as IWeaponSkinClient[]).push( (inventoryChanges.WeaponSkins as IWeaponSkinClient[]).push(

View File

@ -172,6 +172,16 @@ export const handleInventoryItemConfigChange = async (
// seems always equal to the id of loadout config NORMAL[0], likely has no purpose and we're free to ignore it // seems always equal to the id of loadout config NORMAL[0], likely has no purpose and we're free to ignore it
break; break;
} }
case "ActiveCrewShip": {
if (inventory.CrewShips.length != 1) {
logger.warn(`saving railjack changes with broken inventory?`);
} else if (!inventory.CrewShips[0]._id.equals(equipmentChanges.ActiveCrewShip.$oid)) {
logger.warn(
`client provided CrewShip id ${equipmentChanges.ActiveCrewShip.$oid} but id in inventory is ${inventory.CrewShips[0]._id.toString()}`
);
}
break;
}
default: { default: {
if (equipmentKeys.includes(equipmentName as TEquipmentKey)) { if (equipmentKeys.includes(equipmentName as TEquipmentKey)) {
logger.debug(`general Item config saved of type ${equipmentName}`, { logger.debug(`general Item config saved of type ${equipmentName}`, {
@ -221,7 +231,7 @@ export const handleInventoryItemConfigChange = async (
} }
break; break;
} else { } else {
logger.error(`loadout category not implemented, changes will be lost: ${equipmentName}`, { logger.warn(`unknown saveLoadout field: ${equipmentName}`, {
config: equipment config: equipment
}); });
} }

View File

@ -40,6 +40,7 @@ export interface ISaveLoadoutRequest {
CrewShips: IItemEntry; CrewShips: IItemEntry;
CurrentLoadOutIds: IOid[]; CurrentLoadOutIds: IOid[];
ValidNewLoadoutId: string; ValidNewLoadoutId: string;
ActiveCrewShip: IOid;
EquippedGear: string[]; EquippedGear: string[];
EquippedEmotes: string[]; EquippedEmotes: string[];
UseAdultOperatorLoadout: boolean; UseAdultOperatorLoadout: boolean;