Right Click Menu

  • Lunar Engine v0.2.6 is out now! Download and check it out here. The map editor is also now fixed!

addy

Member
Member
Sep 20, 2008
31
0
0
Gold
0
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
 

Acruno

Member
Member
Nov 22, 2007
143
0
0
Gold
0
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.
 

addy

Member
Member
Sep 20, 2008
31
0
0
Gold
0
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.
 

Robin

Veteran
Veteran
Member
Jun 16, 2006
2,555
0
0
Gold
0
addy said:
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.
 
M

Matt

Guest
Guest
<div class="bbWrapper"><blockquote class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote"> <div class="bbCodeBlock-title"> Mattyw said: </div> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent"> Shouldn't it use CurX &amp; CurY? </div> <div class="bbCodeBlock-expandLink"><a>Click to expand...</a></div> </div> </blockquote>For displaying, yes. But the other is for getting the x/y of the player you right clicked.<br /> <br /> It's a very good idea, but it needs to be tweaked a bit still.</div>
 

addy

Member
Member
Sep 20, 2008
31
0
0
Gold
0
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.