0666aad779
Occurs when player moves item from quick access panel to inventory Small optimistion for `Bind` event, once item is found, exit loop
129 lines
6.3 KiB
TypeScript
129 lines
6.3 KiB
TypeScript
import { inject, injectable } from "tsyringe";
|
|
|
|
import { InventoryController } from "@spt-aki/controllers/InventoryController";
|
|
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
|
import { IInventoryBindRequestData } from "@spt-aki/models/eft/inventory/IInventoryBindRequestData";
|
|
import { IInventoryCreateMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryCreateMarkerRequestData";
|
|
import { IInventoryDeleteMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
|
import { IInventoryEditMarkerRequestData } from "@spt-aki/models/eft/inventory/IInventoryEditMarkerRequestData";
|
|
import { IInventoryExamineRequestData } from "@spt-aki/models/eft/inventory/IInventoryExamineRequestData";
|
|
import { IInventoryFoldRequestData } from "@spt-aki/models/eft/inventory/IInventoryFoldRequestData";
|
|
import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData";
|
|
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
|
|
import { IInventoryReadEncyclopediaRequestData } from "@spt-aki/models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
|
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
|
|
import { IInventorySortRequestData } from "@spt-aki/models/eft/inventory/IInventorySortRequestData";
|
|
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
|
|
import { IInventorySwapRequestData } from "@spt-aki/models/eft/inventory/IInventorySwapRequestData";
|
|
import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInventoryTagRequestData";
|
|
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
|
|
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
|
|
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
|
|
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
|
|
|
@injectable()
|
|
export class InventoryCallbacks
|
|
{
|
|
constructor(
|
|
@inject("InventoryController") protected inventoryController: InventoryController
|
|
)
|
|
{ }
|
|
|
|
/** Handle Move event */
|
|
public moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.moveItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle Remove event */
|
|
public removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.discardItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle Split event */
|
|
public splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.splitItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.mergeItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.transferItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle Swap */
|
|
// TODO: how is this triggered
|
|
public swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.swapItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.foldItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.toggleItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.tagItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.bindItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public unbindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.unbindItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
public examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.examineItem(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle ReadEncyclopedia */
|
|
public readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.readEncyclopedia(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle ApplyInventoryChanges */
|
|
public sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.sortInventory(pmcData, body, sessionID);
|
|
}
|
|
|
|
public createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.createMapMarker(pmcData, body, sessionID);
|
|
}
|
|
|
|
public deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.deleteMapMarker(pmcData, body, sessionID);
|
|
}
|
|
|
|
public editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.editMapMarker(pmcData, body, sessionID);
|
|
}
|
|
|
|
/** Handle OpenRandomLootContainer */
|
|
public openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse
|
|
{
|
|
return this.inventoryController.openRandomLootContainer(pmcData, body, sessionID);
|
|
}
|
|
} |