Пример #1
0
            /*
             * There would be an error message saying that the snow shelter is in perfect condition.
             * We don't have translations for all languages, so let's just disable it instead.
             */

            private static void Postfix(Panel_SnowShelterInteract __instance)
            {
                if (IsSnowShelterRuined(__instance))
                {
                    __instance.m_ErrorLabel.gameObject.SetActive(false);
                }
            }
Пример #2
0
 private static void Postfix(Panel_SnowShelterInteract __instance)
 {
     if (IsSnowShelterRuined(__instance))
     {
         Utils.SetActive(__instance.m_BottomRightActionButton, false);
     }
 }
Пример #3
0
 private static bool Prefix(ref bool __result, Panel_SnowShelterInteract __instance)
 {
     if (IsSnowShelterRuined(__instance))
     {
         __result = false;                 // Don't let it be repaired
         return(false);                    // Don't run the original method
     }
     return(true);
 }
Пример #4
0
            private static void Prefix(Panel_SnowShelterInteract __instance)
            {
                SnowShelter snowShelter = Traverse.Create(__instance).Field("m_SnowShelter").GetValue <SnowShelter>();

                if (snowShelter && snowShelter.IsRuined())
                {
                    snowShelter.m_NumSticksFromDismantle = STICKS_FROM_RUINED_DISMANTLE;
                    snowShelter.m_NumClothFromDismantle  = CLOTH_FROM_RUINED_DISMANTLE;
                }
            }
Пример #5
0
            private static void Postfix(Panel_SnowShelterInteract __instance)
            {
                Panel_Inventory_Examine_MenuItem repairItem = __instance.m_Button_Repair.GetComponent <Panel_Inventory_Examine_MenuItem>();
                Panel_Inventory_Examine_MenuItem useItem    = __instance.m_Button_Use.gameObject.GetComponent <Panel_Inventory_Examine_MenuItem>();

                // Copy disabled colors from repair button
                useItem.m_TextColor_Disabled         = repairItem.m_TextColor_Disabled;
                useItem.m_TextColor_DisabledHover    = repairItem.m_TextColor_DisabledHover;
                useItem.m_TextColor_DisabledSelected = repairItem.m_TextColor_DisabledSelected;
            }
Пример #6
0
            private static void Postfix(Panel_SnowShelterInteract __instance)
            {
                UILocalize calorieStoreHeader = __instance.m_CurrentCaloriesLabel.GetComponent <UILocalize>();

                //calorieStoreHeader.key = "GAMEPLAY_CalorieStore";
                SetKey(calorieStoreHeader, "GAMEPLAY_CalorieStore");

                Transform  estimatedCaloriesHeader = __instance.m_EstimatedCaloriesBurnedLabel.transform.parent.Find("Header");
                UILocalize localize = estimatedCaloriesHeader.GetComponent <UILocalize>();

                //localize.key = "GAMEPLAY_Hunger";
                SetKey(localize, "GAMEPLAY_Hunger");
            }
Пример #7
0
        private static void UpdateSnowShelterInteractPanel(Panel_SnowShelterInteract panel)
        {
            float       hours           = panel.GetTaskDurationInHours();
            float       origBurnRate    = panel.GetCalorieBurnRate();
            float       calorieBurnRate = GameManager.GetPlayerManagerComponent().CalculateModifiedCalorieBurnRate(origBurnRate);
            HungerTuple simulation      = HungerRevamped.Instance.SimulateHungerBar(calorieBurnRate, hours);

            UILabel calorieStoreLabel = panel.m_CurrentCaloriesValLabel.GetComponent <UILabel>();
            int     storedCalories    = Mathf.RoundToInt(simulation.storedCalories);

            calorieStoreLabel.text = storedCalories.ToString();

            UILabel hungerLabel   = panel.m_EstimatedCaloriesBurnedLabel.GetComponent <UILabel>();
            int     hungerPercent = Mathf.RoundToInt(simulation.hungerRatio * 100f);

            hungerLabel.text = hungerPercent.ToString() + "%";
        }
Пример #8
0
 private static bool Prefix(Panel_SnowShelterInteract __instance)
 {
     UpdateSnowShelterInteractPanel(__instance);
     return(false);
 }
Пример #9
0
            private static void Postfix(Panel_SnowShelterInteract __instance)
            {
                Panel_Inventory_Examine_MenuItem menuItem = __instance.m_Button_Use.gameObject.GetComponent <Panel_Inventory_Examine_MenuItem>();

                menuItem.SetDisabled(IsSnowShelterRuined(__instance));
            }
Пример #10
0
        private static bool IsSnowShelterRuined(Panel_SnowShelterInteract panel)
        {
            SnowShelter snowShelter = Traverse.Create(panel).Field("m_SnowShelter").GetValue <SnowShelter>();

            return(snowShelter && snowShelter.IsRuined());
        }