Example #1
0
        static bool Prefix(SG_HiringHall_Screen __instance, Pilot p,
                           ref Pilot ___selectedPilot, GameObject ___DescriptionAreaObject,
                           SG_HiringHall_DetailPanel ___DetailPanel, SG_HiringHall_MWSelectedPanel ___MWSelectedPanel)
        {
            ___selectedPilot = p;
            ___DescriptionAreaObject.SetActive(value: true);
            ___DetailPanel.SetPilot(___selectedPilot);
            ___MWSelectedPanel.SetPilot(___selectedPilot);
            __instance.WarningsCheck();
            __instance.UpdateMoneySpot();

            // Performance tweak; skip immediate refresh
            __instance.ForceRefreshImmediate();

            return(false);
        }
Example #2
0
        static void Postfix(SG_HiringHall_MWSelectedPanel __instance, Pilot p, LocalizableText ___BaseSalaryText)
        {
            if (p != null && ___BaseSalaryText != null)
            {
                Mod.Log.Debug?.Write($"Updating MWSelectedPanel for pilot: {p.Name}");

                // Account for the salary
                CrewDetails details         = ModState.GetCrewDetails(p.pilotDef);
                int         modifiedSalary  = (int)Mathf.RoundToInt(details.AdjustedSalary);
                string      modifiedSalaryS = SimGameState.GetCBillString(modifiedSalary);
                Mod.Log.Debug?.Write($"  -- salary will be: {modifiedSalaryS}");

                string salaryS = new Text(Mod.LocalizedText.Labels[ModText.LT_Crew_Salary_Label], new string[] { modifiedSalaryS })
                                 .ToString();
                ___BaseSalaryText.SetText(salaryS);
            }
        }