static bool Prefix(Caravan caravan)
        {
            //When not playing multiplayer, don't modify behavior.
            if (Multiplayer.Client == null)
            {
                return(true);
            }

            //If in the middle of creating a proxy, don't cancel.
            //This is needed since CaravanSplittingProxy uses Dialog_SplitCaravan as a base class.
            if (CaravanSplittingProxy.CreatingProxy)
            {
                return(true);
            }

            //Otherwise cancel creation of the Dialog_SplitCaravan.
            //  If there's already an active session, open the window associated with it.
            //  Otherwise, create a new session.
            if (Multiplayer.WorldComp.splitSession != null)
            {
                Multiplayer.WorldComp.splitSession.OpenWindow(true);
            }
            else
            {
                CaravanSplittingSession.CreateSplittingSession(caravan);
            }

            return(false);
        }
コード例 #2
0
 private void CancelButtonClicked()
 {
     CaravanSplittingSession.CancelSplittingSession();
 }
コード例 #3
0
 private void ResetButtonClicked()
 {
     SoundDefOf.Tick_Low.PlayOneShotOnCamera();
     CaravanSplittingSession.ResetSplittingSession();
 }
コード例 #4
0
 private void AcceptButtonClicked()
 {
     CaravanSplittingSession.AcceptSplitSession();
 }