private static void OnClicked_Prefix(GameUtil.TemperatureUnit unit) { var multipleUnit = VanillaToMultiple(unit); if ((State.Unit ^ multipleUnit) != 0) { FlipUnit(multipleUnit); } Save(); }
private static void OnClicked_Postfix(GameUtil.TemperatureUnit unit) { var multipleUnit = VanillaToMultiple(unit); if ((State.Unit & multipleUnit) == 0) { GameUtil.temperatureUnit = State.LastMainUnit; } else { State.LastMainUnit = unit; } }
private static TemperatureUnitMultiple VanillaToMultiple(GameUtil.TemperatureUnit vanilla) { switch (vanilla) { case GameUtil.TemperatureUnit.Celsius: return(TemperatureUnitMultiple.Celsius); case GameUtil.TemperatureUnit.Kelvin: return(TemperatureUnitMultiple.Kelvin); case GameUtil.TemperatureUnit.Fahrenheit: return(TemperatureUnitMultiple.Fahrenheit); default: State.Common.Logger.LogOnce("VanillaToMultiple: invalid unit"); return(TemperatureUnitMultiple.All); } }