internal class XUiC_ShowDismemberRebirth : XUiController { private EntityPlayerLocal LocalPlayer; private readonly CachedStringFormatterXuiRgbaColor stealthColorFormatter = new CachedStringFormatterXuiRgbaColor(); private readonly CachedStringFormatter statfillFormatter = new CachedStringFormatter((Func)(_i => _i.ToCultureInvariantString())); private readonly CachedStringFormatter statcurrentWMaxFormatterAOfB = new CachedStringFormatter((Func)((_i, _i1) => string.Format("{0}/{1}", (object)_i, (object)_i1))); private readonly CachedStringFormatter statmodifiedmaxFormatter = new CachedStringFormatter((Func)((_f1, _f2) => (_f1 / _f2).ToCultureInvariantString())); public override bool GetBindingValue(ref string value, string bindingName) { //Log.Out("XUiC_ShowDismemberRebirth-GetBindingValue START"); float flDismemberCountdown = 0; float flDismemberTotalCounter = 0; float flDismemberHUD = 0; if (this.LocalPlayer != null) { flDismemberCountdown = this.LocalPlayer.Buffs.GetCustomVar(".FuriousRamsayDismemberedHeadTotalCountdown"); flDismemberTotalCounter = this.LocalPlayer.Buffs.GetCustomVar(".FuriousRamsayDismemberedHeadTotalCounter"); flDismemberHUD = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayDismemberHUD"); } switch (bindingName) { case "dismemberCount": value = flDismemberTotalCounter.ToString(); return true; case "statDismemberFill": if (this.LocalPlayer == null) { //Log.Out("XUiC_ShowDismemberRebirth-GetBindingValue 2"); value = "0"; return true; } value = (flDismemberCountdown / 8).ToString(); return true; case "statDismemberVisible": if (this.xui.dragAndDrop.InMenu || flDismemberHUD == 0) { value = "false"; //Log.Out("XUiC_ShowDismemberRebirth-GetBindingValue 4 statDismemberVisible: " + value); return true; } if (flDismemberCountdown <= 0 || flDismemberTotalCounter <= 0) { //Log.Out("XUiC_ShowDismemberRebirth-GetBindingValue 5 statDismemberVisible: " + value); value = "false"; } else { //Log.Out("XUiC_ShowDismemberRebirth-GetBindingValue 6 statDismemberVisible: " + value); value = "true"; } return true; default: return false; } } public override void OnOpen() { //Log.Out("XUiC_ShowDismemberRebirth-OnOpen START"); base.OnOpen(); if (this.LocalPlayer == null && XUi.IsGameRunning()) { //Log.Out("XUiC_ShowDismemberRebirth-OnOpen 1"); this.LocalPlayer = this.xui.playerUI.entityPlayer; } this.IsDirty = true; this.RefreshBindings(true); } private float currentTime; public override void Update(float _dt) { this.currentTime -= _dt; base.Update(_dt); if (this.LocalPlayer == null) { //Log.Out("XUiC_ShowDismemberRebirth-Update 1"); return; } else { if (this.LocalPlayer.Buffs.HasBuff("FuriousRamsayDismemberedHeadCounter")) { this.RefreshBindings(true); } } } }