using UnityEngine.Scripting; [Preserve] public class XUiC_CompassWindowRebirth : XUiC_CompassWindow { public readonly CachedStringFormatter levelFormatter = new CachedStringFormatter((Func)([PublicizedFrom(EAccessModifier.Internal)] (_i) => _i.ToString("+0;-#"))); public override bool GetBindingValue(ref string value, string bindingName) { if (bindingName == "isHordeNightLonger") { if (RebirthUtilities.IsHordeNight()) { value = "true"; } else { bool isHordeNightLonger = RebirthUtilities.isHordeNightLonger(); //Log.Out("XUiC_CompassWindowRebirth-GetBindingValue isHordeNightLonger: " + isHordeNightLonger); if (isHordeNightLonger) { value = "true"; } else { value = "false"; } } return true; } else if (bindingName == "isPurge") { if (!RebirthVariables.purgeDisplay) { value = "false"; } else { value = "true"; } return true; } else if (bindingName == "purgeVolumes") { value = RebirthVariables.currentSleeperVolumeCount.ToString(); return true; } else if (bindingName == "purgeEntities") { value = RebirthVariables.currentSleeperEntityCount.ToString(); if (RebirthVariables.currentSleeperVolumeCount > 1) { value = value + "+"; } else { if (RebirthVariables.currentSleeperEntityCount == 0) { value = "1+"; } else { value = value + "-"; } } return true; } else if (bindingName == "isNotHordeNight") { if (RebirthUtilities.IsHordeNight()) { value = "false"; } else { value = "true"; } return true; } else if (bindingName == "isPastHordeNight") { if (RebirthUtilities.IsHordeNight()) { value = "-55"; } else { bool isPastHordeNight = RebirthUtilities.isPastHordeNight(); //Log.Out("XUiC_CompassWindowRebirth-GetBindingValue isPastHordeNight: " + isPastHordeNight); if (isPastHordeNight) { value = "-85"; } else { value = "-55"; } } return true; } else if (bindingName == "hnHeadshots") { value = RebirthVariables.localConstants["$varFuriousRamsayHNHeadShots_Cst"].ToString(); return true; } else if (bindingName == "hnKills") { value = RebirthVariables.localConstants["$varFuriousRamsayHNKills_Cst"].ToString(); return true; } else if (bindingName == "lootstage") { value = ((this.localPlayer != null) ? this.localPlayer.GetHighestPartyLootStage(0f, 0f).ToString() : ""); return true; } else if (bindingName == "mapelevation") { if (XUi.IsGameRunning() && this.xui.playerUI.entityPlayer != null) { int _v1 = Mathf.RoundToInt(this.xui.playerUI.entityPlayer.GetPosition().y - WeatherManager.SeaLevel()); value = this.levelFormatter.Format(_v1); } return true; } else if (bindingName == "playerlevel") { int playerLevel = 0; if (this.localPlayer != null) { playerLevel = this.localPlayer.Progression.GetLevel(); //Log.Out("LEVEL: " + playerLevel); } value = playerLevel.ToString(); return true; } return base.GetBindingValue(ref value, bindingName); } }