Mirage Source http://miragesource.net/forums/ |
|
Right Click Menu http://miragesource.net/forums/viewtopic.php?f=210&t=5098 |
Page 1 of 1 |
Author: | addy [ Fri Feb 20, 2009 2:20 am ] |
Post subject: | Right Click Menu |
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 |
Author: | Acruno [ Fri Feb 20, 2009 10:28 am ] |
Post subject: | Re: Right Click Menu |
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. |
Author: | Mattyw [ Fri Feb 20, 2009 10:48 am ] |
Post subject: | Re: Right Click Menu |
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? |
Author: | addy [ Fri Feb 20, 2009 12:58 pm ] |
Post subject: | Re: Right Click Menu |
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. |
Author: | Robin [ Fri Feb 20, 2009 1:48 pm ] |
Post subject: | Re: Right Click Menu |
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. |
Author: | Mattyw [ Fri Feb 20, 2009 3:47 pm ] |
Post subject: | Re: Right Click Menu |
Shouldn't it use CurX & CurY? |
Author: | Matt [ Fri Feb 20, 2009 4:59 pm ] |
Post subject: | Re: Right Click Menu |
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. |
Author: | addy [ Fri Feb 20, 2009 9:06 pm ] |
Post subject: | Re: Right Click Menu |
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. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |