Skip to content

Commit cf9d23c

Browse files
committed
v0.2.1, apply hotbar scroll fix, better sounds
1 parent 49959a0 commit cf9d23c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

BossChecklistUI.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public override void OnInitialize()
9494
checklistList.Width.Set(-25f, 1f);
9595
checklistList.Height.Set(-32f, 1f);
9696
checklistList.ListPadding = 12f;
97+
checklistList.OnScrollWheel += OnScrollWheel_FixHotbarScroll;
9798
checklistPanel.Append(checklistList);
9899

99100
FixedUIScrollbar checklistListScrollbar = new FixedUIScrollbar();
@@ -114,28 +115,27 @@ public override void OnInitialize()
114115

115116
private void ToggleCompletedButtonClicked(UIMouseEvent evt, UIElement listeningElement)
116117
{
117-
Main.PlaySound(SoundID.MenuOpen);
118118
showCompleted = !showCompleted;
119+
Main.PlaySound(showCompleted ? SoundID.MenuOpen : SoundID.MenuClose);
119120
UpdateCheckboxes();
120121
}
121122

122123
private void ToggleMiniBossButtonClicked(UIMouseEvent evt, UIElement listeningElement)
123124
{
124-
Main.PlaySound(SoundID.MenuOpen);
125125
showMiniBoss = !showMiniBoss;
126+
Main.PlaySound(showMiniBoss ? SoundID.MenuOpen : SoundID.MenuClose);
126127
UpdateCheckboxes();
127128
}
128129

129130
private void ToggleEventButtonClicked(UIMouseEvent evt, UIElement listeningElement)
130131
{
131-
Main.PlaySound(SoundID.MenuOpen);
132132
showEvent = !showEvent;
133+
Main.PlaySound(showEvent ? SoundID.MenuOpen : SoundID.MenuClose);
133134
UpdateCheckboxes();
134135
}
135136

136137
private void ToggleHiddenButtonClicked(UIMouseEvent evt, UIElement listeningElement)
137138
{
138-
Main.PlaySound(SoundID.MenuOpen);
139139
if (Main.keyState.IsKeyDown(Keys.LeftAlt) || Main.keyState.IsKeyDown(Keys.RightAlt))
140140
{
141141
BossChecklistWorld.HiddenBosses.Clear();
@@ -148,9 +148,11 @@ private void ToggleHiddenButtonClicked(UIMouseEvent evt, UIElement listeningElem
148148
packet.Write((byte)BossChecklistMessageType.RequestClearHidden);
149149
packet.Send();
150150
}
151+
Main.PlaySound(showHidden ? SoundID.MenuOpen : SoundID.MenuClose);
151152
return;
152153
}
153154
showHidden = !showHidden;
155+
Main.PlaySound(showHidden ? SoundID.MenuOpen : SoundID.MenuClose);
154156
UpdateCheckboxes();
155157
}
156158

@@ -221,6 +223,11 @@ public override void Draw(SpriteBatch spriteBatch)
221223
}
222224
}
223225

226+
internal static void OnScrollWheel_FixHotbarScroll(UIScrollWheelEvent evt, UIElement listeningElement)
227+
{
228+
Main.LocalPlayer.ScrollHotbar(Terraria.GameInput.PlayerInput.ScrollWheelDelta / 120);
229+
}
230+
224231
private Texture2D ResizeImage(Texture2D texture2D, int desiredWidth, int desiredHeight)
225232
{
226233
RenderTarget2D renderTarget = new RenderTarget2D(Main.graphics.GraphicsDevice, desiredWidth, desiredHeight);

build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
author = jopojelly
2-
version = 0.2
2+
version = 0.2.1
33
displayName = Boss Checklist
44
homepage = http://forums.terraria.org/index.php?threads/boss-checklist-in-game-progression-checklist.50668/
55
hideCode = false

0 commit comments

Comments
 (0)