Private Sub imgButton_Click(Index As Integer)
Dim Buffer As clsBuffer
Dim i As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
Select Case Index
Case 1
If Not picInventory.Visible Then
' show the window
picInventory.Visible = True
picCharacter.Visible = False
picSpells.Visible = False
picOptions.Visible = False
picParty.Visible = False
Picture5.Visible = True
BltInventory
' play sound
PlaySound Sound_ButtonClick
Else
Picture5.Visible = False
End If
Case 2
If Not picSpells.Visible Then
' send packet
Set Buffer = New clsBuffer
Buffer.WriteLong CSpells
SendData Buffer.ToArray()
Set Buffer = Nothing
' show the window
picSpells.Visible = True
picInventory.Visible = False
picCharacter.Visible = False
picOptions.Visible = False
picParty.Visible = False
Picture5.Visible = True
' play sound
PlaySound Sound_ButtonClick
Else
Picture5.Visible = False
End If
Case 3
If Not picCharacter.Visible Then
' send packet
SendRequestPlayerData
' show the window
picCharacter.Visible = True
picInventory.Visible = False
picSpells.Visible = False
picOptions.Visible = False
picParty.Visible = False
Picture5.Visible = True
' play sound
PlaySound Sound_ButtonClick
' Render
BltEquipment
BltFace
Else
Picture5.Visible = False
End If
Case 4
If Not picOptions.Visible Then
' show the window
picCharacter.Visible = False
picInventory.Visible = False
picSpells.Visible = False
picOptions.Visible = True
picParty.Visible = False
Picture5.Visible = True
' play sound
PlaySound Sound_ButtonClick
Else
Picture5.Visible = False
End If
Case 5
SendTradeRequest
Case 6
' logoutGame
If Not picParty.Visible Then
' show the window
picCharacter.Visible = False
picInventory.Visible = False
picSpells.Visible = False
picOptions.Visible = False
picParty.Visible = True
Picture5.Visible = True
' play sound
PlaySound Sound_ButtonClick
Else
Picture5.Visible = False
End If
End Select
' Error handler
Exit Sub
errorhandler:
HandleError "imgButton_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub