For i As Integer = 0 To 8
If Inventory.currentInventory(i) = Inventory.SLOTOCCUPIEDKEY1 Then
Select Case i
Case 0
guiInvSlot1.Image = My.Resources.Key_1_Inventory
guiInvSlot1.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 1
guiInvSlot2.Image = My.Resources.Key_1_Inventory
guiInvSlot2.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 2
guiInvSlot3.Image = My.Resources.Key_1_Inventory
guiInvSlot3.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 3
guiInvSlot4.Image = My.Resources.Key_1_Inventory
guiInvSlot4.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 4
guiInvSlot5.Image = My.Resources.Key_1_Inventory
guiInvSlot5.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 5
guiInvSlot6.Image = My.Resources.Key_1_Inventory
guiInvSlot6.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 6
guiInvSlot7.Image = My.Resources.Key_1_Inventory
guiInvSlot7.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 7
guiInvSlot8.Image = My.Resources.Key_1_Inventory
guiInvSlot8.Tag = Inventory.SLOTOCCUPIEDKEY1
Case 8
guiInvSlot9.Image = My.Resources.Key_1_Inventory
guiInvSlot9.Tag = Inventory.SLOTOCCUPIEDKEY1
End Select
ElseIf Inventory.currentInventory(i) = Inventory.SLOTOCCUPIEDKEY2 Then
Select Case i
Case 0
guiInvSlot1.Image = My.Resources.Key_2_Inventory
guiInvSlot1.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 1
guiInvSlot2.Image = My.Resources.Key_2_Inventory
guiInvSlot2.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 2
guiInvSlot3.Image = My.Resources.Key_2_Inventory
guiInvSlot3.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 3
guiInvSlot4.Image = My.Resources.Key_2_Inventory
guiInvSlot4.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 4
guiInvSlot5.Image = My.Resources.Key_2_Inventory
guiInvSlot5.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 5
guiInvSlot6.Image = My.Resources.Key_2_Inventory
guiInvSlot6.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 6
guiInvSlot7.Image = My.Resources.Key_2_Inventory
guiInvSlot7.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 7
guiInvSlot8.Image = My.Resources.Key_2_Inventory
guiInvSlot8.Tag = Inventory.SLOTOCCUPIEDKEY2
Case 8
guiInvSlot9.Image = My.Resources.Key_2_Inventory
guiInvSlot9.Tag = Inventory.SLOTOCCUPIEDKEY2
End Select
ElseIf Inventory.currentInventory(i) = Inventory.SLOTOCCUPIEDSTOOL Then
Select Case i
Case 0
guiInvSlot1.Image = My.Resources.stool
guiInvSlot1.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 1
guiInvSlot2.Image = My.Resources.stool
guiInvSlot2.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 2
guiInvSlot3.Image = My.Resources.stool
guiInvSlot3.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 3
guiInvSlot4.Image = My.Resources.stool
guiInvSlot4.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 4
guiInvSlot5.Image = My.Resources.stool
guiInvSlot5.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 5
guiInvSlot6.Image = My.Resources.stool
guiInvSlot6.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 6
guiInvSlot7.Image = My.Resources.stool
guiInvSlot7.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 7
guiInvSlot8.Image = My.Resources.stool
guiInvSlot8.Tag = Inventory.SLOTOCCUPIEDSTOOL
Case 8
guiInvSlot9.Image = My.Resources.stool
guiInvSlot9.Tag = Inventory.SLOTOCCUPIEDSTOOL
End Select
End If
Next
I've tried making a sub in the class "Inventory" but I don't think you could have the form that currently accesses the class in the parameter. Ex.
Public Sub reloadInventory(ByVal theFormCurrentlyAccessingThisSub As Form)
......
End Sub
I'm sorry if this is a bit unclear. It's kind of hard to explain.
Oops I didn't know how to use the code format sorry
Here's easier read of the first block of code.
Mentor Edit: Re-positioned the formatted code to back to the start.
This post has been edited by AdamSpeight2008: 03 October 2012 - 06:06 PM

New Topic/Question
Reply



MultiQuote






|