Ejemplo n.º 1
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());
            }
Ejemplo n.º 2
0
            }                                                 // skip original method

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

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

                list.SetTitle(StarmapScreenOverhaul.Caption.TotalPayload);
                list.SetIcon(__instance.rocketDetailsStorageIcon);
                list.gameObject.name = nameof(rocketDetailsOxidizer);
                list.ClearRows();

                // add row for each module
                foreach (GameObject gameObject in stats.BuildingNetworkEnumerable())
                {
                    string penalty = null;
                    if (gameObject.GetComponent <CargoBay>() != null)
                    {
                        penalty = StarmapScreenOverhaul.FormatDistance(-ModulePenalties.CargoPenalty);
                    }
                    else if (gameObject.GetComponent <TouristModule>() != null)
                    {
                        penalty = StarmapScreenOverhaul.FormatDistance(-ModulePenalties.TouristPenalty);
                    }
                    else if (gameObject.GetComponent <ResearchModule>() != null)
                    {
                        penalty = StarmapScreenOverhaul.FormatDistance(-ModulePenalties.ResearchPenalty);
                    }

                    if (penalty != null)                     // was this a module that we are counting?
                    {
                        string moduleName = gameObject.gameObject.GetProperName();
                        list.AddRow().ShowData(moduleName, penalty);
                    }
                }

                AddImportant(list, StarmapScreenOverhaul.Caption.TotalPayload, -stats.GetModulePenalty());
            }