/// <summary> /// Opens the dialog for a currently ongoing session. This should only be called /// when the dialog has been closed but the session still running. /// I.E. one player has closed the window without accepting/cancelling the session. /// </summary> public void OpenWindow(bool sound = true) { dialog = PrepareDialogProxy(); if (!sound) { dialog.soundAppear = null; } CaravanUIUtility.CreateCaravanTransferableWidgets( transferables, out dialog.pawnsTransfer, out dialog.itemsTransfer, out dialog.foodAndMedicineTransfer, "SplitCaravanThingCountTip".Translate(), IgnorePawnsInventoryMode.Ignore, () => dialog.DestMassCapacity - dialog.DestMassUsage, false, Caravan.Tile, false ); dialog.CountToTransferChanged(); Find.WindowStack.Add(dialog); }
private void AddItems() { CaravanSplittingProxy.CreatingProxy = true; dialog = new CaravanSplittingProxy(Caravan) { session = this }; CaravanSplittingProxy.CreatingProxy = false; dialog.CalculateAndRecacheTransferables(); transferables = dialog.transferables; Find.WindowStack.Add(dialog); }
private CaravanSplittingProxy PrepareDialogProxy() { CaravanSplittingProxy.CreatingProxy = true; var newProxy = new CaravanSplittingProxy(Caravan) { transferables = transferables, session = this }; CaravanSplittingProxy.CreatingProxy = false; return(newProxy); }