private static void Postfix(Panel_SnowShelterBuild __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"); }
private static void UpdateSnowShelterBuildPanel(Panel_SnowShelterBuild panel) { float hours = panel.m_DurationHours; float origBurnRate = GameManager.GetHungerComponent().m_CalorieBurnPerHourBuildingSnowShelter; 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() + "%"; }
private static bool Prefix(Panel_SnowShelterBuild __instance) { UpdateSnowShelterBuildPanel(__instance); return(false); }