598 lines
29 KiB
C#
598 lines
29 KiB
C#
internal class XUiC_CrosshairHUDRebirth : XUiController
|
|
{
|
|
private float lastValueStamina = 0.0f;
|
|
private float lastValueHealth = 0.0f;
|
|
private float lastValueWater = 0.0f;
|
|
private float lastValueFood = 0.0f;
|
|
private float lastValueStealth = 0.0f;
|
|
private float lastValueRage = 0.0f;
|
|
private float lastValueStaminaPerc = 0.0f;
|
|
private float lastValueHealthPerc = 0.0f;
|
|
private float lastValueWaterPerc = 0.0f;
|
|
private float lastValueFoodPerc = 0.0f;
|
|
private float lastValueStealthPerc = 0.0f;
|
|
private float lastValueRagePerc = 0.0f;
|
|
private float deltaTime;
|
|
private EntityPlayerLocal LocalPlayer;
|
|
private readonly CachedStringFormatterXuiRgbaColor stealthColorFormatter = new CachedStringFormatterXuiRgbaColor();
|
|
private readonly CachedStringFormatter<float> statfillFormatter = new CachedStringFormatter<float>((Func<float, string>)(_i => _i.ToCultureInvariantString()));
|
|
private readonly CachedStringFormatter<int, int> statcurrentWMaxFormatterAOfB = new CachedStringFormatter<int, int>((Func<int, int, string>)((_i, _i1) => string.Format("{0}/{1}", (object)_i, (object)_i1)));
|
|
private readonly CachedStringFormatter<float, float> statmodifiedmaxFormatter = new CachedStringFormatter<float, float>((Func<float, float, string>)((_f1, _f2) => (_f1 / _f2).ToCultureInvariantString()));
|
|
|
|
public override bool GetBindingValue(ref string value, string bindingName)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue START");
|
|
bool bHide = flUpdateTime < 80;
|
|
|
|
if (flUpdateTime < 80)
|
|
{
|
|
flUpdateTime = flUpdateTime + .1f;
|
|
}
|
|
|
|
bool optionCrosshairHUD = false;
|
|
|
|
float flShowCrossHairHUDRageLevel = 0;
|
|
float flShowCrossHairHUDRageCounter = 0;
|
|
float flShowCrossHairHUDRageCounterMax = 0;
|
|
bool bShowCrossHairHUDDefensiveRage = false;
|
|
bool bShowCrossHairHUDOffensiveRage = false;
|
|
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
optionCrosshairHUD = RebirthVariables.customCrosshairHUD;
|
|
|
|
flShowCrossHairHUDRageLevel = RebirthUtilities.GetPerkLevel(this.LocalPlayer, "furiousramsayattberserker");
|
|
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue flShowCrossHairHUDRageLevel: " + flShowCrossHairHUDRageLevel);
|
|
|
|
switch (flShowCrossHairHUDRageLevel)
|
|
{
|
|
case 1:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier1");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier1");
|
|
break;
|
|
case 2:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier2");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier2");
|
|
break;
|
|
case 3:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier3");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier3");
|
|
break;
|
|
case 4:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier4");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier4");
|
|
break;
|
|
case 5:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier5");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier5");
|
|
break;
|
|
case 6:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier6");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier6");
|
|
break;
|
|
case 7:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier7");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier7");
|
|
break;
|
|
case 8:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier8");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier8");
|
|
break;
|
|
case 9:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier9");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier9");
|
|
break;
|
|
case 10:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier10");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier10");
|
|
break;
|
|
case 11:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier11");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier11");
|
|
break;
|
|
case 12:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier12");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier12");
|
|
break;
|
|
case 13:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier13");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier13");
|
|
break;
|
|
case 14:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier14");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier14");
|
|
break;
|
|
case 15:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier15");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier15");
|
|
break;
|
|
default:
|
|
bShowCrossHairHUDDefensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRageBuffTier1");
|
|
bShowCrossHairHUDOffensiveRage = this.LocalPlayer.Buffs.HasBuff("FuriousRamsayOffensiveRageBuffTier1");
|
|
break;
|
|
}
|
|
|
|
/*//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue bShowCrossHairHUDDefensiveRage: " + bShowCrossHairHUDDefensiveRage);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue bShowCrossHairHUDOffensiveRage: " + bShowCrossHairHUDOffensiveRage);*/
|
|
|
|
if (bShowCrossHairHUDDefensiveRage)
|
|
{
|
|
flShowCrossHairHUDRageCounterMax = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayRageDisplayMax"); ;
|
|
flShowCrossHairHUDRageCounter = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayRageDisplay") / flShowCrossHairHUDRageCounterMax;
|
|
}
|
|
else if (bShowCrossHairHUDOffensiveRage)
|
|
{
|
|
flShowCrossHairHUDRageCounterMax = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayOffensiveRageMax");
|
|
flShowCrossHairHUDRageCounter = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayOffensiveRage") / flShowCrossHairHUDRageCounterMax;
|
|
}
|
|
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue $varFuriousRamsayRageDisplay: " + this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayRageDisplay"));
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue flShowCrossHairHUDRageCounterMax: " + flShowCrossHairHUDRageCounterMax);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue flShowCrossHairHUDRageCounter: " + flShowCrossHairHUDRageCounter);
|
|
}
|
|
|
|
/* //Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 0 flShowCrossHairHUDHealth: " + flShowCrossHairHUDHealth);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 0 flShowCrossHairHUDStamina: " + flShowCrossHairHUDStamina);
|
|
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 0 bindingName: " + bindingName);*/
|
|
|
|
switch (bindingName)
|
|
{
|
|
case "statEncumbranceVisible":
|
|
value = "false";
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
if (this.LocalPlayer.Buffs.HasBuff("buffEncumberedInv"))
|
|
{
|
|
value = "true";
|
|
}
|
|
}
|
|
return true;
|
|
case "statEncumbrancePos":
|
|
value = "-365";
|
|
if (RebirthVariables.musicMode == 1 && RebirthVariables.songIndex > -1)
|
|
{
|
|
value = "-343";
|
|
}
|
|
return true;
|
|
case "statRageFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "0";
|
|
return true;
|
|
}
|
|
|
|
if (this.lastValueRage <= 0)
|
|
{
|
|
value = "0";
|
|
lastValueRagePerc = 0;
|
|
if (flShowCrossHairHUDRageCounter > 0)
|
|
{
|
|
this.lastValueRage = Mathf.Lerp(this.lastValueRage, flShowCrossHairHUDRageCounter, this.deltaTime * 3f);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue A lastValueRage: " + lastValueRage);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueRage, 0.0f) * 1.01f);
|
|
lastValueRagePerc = (float)(Math.Truncate(this.lastValueRage * 100 * 100) / 100);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue value: " + value);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue B lastValueRagePerc: " + lastValueRagePerc);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue BEFORE this.lastValueRage: " + this.lastValueRage);
|
|
this.lastValueRage = Mathf.Lerp(this.lastValueRage, flShowCrossHairHUDRageCounter, this.deltaTime * 3f);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue AFTER this.lastValueRage: " + this.lastValueRage);
|
|
}
|
|
|
|
return true;
|
|
case "statRageVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
if (bShowCrossHairHUDDefensiveRage)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
case "statOffensiveRageVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
if (bShowCrossHairHUDOffensiveRage)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
case "statRagePerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
//Log.Out("lastValueRagePerc: " + lastValueRagePerc);
|
|
int percentRage = (int)lastValueRagePerc;// this.LocalPlayer.Stats.Rage.ValuePercentUI*100;
|
|
|
|
value = percentRage.ToString() + "%";
|
|
//Log.Out("lastValueRagePerc: " + lastValueRagePerc);
|
|
return true;
|
|
case "statStealthFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 4");
|
|
value = "0";
|
|
return true;
|
|
}
|
|
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueStealth, 0.0f) * 1.01f);
|
|
lastValueStealthPerc = this.lastValueStealth * 100;
|
|
this.lastValueStealth = Mathf.Lerp(this.lastValueStealth, this.LocalPlayer.Stealth.ValuePercentUI, this.deltaTime * 3f);
|
|
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statStealthFill: " + value);
|
|
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statStealthFill: " + value);
|
|
return true;
|
|
case "statStealthVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statStealthVisible: " + value);
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a flShowCrossHairHUDStealthThreshold: " + flShowCrossHairHUDStealthThreshold);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a this.LocalPlayer.Stats.Stealth.ValuePercentUI: " + this.LocalPlayer.Stats.Stealth.ValuePercentUI);
|
|
if (this.LocalPlayer.IsCrouching)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue IsCrouching");
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue Not Crouching");
|
|
value = "false";
|
|
}
|
|
}
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5b statStaminaVisible: " + value);
|
|
return true;
|
|
case "statStealthPerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
int percentStealth = (int)lastValueStealthPerc;// this.LocalPlayer.Stats.Stealth.ValuePercentUI*100;
|
|
value = percentStealth.ToString() + "%";
|
|
return true;
|
|
case "playerStaminaModifiedMax":
|
|
value = (this.LocalPlayer != null) ? (this.LocalPlayer.Stats.Stamina.ModifiedMax / this.LocalPlayer.Stats.Stamina.Max).ToString("0.##") : "0";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 1 playerStaminaModifiedMax: " + value);
|
|
return true;
|
|
case "statStamina":
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 2");
|
|
value = (this.LocalPlayer == null) ? "0" : this.statmodifiedmaxFormatter.Format(this.LocalPlayer.Stats.Stamina.ModifiedMax, this.LocalPlayer.Stats.Stamina.Max);
|
|
return true;
|
|
case "statStaminaFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 4");
|
|
value = "0";
|
|
return true;
|
|
}
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueStamina, 0.0f) * 1.01f);
|
|
lastValueStaminaPerc = this.lastValueStamina * 100;
|
|
this.lastValueStamina = Mathf.Lerp(this.lastValueStamina, this.LocalPlayer.Stats.Stamina.ValuePercentUI, this.deltaTime * 3f);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statStaminaFill: " + value);
|
|
return true;
|
|
case "statStaminaPerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
int percentStamina = (int)lastValueStaminaPerc;// this.LocalPlayer.Stats.Stamina.ValuePercentUI*100;
|
|
value = percentStamina.ToString() + "%";
|
|
return true;
|
|
case "statStaminaVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statStaminaVisible: " + value);
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a this.LocalPlayer.AimingGun: " + this.LocalPlayer.AimingGun);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a this.LocalPlayer.weaponCamera.enabled: " + this.LocalPlayer.weaponCamera.enabled);
|
|
return true;
|
|
}
|
|
}
|
|
if (!optionCrosshairHUD)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
/*//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a flShowCrossHairHUDStaminaThreshold: " + flShowCrossHairHUDStaminaThreshold);
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a this.LocalPlayer.Stats.Stamina.ValuePercentUI: " + this.LocalPlayer.Stats.Stamina.ValuePercentUI);*/
|
|
if (RebirthVariables.localConstants["$varFuriousRamsayCrossHairHUDStaminaThreshold_Cst"] >= lastValueStaminaPerc / 100) //this.LocalPlayer.Stats.Stamina.ValuePercentUI)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5b statStaminaVisible: " + value);
|
|
return true;
|
|
case "playerHealthModifiedMax":
|
|
value = (this.LocalPlayer != null) ? (this.LocalPlayer.Stats.Health.ModifiedMax / this.LocalPlayer.Stats.Health.Max).ToString("0.##") : "0";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 1 playerHealthModifiedMax: " + value);
|
|
return true;
|
|
case "statHealth":
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 2");
|
|
value = (this.LocalPlayer == null) ? "0" : this.statmodifiedmaxFormatter.Format(this.LocalPlayer.Stats.Health.ModifiedMax, this.LocalPlayer.Stats.Stamina.Max);
|
|
return true;
|
|
case "statHealthFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 4");
|
|
value = "0";
|
|
return true;
|
|
}
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueHealth, 0.0f) * 1.01f);
|
|
this.lastValueHealth = Mathf.Lerp(this.lastValueHealth, this.LocalPlayer.Stats.Health.ValuePercentUI, this.deltaTime * 3f);
|
|
lastValueHealthPerc = this.lastValueHealth * 100;
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statHealthFill: " + value);
|
|
return true;
|
|
case "statHealthPerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
int percentHealth = (int)lastValueHealthPerc;// this.LocalPlayer.Stats.Health.ValuePercentUI * 100;
|
|
value = percentHealth.ToString() + "%";
|
|
return true;
|
|
case "statHealthVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statHealthVisible: " + value);
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statWaterVisible: " + value);
|
|
return true;
|
|
}
|
|
}
|
|
if (!optionCrosshairHUD)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
if (RebirthVariables.localConstants["$varFuriousRamsayCrossHairHUDHealthThreshold_Cst"] >= lastValueHealthPerc / 100) //this.LocalPlayer.Stats.Health.ValuePercentUI)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5b statHealthVisible: " + value);
|
|
return true;
|
|
case "playerWaterModifiedMax":
|
|
value = (this.LocalPlayer != null) ? (this.LocalPlayer.Stats.Water.ModifiedMax / this.LocalPlayer.Stats.Water.Max).ToString("0.##") : "0";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 1 playerWaterModifiedMax: " + value);
|
|
return true;
|
|
case "statWater":
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 2");
|
|
value = (this.LocalPlayer == null) ? "0" : this.statmodifiedmaxFormatter.Format(this.LocalPlayer.Stats.Water.ModifiedMax, this.LocalPlayer.Stats.Water.Max);
|
|
return true;
|
|
case "statWaterFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 4");
|
|
value = "0";
|
|
return true;
|
|
}
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueWater, 0.0f) * 1.01f);
|
|
this.lastValueWater = Mathf.Lerp(this.lastValueWater, this.LocalPlayer.Stats.Water.ValuePercentUI, this.deltaTime * 3f);
|
|
lastValueWaterPerc = this.lastValueWater * 100;
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statWaterFill: " + value);
|
|
return true;
|
|
case "statWaterPerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
int percentWater = (int)lastValueWaterPerc;// this.LocalPlayer.Stats.Water.ValuePercentUI * 100;
|
|
value = percentWater.ToString() + "%";
|
|
return true;
|
|
case "statWaterVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statWaterVisible: " + value);
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statWaterVisible: " + value);
|
|
return true;
|
|
}
|
|
}
|
|
if (!optionCrosshairHUD)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
if (RebirthVariables.localConstants["$varFuriousRamsayCrossHairHUDWaterThreshold_Cst"] >= lastValueWaterPerc / 100) //this.LocalPlayer.Stats.Water.ValuePercentUI)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5b statWaterVisible: " + value);
|
|
return true;
|
|
case "playerFoodModifiedMax":
|
|
value = (this.LocalPlayer != null) ? (this.LocalPlayer.Stats.Food.ModifiedMax / this.LocalPlayer.Stats.Food.Max).ToString("0.##") : "0";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 1 playerFoodModifiedMax: " + value);
|
|
return true;
|
|
case "statFood":
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 2");
|
|
value = (this.LocalPlayer == null) ? "0" : this.statmodifiedmaxFormatter.Format(this.LocalPlayer.Stats.Food.ModifiedMax, this.LocalPlayer.Stats.Food.Max);
|
|
return true;
|
|
case "statFoodFill":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 4");
|
|
value = "0";
|
|
return true;
|
|
}
|
|
value = this.statfillFormatter.Format(Math.Max(this.lastValueFood, 0.0f) * 1.01f);
|
|
this.lastValueFood = Mathf.Lerp(this.lastValueFood, this.LocalPlayer.Stats.Food.ValuePercentUI, this.deltaTime * 3f);
|
|
lastValueFoodPerc = this.lastValueFood * 100;
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 3 statFoodFill: " + value);
|
|
return true;
|
|
case "statFoodPerc":
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
value = "";
|
|
return true;
|
|
}
|
|
int percentFood = (int)lastValueFoodPerc;// this.LocalPlayer.Stats.Food.ValuePercentUI * 100;
|
|
value = percentFood.ToString() + "%";
|
|
return true;
|
|
case "statFoodVisible":
|
|
if (this.xui.dragAndDrop.InMenu || bHide)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statFoodVisible: " + value);
|
|
return true;
|
|
}
|
|
if (this.LocalPlayer != null)
|
|
{
|
|
if (this.LocalPlayer.AimingGun)
|
|
{
|
|
value = "false";
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5a statWaterVisible: " + value);
|
|
return true;
|
|
}
|
|
}
|
|
if (!optionCrosshairHUD)
|
|
{
|
|
value = "false";
|
|
}
|
|
else
|
|
{
|
|
if (RebirthVariables.localConstants["$varFuriousRamsayCrossHairHUDFoodThreshold_Cst"] >= lastValueFoodPerc / 100) //this.LocalPlayer.Stats.Food.ValuePercentUI)
|
|
{
|
|
value = "true";
|
|
}
|
|
else
|
|
{
|
|
value = "false";
|
|
}
|
|
}
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 5b statFoodVisible: " + value);
|
|
return true;
|
|
default:
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-GetBindingValue 12");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public override void OnOpen()
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-OnOpen START");
|
|
base.OnOpen();
|
|
if (this.LocalPlayer == null && XUi.IsGameRunning())
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-OnOpen 1");
|
|
this.LocalPlayer = this.xui.playerUI.entityPlayer;
|
|
}
|
|
this.IsDirty = true;
|
|
this.RefreshBindings(true);
|
|
}
|
|
|
|
public override void Update(float _dt)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-Update START");
|
|
base.Update(_dt);
|
|
if (this.LocalPlayer == null)
|
|
{
|
|
//Log.Out("XUiC_CrosshairHUDRebirth-Update 1");
|
|
return;
|
|
}
|
|
this.deltaTime = _dt;
|
|
this.RefreshBindings(true);
|
|
}
|
|
|
|
protected float flUpdateTime;
|
|
}
|