TY for a great plugin.
As this is kind of a "distinguished plugin" as KJ himself have endorsed this I would like to see that it complies to Visual Studio coding standards to ease "eye stress" from warnings.
Like "Remove Unnecessary Usings", "use var instead of explicit type" etc. as they are easy to see and even easier to fix automatically.
I'm still using VS 2017 Community as newer version is even more strict about code style.
About UptimeRule.IsRelevant.
I noticed in my own rift time logger that sometimes during rifts when level changes (inside a rift) Hud.Game.Me.ParagonTotalExp and CurrentLevelParagon are zero for few frames and then got their proper values back.
This may affect how buffs seem to behave inconsistently sometimes?
Tough I have not paid much attention to this while I track buff on/off state in my plugins but I feel that sometimes on-off-on notifications come too often even I read buff state in OnNewArea to get proper starting state for a level.
Just my 2 cents and it does not make a big difference if uptime is lost for few frames (just a very small fraction of second).
- Subscribing to be notified on updates -
Supported version for all Resu plugins
Minor inconvenience when trying to Customize RunStats_XPHelper in my own Customize() method.
This is because RunStatsPlugin.Add() removes plugin.Label.ExpandUpLabels by setting it to null :-(Code:Exception 0x80004003 Object reference not set to an instance of an object.
And my plugin Order is int.MaxValue so it is run last after all other customizations.
I suggest that Razorfish add explicit Order to all RunStats plugins so we can time our customizations correctly (before any side-effects happens).
I fixed that temporarily by setting Razor.RunStats_XPHelper.Order = int.MaxValue; // Must be last
And my own plugin.Order = int.MaxValue - 1; // Must be before last!
Now my customize code works.
This just changes to Bonus Pool text to following example: 11.3bn 9.3 % Bonus Pool that is easier to comprehend for me.Code:Hud.RunOnPlugin<Razor.RunStats_XPHelper>(plugin => { // Bonus Pools should be last decorator - change to show % remaining pool. var bonusPools = plugin.Label.ExpandUpLabels[plugin.Label.ExpandUpLabels.Count - 1]; bonusPools.TextFunc = () => Hud.Game.Me.ParagonExpToNextLevel > 0 ? string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} {1:0.0} %", ValueToString(Hud.Game.Me.BonusPoolRemaining, ValueFormat.ShortNumber), Hud.Game.Me.BonusPoolRemaining / (double)Hud.Game.Me.ParagonExpToNextLevel * 100d) : "empty"; bonusPools.HintFunc = () => "Bonus Pool"; });
Hi!
Very nice plugin.
One question. It seems I keep accidently pinning stuff i don't want to.
Can I somehow TURN OFF the pin function completely?
Thanks in advance !
Lines 204-219 handles PinnedLabel.
Just commenting lines 215-216 should disable "pin" 📌.
Can not test as I'm on PTR right now.Code:if (Hud.Window.CursorInsideRect(selectedX + w*0.85f, y, w*0.15f, h)) { if (OnMouseOver(HoverPinDelay, RepeatPinDelay)) //has the mouse been hovering over the pin for at least HoverPinDelay milliseconds? { if (PinnedLabel == selectedLabel) //unpin { PinnedLabel = null; PinnedX = 0; } else //pin { //--// PinnedLabel = selectedLabel; //--// PinnedX = selectedX; } } }
There are apparently null reference exceptions with freshly created heroes (under level 70).
2019.08.01 12:35:24.285 19.7.29.0 overlay paint error (System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Turbo.Plugins.Razor.RunStats_UptimeHelper.<Load>b__35_0()
à System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
à Turbo.Plugins.Razor.RunStats_UptimeHelper.<Load>b__35_27()
à Turbo.Plugins.Default.TopLabelDecorator.Paint(Single x, Single y, Single w, Single h, HorizontalAlign align)
à Turbo.Plugins.Razor.RunStatsPlugin.PaintTopInGame(ClipState clipState)
à ****************.************ **.**********()
à ****************.***** **(IPlugin , String , Action )
à ****************.*************** *(Object , EventArgs )
à ******.********* ***())
2019.08.01 12:35:24.288 19.7.29.0 OnCollectFinishedUnSafe exception (System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Turbo.Plugins.Razor.RunStats_UptimeHelper.<Load>b__35_0()
à Turbo.Plugins.Razor.RunStats_UptimeHelper.AfterCollect()
à ****************.*********** **.***********()
à ****************.***** **(IPlugin , String , Action )
à ****************.********* **(Object , EventArgs )
Last edited by User5981; 08-01-2019 at 08:20 AM.
Supported version for all Resu plugins
Hey guys! Sorry about the lack of communication from me lately. I have been recovering from a hospital stay and it took me a little while to get back to being able to sit at the computer desk for a while. As a result, I haven't really had much playtime this season, but I will try to fit in the updates promised soon (or as I am able).
Well, you got me there, I've never used Visual Studio so all my code is very raw from being written in Notepad++...
I was taught that implicit typing obfuscates code and may confuse people who try to examine/utilize/adapt your code. But if that is the new standard, I should look into it. I actually am a C# newbie (been learning it from reading plugin code), so please bear with me.
Hmm, interesting. When I was writing one of my first few plugins (the party proc tracking one), I noticed that the state of the proc debuff would "flicker" off and then back on immediately after, imperceptible to the human eye, but not to TH, causing the plugin to announce procs or deaths excessively often. Drove me nuts trying to figure out why my code wasn't behaving as expected.About UptimeRule.IsRelevant.
I noticed in my own rift time logger that sometimes during rifts when level changes (inside a rift) Hud.Game.Me.ParagonTotalExp and CurrentLevelParagon are zero for few frames and then got their proper values back.
This may affect how buffs seem to behave inconsistently sometimes?
Tough I have not paid much attention to this while I track buff on/off state in my plugins but I feel that sometimes on-off-on notifications come too often even I read buff state in OnNewArea to get proper starting state for a level.
Just my 2 cents and it does not make a big difference if uptime is lost for few frames (just a very small fraction of second).
Yeah, it's kinda hackish because I was overriding the default behavior of TopLabelDecorator, so I had to stop its default behavior with showing hover labels. But, you can save a pointer to your initialized ExpandUpLabels field in your Load or Customize (anywhere before you hook your plugin into RunStats) function and be able to access (and alter) the labels accordingly after that. An example of this can be seen in RunStats_UptimeHelper.cs (I create the the hover menu on the fly in the Customize function, save it to a variable prior to passing the menu's TopLabelDecorator to RunStatsPlugin.Add:This is because RunStatsPlugin.Add() removes plugin.Label.ExpandUpLabels by setting it to null :-(
I suggest that Razorfish add explicit Order to all RunStats plugins so we can time our customizations correctly (before any side-effects happens).
The class field I declared in my helper plugin, which I confusingly named ExpandUpLabels, now acts as your pointer to your plugin's hover menu, and you can modify its contents at any time.Code:public void Customize() { //create all the uptime hover labels based on what is being watched ExpandUpLabels = new List<TopLabelDecorator>(); foreach (UptimeRule rule in Watching) { TopLabelDecorator label = new TopLabelDecorator(Hud) { TextFont = (rule.Font == null ? TextFont : rule.Font), BackgroundBrush = (rule.BgBrush == null ? BgBrush : rule.BgBrush), ExpandedHintFont = TextFont, ExpandedHintWidthMultiplier = 1.75f, TextFunc = () => string.Format("{0}/{1}", ValueToString(rule.Uptime.ElapsedMilliseconds * TimeSpan.TicksPerMillisecond, ValueFormat.LongTime), ValueToString(rule.TotalTime.ElapsedMilliseconds * TimeSpan.TicksPerMillisecond, ValueFormat.LongTime) ), HintFunc = () => { var pct = rule.Percent() * 100; return string.Format("({0}%) {1}", pct.ToString(pct == 0 ? "F0" :"F1"), rule.Description); }, }; rule.Label = label; ExpandUpLabels.Add(label); } //create the main menu label based on what is being watched Label = new TopLabelDecorator(Hud) { TextFont = TextFont, //BackgroundBrush = BgBrush, TextFunc = () => { var firstActiveRule = Watching.FirstOrDefault(r => r.IsRelevant()); if (firstActiveRule != null) { var pct = firstActiveRule.Percent() * 100; return string.Format("{0}% {1}", pct.ToString(pct == 0 ? "F0" :"F1"), TextUptime); } return string.Empty; }, //ValueToString(Hud.Game.Me.Defense.EhpCur, ValueFormat.ShortNumber), HintFunc = () => "Uptime", ExpandUpLabels = this.ExpandUpLabels, }; //add this display to the RunStats readout with a(n optional) specified positional order priority of 2 Hud.RunOnPlugin<RunStatsPlugin>(plugin => { plugin.Add(this.Label); }); }
Last edited by Razorfish; 08-01-2019 at 10:00 PM. Reason: typos
Yeah, I was being a dumbo and forgot to check whether or not a player character has anything equipped in a certain Kanai's cube slot in UptimeHelper. You can fix this by changing in RunStats_UptimeHelper.cs all the calls of Hud.Game.Me.CubeSnoItem2.Sno to Hud.Game.Me.CubeSnoItem2?.Sno (i.e. adding a question mark after CubeSnoItem2 will make the code check if it is null before attempting to execute the rest of the comparison)
Here you go! A simple Deaths Breath tracker based off of the code from the Keystone tracker. Place the *.cs file in the same folder that all the other RunStats plugin files are:Originally Posted by iphappp
TurboHUD \ plugins \ Razor \ RunStats \ RunStats_DeathsBreathHelper.cs
RunStats_DeathsBreathHelper.zip
I was also working on a few other ideas like graphing latency readings (so that you can visualize your lag spikes better) and health changes of tracked players in the vicinity. Also on my todo list is the old request to be able to customize the docking position of the run stats menu bar.
Ah that's very interesting, we will maybe need a width limit to the bar to avoid it overlapping other TurboHud elements ,
I will try to work on a version of my DeluxeInventoryFreeSpacePlugin & the default BloodShardPlugin for this plugin when I have time so we can maybe have all the space from the right corner to the potion slot.
Supported version for all Resu plugins
Here is a BloodShard one :
- it auto disables the default blood shard plugin
- if there's less than 100 blood shards to be full it displays "! blood shards / total blood shards" instead of the bloodshards per hour in the bar
***** LINK TO THE LATEST VERSION IN MY SIGNATURE *****
install in :
TurboHUD \ plugins \ Razor \ RunStats \ RunStats_BloodShardHelper.cs
I will work on a version of my deluxe inventory freespace plugin next
Last edited by User5981; 08-09-2019 at 09:58 PM.
Supported version for all Resu plugins
Here is an Inventory free space one :
- it auto disables the default inventoryfreespaceplugin
- freespace for 1 slot and 2 slot items
***** LINK TO THE LATEST VERSION IN MY SIGNATURE *****
install in :
TurboHUD \ plugins \ Razor \ RunStats \RunStats_InventoryFreeSpaceHelper.cs
Last edited by User5981; 08-09-2019 at 09:58 PM.
Supported version for all Resu plugins
verry much thx for your amazing plugins guys ! i love u all