Beispiel #1
0
            }                                                 // skip original method

            static void Postfix(StarmapScreen __instance)
            {
                var           ranges        = SolidBoosterStats.Ranges;
                List <string> rangeDivisors = new List <string>();

                foreach (var range in ranges)
                {
                    rangeDivisors.Add(StarmapScreenOverhaul.FormatDistance(range, ""));
                }

                __instance.Get(out BreakdownList rocketDetailsFuel, nameof(rocketDetailsFuel));
                BreakdownList list = rocketDetailsFuel;

                __instance.Get(out CommandModule currentCommandModule, nameof(currentCommandModule));
                RocketStatsOverhaul stats = (RocketStatsOverhaul)currentCommandModule.rocketStats;

                list.SetTitle(StarmapScreenOverhaul.Caption.TotalBoosterThrust);
                list.SetIcon(__instance.rocketDetailsFuelIcon);
                list.gameObject.name = nameof(rocketDetailsFuel);
                list.ClearRows();

                string moduleName   = "";
                int    boosterCount = 0;

                foreach (GameObject gameObject in stats.BuildingNetworkEnumerable())
                {
                    SolidBooster component = gameObject.GetComponent <SolidBooster>();
                    if (component != null)
                    {
                        moduleName = gameObject.gameObject.GetProperName();
                        boosterCount++;
                    }
                }

                float boosterKmRemaining = stats.GetBoosterThrust();

                for (int i = 0; i < boosterCount; ++i)
                {
                    if (boosterKmRemaining <= GetRange(ranges, i))
                    {
                        list.AddRow().ShowData(moduleName, StarmapScreenOverhaul.FormatDistance(boosterKmRemaining, "+", "") + "/" + rangeDivisors[i]);
                        boosterKmRemaining -= boosterKmRemaining;
                    }
                    else
                    {
                        list.AddRow().ShowData(moduleName, StarmapScreenOverhaul.FormatDistance(GetRange(ranges, i), "+", "") + "/" + rangeDivisors[i]);
                        boosterKmRemaining -= GetRange(ranges, i);
                    }
                }

                AddImportant(list, StarmapScreenOverhaul.Caption.TotalBoosterThrust, stats.GetBoosterThrust());
            }
Beispiel #2
0
            }                                                 // skip original method

            static void Postfix(RocketStats __instance, ref float __result)
            {
                RocketStatsOverhaul _this = (RocketStatsOverhaul)__instance;

                __result = _this.GetBoosterThrust();
                TryLog(nameof(GetBoosterThrust) + ": " + __result);
            }
Beispiel #3
0
            }                                                 // skip original method

            static void Postfix(StarmapScreen __instance)
            {
                __instance.Get(out BreakdownList rocketDetailsRange, nameof(rocketDetailsRange));
                BreakdownList list = rocketDetailsRange;

                __instance.Get(out RocketThrustWidget rocketThrustWidget, nameof(rocketThrustWidget));
                __instance.Get(out CommandModule currentCommandModule, nameof(currentCommandModule));
                RocketStatsOverhaul stats = (RocketStatsOverhaul)currentCommandModule.rocketStats;

                list.ClearRows();

                AddImportant(list, StarmapScreenOverhaul.Caption.TotalEngineThrust, stats.GetEngineThrust());
                AddImportantOxidizer(list, StarmapScreenOverhaul.Caption.TotalOxidizerEfficiency, stats.GetAverageOxidizerEfficiency(), stats.GetEfficiencyContribution());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalBoosterThrust, stats.GetBoosterThrust());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalPayload, -stats.GetModulePenalty());
                AddImportant(list, StarmapScreenOverhaul.Caption.TotalDistance, stats.GetRocketMaxDistance());
            }