コード例 #1
0
ファイル: CameraJumper.cs プロジェクト: sachdevs/RW-Decompile
        private static void TryJumpInternal(IntVec3 cell, Map map)
        {
            if (Current.ProgramState != ProgramState.Playing)
            {
                return;
            }
            if (!cell.IsValid)
            {
                return;
            }
            if (map == null || !Find.Maps.Contains(map))
            {
                return;
            }
            bool flag = CameraJumper.TryHideWorld();

            if (Current.Game.VisibleMap != map)
            {
                Current.Game.VisibleMap = map;
                if (!flag)
                {
                    SoundDefOf.MapSelected.PlayOneShotOnCamera(null);
                }
            }
            Find.CameraDriver.JumpToVisibleMapLoc(cell);
        }
コード例 #2
0
ファイル: CameraJumper.cs プロジェクト: sachdevs/RW-Decompile
 private static void TrySelectInternal(Thing thing)
 {
     if (Current.ProgramState != ProgramState.Playing)
     {
         return;
     }
     if (thing.Spawned && thing.def.selectable)
     {
         bool flag  = CameraJumper.TryHideWorld();
         bool flag2 = false;
         if (thing.Map != Current.Game.VisibleMap)
         {
             Current.Game.VisibleMap = thing.Map;
             flag2 = true;
             if (!flag)
             {
                 SoundDefOf.MapSelected.PlayOneShotOnCamera(null);
             }
         }
         if (flag || flag2)
         {
             Find.CameraDriver.JumpToVisibleMapLoc(thing.Position);
         }
         Find.Selector.ClearSelection();
         Find.Selector.Select(thing, true, true);
     }
 }
コード例 #3
0
 private static void TryJumpInternal(IntVec3 cell, Map map)
 {
     if (Current.ProgramState == ProgramState.Playing)
     {
         if (cell.IsValid)
         {
             if (map != null && Find.Maps.Contains(map))
             {
                 if (cell.InBounds(map))
                 {
                     bool flag = CameraJumper.TryHideWorld();
                     if (Find.CurrentMap != map)
                     {
                         Current.Game.CurrentMap = map;
                         if (!flag)
                         {
                             SoundDefOf.MapSelected.PlayOneShotOnCamera(null);
                         }
                     }
                     Find.CameraDriver.JumpToCurrentMapLoc(cell);
                 }
             }
         }
     }
 }
コード例 #4
0
 private static void TryJumpInternal(Thing thing)
 {
     if (Current.ProgramState == ProgramState.Playing)
     {
         Map mapHeld = thing.MapHeld;
         if (mapHeld != null && thing.PositionHeld.IsValid && thing.PositionHeld.InBounds(mapHeld))
         {
             bool flag = CameraJumper.TryHideWorld();
             if (Current.Game.VisibleMap != mapHeld)
             {
                 Current.Game.VisibleMap = mapHeld;
                 if (!flag)
                 {
                     SoundDefOf.MapSelected.PlayOneShotOnCamera(null);
                 }
             }
             Find.CameraDriver.JumpToVisibleMapLoc(thing.PositionHeld);
         }
     }
 }