Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
idea for future builds : toggle menus
#1
When you click a menu icon (ex: inventory), it opens.
When you click it again, it closes. Basically, the have icons toggle menus on/off.

Or is this programmable on our side? =D

EDIT: Great work so far gentlemen.
Reply
#2
VersionX Wrote:Or is this programmable on our side? =D

Um..how many sides are there?
Reply
#3
VersionX Wrote:When you click a menu icon (ex: inventory), it opens.
When you click it again, it closes. Basically, the have icons toggle menus on/off.

This is very easy to do.
Other engines have this O.o
Reply
#4
Code:
Private Sub picInventory_click()
If picInv.Visible = True Then
picInv.Visible = False
Else
picInv.Visible = True
End If
End Sub
Reply
#5
Anthony Wrote:
Code:
Private Sub picInventory_click()
If picInv.Visible = True Then
picInv.Visible = False
Else
picInv.Visible = True
End If
End Sub

See?
Reply
#6
Anthony Wrote:
Code:
Private Sub picInventory_click()
If picInv.Visible = True Then
picInv.Visible = False
Else
picInv.Visible = True
End If
End Sub

Or

Code:
Private Sub picInventory_click()
picInv.Visible = not picinv.visible
End Sub
Reply
#7
Dugor wins one gold star.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
I love Gold Stars.
Reply
#9
I love you.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#10
I'm terrified.
Reply
#11
Dugor Wrote:
Code:
Private Sub picInventory_click()
picInv.Visible = not picinv.visible
End Sub

Is there a better/less-verbose way to toggle the spells, it looks different:
Code:
Dim spellsVisible as Boolean

Private Sub Form_Load()
    frmMirage.Width=10080
    spellsVisible = false
End Sub

Private Sub picSpells_Click()
    If Not spellsVisible Then
        Call SendData("spells" & END_CHAR)
    Else
        Call lblSpellsCancel_Click
    End If
    spellsVisible = Not spellsVisible
End Sub
Reply
#12
You shouldn't need to create a boolean. All you need is picSpells.Visible = not picSpells.Visible.

Dugors code is just using the opposite of it's value which is already there. You shouldn't have to make anything else.
Reply
#13
No, he's just saying you don't need to code exery little thing. Pictureboxes have a .Visible property which is already like a Boolean variable.

Code:
Private Sub picSpells_Click()
    picPlayerSpells.Visible = not picPlayerSpells.Visible
    If picPlayerSpells.Visible = True Then
        CallSendData("spells" & END_CHAR)
    End If
End Sub
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)