Example #1
0
 public static void MoveItem(KIS_Item srcItem, ModuleKISInventory tgtInventory, int tgtSlot)
 {
     ModuleKISInventory srcInventory = srcItem.inventory;
     int srcSlot = srcItem.slot;
     tgtInventory.items.Add(tgtSlot, srcItem);
     srcItem.inventory.items.Remove(srcSlot);
     srcItem.inventory = tgtInventory;
     tgtInventory.items[tgtSlot].OnMove(srcInventory, tgtInventory);
     srcInventory.RefreshMassAndVolume();
     tgtInventory.RefreshMassAndVolume();
 }
Example #2
0
 private IEnumerator WaitAndTransferItems(Dictionary<int, KIS_Item> transferedItems, ProtoCrewMember protoCrew, ModuleKISInventory srcInventory = null)
 {
     yield return new WaitForFixedUpdate();
     InternalSeat seat = this.part.internalModel.seats[podSeat];
     if (seat.crew == protoCrew)
     {
         MoveItems(transferedItems, this);
         KIS_Shared.DebugLog("Item transfer | destination :" + this.part.name + " (" + this.podSeat + ")");
         this.RefreshMassAndVolume();
         if (srcInventory) srcInventory.RefreshMassAndVolume();
     }
 }
Example #3
0
 private IEnumerator WaitAndTransferItems(Dictionary<int, KIS_Item> transferedItems, ProtoCrewMember protoCrew, ModuleKISInventory srcInventory = null)
 {
     yield return new WaitForFixedUpdate();
     ProtoCrewMember crewAtPodSeat = this.part.protoModuleCrew.Find(x => x.seatIdx == podSeat);
     if (crewAtPodSeat == protoCrew)
     {
         MoveItems(transferedItems, this);
         KIS_Shared.DebugLog("Item transfer | destination :" + this.part.name + " (" + this.podSeat + ")");
         this.RefreshMassAndVolume();
         if (srcInventory) srcInventory.RefreshMassAndVolume();
     }
 }