예제 #1
0
 static void Prefix(PawnRenderer __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null || Current.ProgramState != ProgramState.Playing)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance.pawn.MapHeld);
 }
예제 #2
0
 static void Prefix(ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null || WorldRendererUtility.WorldRenderedNow || Find.CurrentMap == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(Find.CurrentMap);
 }
예제 #3
0
 static void Prefix(Map __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance);
 }
예제 #4
0
 static void Prefix(Sample __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.game == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance.Map);
 }
예제 #5
0
 static void Prefix(Sustainer __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance.info.Maker.Map);
 }
        static void Prefix(int ___tile, ref TimeSnapshot?__state)
        {
            if (Multiplayer.Client == null)
            {
                return;
            }

            Map map = Current.Game.FindMap(___tile);

            if (map == null)
            {
                return;
            }

            __state = TimeSnapshot.GetAndSetFromMap(map);
        }
예제 #7
0
        public static TimeSnapshot?GetAndSetFromMap(Map map)
        {
            if (map == null)
            {
                return(null);
            }

            TimeSnapshot prev = Current();

            var man  = Find.TickManager;
            var comp = map.AsyncTime();

            man.ticksGameInt = comp.mapTicks;
            man.slower       = comp.slower;
            man.CurTimeSpeed = comp.TimeSpeed;

            return(prev);
        }
예제 #8
0
        static void Prefix(ref Func <string> textGetter)
        {
            if (Multiplayer.game == null)
            {
                return;
            }

            var current = TimeSnapshot.Current();
            var getter  = textGetter;

            textGetter = () =>
            {
                var prev = TimeSnapshot.Current();
                current.Set();
                string s = getter();
                prev.Set();

                return(s);
            };
        }