private static void Postfix(Panel_FirstAid __instance)
        {
            GameObject newGameObject = NGUITools.AddChild(__instance.m_TimeWidgetPos, __instance.m_ColdStatusLabel.gameObject);

            newGameObject.transform.localPosition = new Vector3(-45, -22, 0);
            Solstice_RV.attachSeasonLabel(newGameObject);
        }
Beispiel #2
0
            private static void Prefix(Panel_FirstAid __instance)
            {
                Transform airTempRow   = __instance.m_AirTempLabel.transform.parent;
                Transform windChillRow = __instance.m_WindchillLabel.transform.parent;
                Transform feelsLikeRow = __instance.m_FeelsLikeLabel.transform.parent;

                GameObject storedCaloriesRow = NGUITools.AddChild(windChillRow.parent.gameObject, windChillRow.gameObject);

                storedCaloriesRow.name = "StoredCaloriesWarmthLabel";
                UISprite icon = storedCaloriesRow.transform.Find("Stat Icon").GetComponent <UISprite>();

                icon.spriteName = "ico_status_hunger4";                 // old: ico_HUD_hunger, ico_Radial_food2
                icon.transform.localPosition += new Vector3(-1, 0);     // Tiny position nudge to center icon properly
                UILocalize nameLabel = storedCaloriesRow.transform.Find("Stat Label").GetComponent <UILocalize>();

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

                const float basePos = 24;

                airTempRow.transform.localPosition        = new Vector3(0, basePos, 0);
                windChillRow.transform.localPosition      = new Vector3(0, basePos - 26, 0);
                storedCaloriesRow.transform.localPosition = new Vector3(0, basePos - 52, 0);
                feelsLikeRow.transform.localPosition     -= new Vector3(0, 5, 0);
            }
Beispiel #3
0
            private static void Postfix(Panel_FirstAid __instance)
            {
                Color red   = __instance.m_PoorHealthStatusColor;
                Color green = InterfaceManager.m_Panel_ActionsRadial.m_FirstAidBuffColor;

                // Replace hunger bar calories with stored calories
                double storedCalories = HungerRevamped.Instance.storedCalories;

                __instance.m_CalorieStoreLabel.text  = Convert.ToInt64(storedCalories).ToString();
                __instance.m_CalorieStoreLabel.color = (storedCalories < 250.0) ? red : Color.white;

                // Set status labels to red when below starving hunger ratio
                Hunger hunger      = HungerRevamped.Instance.hunger;
                float  hungerRatio = Mathf.Clamp01(hunger.m_CurrentReserveCalories / hunger.m_MaxReserveCalories);

                __instance.m_HungerPercentLabel.color = (hungerRatio < Tuning.hungerLevelStarving) ? red : Color.white;
                __instance.m_HungerStatusLabel.color  = (hungerRatio < Tuning.hungerLevelStarving) ? red : green;

                // Adjust hunger status labels (starving, ravenous, hungry, peckish, full)
                int hungerLevel = 0;

                while (hungerLevel < HUNGER_LEVELS.Length && hungerRatio >= HUNGER_LEVELS[hungerLevel])
                {
                    ++hungerLevel;
                }
                __instance.m_HungerStatusLabel.text = Localization.Get(__instance.m_HungerStatusLocIDs[hungerLevel]);

                // Adjust stored calories freezing bonus
                Transform container   = __instance.m_WindchillLabel.gameObject.transform.parent.parent;
                UILabel   label       = container.Find("StoredCaloriesWarmthLabel/Stat Value").GetComponent <UILabel>();
                float     warmthBonus = HungerRevamped.Instance.GetStoredCaloriesWarmthBonus();

                label.text  = Utils.GetTemperatureString(warmthBonus, true, true, false);
                label.color = (warmthBonus >= 0) ? Color.white : __instance.m_PoorHealthStatusColor;
            }
Beispiel #4
0
        private static void Prefix(Panel_FirstAid __instance)
        {
            if (initialized)
            {
                return;
            }
            initialized = true;

            CenterStatusLabel(__instance.m_ColdStatusLabel);
            CenterStatusLabel(__instance.m_FatigueStatusLabel);
            CenterStatusLabel(__instance.m_ThirstStatusLabel);
            CenterStatusLabel(__instance.m_HungerStatusLabel);

            ActivateAndMovePercentLabel(__instance.m_ColdPercentLabel);
            ActivateAndMovePercentLabel(__instance.m_FatiguePercentLabel);
            ActivateAndMovePercentLabel(__instance.m_ThirstPercentLabel);
            ActivateAndMovePercentLabel(__instance.m_HungerPercentLabel);

            ActivateAndMoveConditionLabel(__instance.m_LabelConditionPercent);
        }