Esempio n. 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);
 }
Esempio n. 2
0
 static void Prefix(ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null || WorldRendererUtility.WorldRenderedNow || Find.CurrentMap == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(Find.CurrentMap);
 }
Esempio n. 3
0
 static void Prefix(Map __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.Client == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance);
 }
Esempio n. 4
0
 static void Prefix(Sample __instance, ref TimeSnapshot?__state)
 {
     if (Multiplayer.game == null)
     {
         return;
     }
     __state = TimeSnapshot.GetAndSetFromMap(__instance.Map);
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
            };
        }