Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Right Click Menu
#1
Ive had a code for a right click menu for awhile now. its pretty easy to make and all just i wanted to give to you since idt ill be programming for awhile now. So here it is lol

In frmMirage make a picturebox called "picRightClick". Set its visible to false.

In ModGlobals add this line anywhere:
Code:
Public RclickIndex as Long
.

In frmMirage's code replace the code "picScreen_MouseDown" with this:
Code:
Dim i As Long

    If Button = 2 Then
        For i = 1 To MAX_PLAYERS
            If GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
                If GetPlayerX(i) * 32 = x Or x + 32 Then
                    If GetPlayerY(i) * 32 = y Or y + 32 Then
                        frmMirage.picRightClick.Visible = True
                    End If
                End If
            End If
        Next i
    End If
    
    If Button = 1 Then
        Call EditorMouseDown(Button, Shift, x, y)
        Call PlayerSearch(Button, Shift, x, y)
    End If

There it is. I hope it works for all of you
Reply
#2
Correct me if I'm wrong, but wouldn't that just show a menu in the same place everytime, i.e. it wouldn't appear where the mouse is.
Reply
#3
I believe so. I don't even get the code, it doesn't make sense.

Code:
Public RclickIndex as Long

That isn't needed, amirite?
Reply
#4
Acutally no.
Ive tried this before.
It gets the x and y of the cursor and then looks threw every player's x and y and sees if the cursor is there. Thats only if its button 2.
Then the rclickindex is needed because if you wanted to add a Invite party thing to menu you just gotta put
SendPartyRequest(RclickiNdex). It sets the index of the menu.
Reply
#5
addy Wrote:Acutally no.
Ive tried this before.
It gets the x and y of the cursor and then looks threw every player's x and y and sees if the cursor is there. Thats only if its button 2.
Then the rclickindex is needed because if you wanted to add a Invite party thing to menu you just gotta put
SendPartyRequest(RclickiNdex). It sets the index of the menu.

The menu still opens up at the same place.
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
#6
Shouldn't it use CurX & CurY?
Reply
#7
Mattyw Wrote:Shouldn't it use CurX & CurY?

For displaying, yes. But the other is for getting the x/y of the player you right clicked.

It's a very good idea, but it needs to be tweaked a bit still.
Reply
#8
Dam. I only thought CurX and CurY was for Eclipse.
I saw that Eclipse tweaked it and i made it a great script on eclipse.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)