Upload from upload_mods.ps1
This commit is contained in:
98
Scripts/XUIC/XUiC_ShowRampageRebirth.cs
Normal file
98
Scripts/XUIC/XUiC_ShowRampageRebirth.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
internal class XUiC_ShowRampageRebirth : XUiController
|
||||
{
|
||||
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_ShowRampageRebirth-GetBindingValue START");
|
||||
float flRampageCountdown = 0;
|
||||
float flRampageCountdownMax = 0;
|
||||
float flRampageTotalCounter = 0;
|
||||
float flRampageHUD = 0;
|
||||
|
||||
if (this.LocalPlayer != null)
|
||||
{
|
||||
flRampageCountdown = this.LocalPlayer.Buffs.GetCustomVar(".FuriousRamsayRampageCounter");
|
||||
flRampageCountdownMax = this.LocalPlayer.Buffs.GetCustomVar(".FuriousRamsayRampageCounterMax");
|
||||
flRampageTotalCounter = this.LocalPlayer.Buffs.GetCustomVar(".FuriousRamsayRampageKillCounter");
|
||||
flRampageHUD = this.LocalPlayer.Buffs.GetCustomVar("$varFuriousRamsayRampageHUD");
|
||||
}
|
||||
|
||||
switch (bindingName)
|
||||
{
|
||||
case "rampageCount":
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue RampageCount: " + value);
|
||||
value = flRampageTotalCounter.ToString();
|
||||
return true;
|
||||
case "statRampageFill":
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue statRampageFill: " + value);
|
||||
if (this.LocalPlayer == null)
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue 2");
|
||||
value = "0";
|
||||
return true;
|
||||
}
|
||||
value = (flRampageCountdown / flRampageCountdownMax).ToString();
|
||||
return true;
|
||||
case "statRampageVisible":
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue statRampageVisible: " + value);
|
||||
if (this.xui.dragAndDrop.InMenu || flRampageHUD == 0)
|
||||
{
|
||||
value = "false";
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue 4 statRampageVisible: " + value);
|
||||
return true;
|
||||
}
|
||||
if (flRampageCountdown <= 0 || flRampageTotalCounter <= 0)
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue 5 statRampageVisible: " + value);
|
||||
value = "false";
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-GetBindingValue 6 statRampageVisible: " + value);
|
||||
value = "true";
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnOpen()
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-OnOpen START");
|
||||
base.OnOpen();
|
||||
if (this.LocalPlayer == null && XUi.IsGameRunning())
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-OnOpen 1");
|
||||
this.LocalPlayer = this.xui.playerUI.entityPlayer;
|
||||
}
|
||||
this.IsDirty = true;
|
||||
this.RefreshBindings(true);
|
||||
}
|
||||
|
||||
private float currentTime;
|
||||
public override void Update(float _dt)
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-Update START");
|
||||
this.currentTime -= _dt;
|
||||
base.Update(_dt);
|
||||
if (this.LocalPlayer == null)
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-Update 1");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.LocalPlayer.Buffs.HasBuff("FuriousRamsayRampage"))
|
||||
{
|
||||
//Log.Out("XUiC_ShowRampageRebirth-Update 2");
|
||||
this.RefreshBindings(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user