Example #1
0
 public static void Prefix(DropshipLocation state)
 {
     if (state != DropshipLocation.NAVIGATION)
     {
         MapModesUI.TurnMapModeOff();
     }
 }
Example #2
0
 public void Unapply(SimGameState simGame)
 {
     foreach (var system in simGame.StarSystemDictionary.Keys)
     {
         MapModesUI.ScaleSystem(system, 0.5f);
     }
 }
Example #3
0
        public void Apply(SimGameState simGame)
        {
            var visitedSystems = Traverse.Create(simGame).Field("VisitedStarSystems").GetValue <List <string> >();

            foreach (var system in visitedSystems)
            {
                MapModesUI.DimSystem(system, _dimLevel);
            }
        }
Example #4
0
        // ENTRY POINT
        public static void Init(string modDir, string modSettings)
        {
            var harmony = HarmonyInstance.Create("io.github.mpstark.NavigationComputer");

            harmony.PatchAll(Assembly.GetExecutingAssembly());
            HBSLog = Logger.GetLogger("NavigationComputer");

            MapModesUI.Setup();
        }
Example #5
0
        public void Apply(SimGameState simGame)
        {
            foreach (var system in simGame.StarSystemDictionary.Keys)
            {
                var starSystem = simGame.StarSystemDictionary[system];
                var difficulty = starSystem.Def.GetDifficulty(simGame.SimGameMode);

                MapModesUI.ScaleSystem(system, difficulty / 5f);
            }
        }
Example #6
0
        public static bool Prefix(ref bool __result)
        {
            if (MapModesUI.CurrentMapMode == null)
            {
                return(true);
            }

            // the return value in __result is if the esc was handled
            MapModesUI.TurnMapModeOff();
            __result = true;
            return(false);
        }
Example #7
0
        private void ApplyFilter(SimGameState simGame, string searchString)
        {
            searchString = searchString.ToLower();
            var andSplit   = searchString.Split('&');
            var searchTree = andSplit.Select(andTerm => andTerm.Split('|').Select(orTerm => new SearchValue(orTerm)).ToArray()).ToArray();

            foreach (var systemID in simGame.StarSystemDictionary.Keys)
            {
                var system  = simGame.StarSystemDictionary[systemID];
                var matches = searchTree.All(andTerm => andTerm.Any(searchValue => DoesSystemMatchSearch(system, searchValue)));

                // dim level of 1 means it should "stay" the reg system color
                MapModesUI.DimSystem(systemID, matches ? 1 : _dimLevel);
            }
        }
Example #8
0
        public static void Postfix()
        {
            foreach (var key in MapModesUI.DiscreteMapModes.Keys)
            {
                if (Input.GetKeyUp(key))
                {
                    MapModesUI.ToggleMapMode(key);
                }
            }

            if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.F))
            {
                MapModesUI.StartSearching();
            }
        }
Example #9
0
 public static void Postfix(SGNavigationScreen __instance, SimGameState simGame)
 {
     MapModesUI.SetupUIObjects(__instance);
     MapModesUI.SimGame = simGame;
 }
Example #10
0
 public static void Prefix()
 {
     MapModesUI.TurnMapModeOff();
 }