Skip to content

Commit

Permalink
Updated fountain panel scrolls to work 'properly' via hacky solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalbintion committed Oct 11, 2019
1 parent a9393a9 commit a96516e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions HoHTools/Core/frmFountain.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions HoHTools/Core/frmFountain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@
Private Sub LabelHover(sender As Object, e As System.EventArgs)
Dim lb As Label = CType(sender, Label)
lb.Image = My.Resources.Fountain_Btn_Hover

' Panel Fix, See Region "Panel Scroll Fix"
If lb.Name.Contains("Debuff") Then
activePanel = pnlNegative
ElseIf lb.Name.Contains("Buff") Then
activePanel = pnlPositive
Else
activePanel = Nothing
End If
End Sub

Private Sub LabelClick(sender As Object, e As System.EventArgs)
Expand All @@ -134,6 +143,10 @@
ElseIf lb.Tag = "1" Then
lb.Image = My.Resources.Fountain_Btn_Selected
End If

' Panel Fix, See Region "Panel Scroll Fix"
If activePanel IsNot Nothing And lastActive IsNot Nothing Then lastActive.Focus()
activePanel = Nothing
End Sub

Private Sub UpdateFortune()
Expand Down Expand Up @@ -319,4 +332,18 @@
Return True
End Function

#Region "PanelScrollFix"

Private activePanel As Panel = Nothing
Private lastActive As Object = Nothing

Private Sub frmFountain_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
If lastActive Is Nothing Then lastActive = Me.ActiveControl

If activePanel IsNot Nothing Then
activePanel.Focus()
End If
End Sub
#End Region

End Class

0 comments on commit a96516e

Please sign in to comment.