Skip to content

Commit df1993d

Browse files
authored
Merge pull request #4 from SoulstoneMeter/dev
Fixed more issues
2 parents 7580166 + 9ea7c56 commit df1993d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

SoulstoneSurvivorsSkada/History/PlayerSkadaHistory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ internal static class PlayerSkadaHistory
3131
public static Il2CppReferenceArray<GameStatsSkillData> DamageBySpells =>
3232
GameManagerUtil.GameStats.TotalDamageDonePerSkillIdNew;
3333

34+
public static int DamageBySpellsCount => GameManagerUtil.GameStats.TotalDamageDonePerSkillIdNewCount;
35+
3436
/// <summary>
3537
/// Ordered array of spells by damage
3638
/// </summary>

SoulstoneSurvivorsSkada/Utilities/ScrollUtility.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using UnityEngine;
1+
using BepInEx.Logging;
2+
using SoulstoneSurvivorsSkada.Logging;
3+
using UnityEngine;
24

35
namespace SoulstoneSurvivorsSkada;
46

@@ -22,7 +24,7 @@ public static bool Scroll(in float scrollableHeight, in float itemHeight, ref in
2224
}
2325

2426
// calculate how many items are visible
25-
float availableItems = Mathf.Round(scrollableHeight / itemHeight / 2.0f);
27+
int availableItems = Mathf.RoundToInt(scrollableHeight / itemHeight / 2.0f);
2628

2729
// get scroll delta
2830
delta = Event.current.delta.y;
@@ -31,7 +33,8 @@ public static bool Scroll(in float scrollableHeight, in float itemHeight, ref in
3133
switch (delta)
3234
{
3335
// scroll down when delta is positive and there are more items to scroll
34-
case > 0 when PlayerSkadaHistory.DamageBySpells.Count > scrollPosition + availableItems:
36+
case > 0 when PlayerSkadaHistory.DamageBySpellsCount > scrollPosition + availableItems:
37+
LogManager.Log(LogLevel.Info, $"Scrolling down. ScrollPosition: {scrollPosition}, AvailableItems: {availableItems}");
3538
// scroll down
3639
scrollPosition += 1;
3740
return true; // return true to indicate that the scroll position has changed

SoulstoneSurvivorsSkada/Views/PlayerDamageMeterSkadaView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace SoulstoneSurvivorsSkada.Views;
1010
public sealed class PlayerDamageMeterSkadaView : ISkadaView
1111
{
1212
public int ScrollPosition { get; set; }
13-
public string Title { get; set; } = "Skada - Player Direct Damage";
13+
public string Title { get; set; } = "Skada - Player Damage";
1414

1515
/// <summary>
1616
/// Style for the Bar

0 commit comments

Comments
 (0)