/// <summary> /// Applied before GetFormattedHeatEnergyRate runs. /// </summary> internal static bool Prefix(float dtu_s, GameUtil.HeatEnergyFormatterUnit unit, ref string __result) { var text = CACHED_BUILDER; string unitText; text.Clear(); switch (unit) { case GameUtil.HeatEnergyFormatterUnit.DTU_S: unitText = SUFFIXES.HEAT.DTU_S; break; case GameUtil.HeatEnergyFormatterUnit.KDTU_S: unitText = SUFFIXES.HEAT.KDTU_S; break; default: if (Mathf.Abs(dtu_s) > 1000.0f) { dtu_s *= 0.001f; unitText = SUFFIXES.HEAT.KDTU_S; } else { unitText = SUFFIXES.HEAT.DTU_S; } break; } dtu_s.ToRyuSoftString(text, 2); __result = text.Append(unitText).ToString(); return(false); }
/// <summary> /// Applied before GetFormattedHeatEnergy runs. /// </summary> internal static bool Prefix(float dtu, GameUtil.HeatEnergyFormatterUnit unit, ref string __result) { var text = CACHED_BUILDER; text.Clear(); switch (unit) { case GameUtil.HeatEnergyFormatterUnit.DTU_S: dtu.ToRyuHardString(text, 0); text.Append(SUFFIXES.HEAT.DTU); break; case GameUtil.HeatEnergyFormatterUnit.KDTU_S: (dtu * 0.001f).ToRyuSoftString(text, 2); text.Append(SUFFIXES.HEAT.KDTU); break; default: if (Mathf.Abs(dtu) > 1000.0f) { (dtu * 0.001f).ToRyuSoftString(text, 2); text.Append(SUFFIXES.HEAT.KDTU); } else { dtu.ToRyuHardString(text, 0); text.Append(SUFFIXES.HEAT.DTU); } break; } __result = text.ToString(); return(false); }