mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Remote can now be closed with the right mouse button too
This commit is contained in:
11
nui/radar.js
11
nui/radar.js
@@ -320,8 +320,9 @@ elements.remote.find( "button" ).each( function( i, obj ) {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Close the remote when the user presses the 'Escape' key
|
// Close the remote when the user presses the 'Escape' key or the right mouse button
|
||||||
document.onkeyup = function ( event ) {
|
document.onkeyup = function( event )
|
||||||
|
{
|
||||||
if ( event.keyCode == 27 )
|
if ( event.keyCode == 27 )
|
||||||
{
|
{
|
||||||
sendData( "closeRemote", null );
|
sendData( "closeRemote", null );
|
||||||
@@ -329,6 +330,12 @@ document.onkeyup = function ( event ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.oncontextmenu = function()
|
||||||
|
{
|
||||||
|
sendData( "closeRemote", null );
|
||||||
|
toggleRemote();
|
||||||
|
}
|
||||||
|
|
||||||
// The main event listener, this is what the NUI messages sent by the LUA side arrive at, they are
|
// The main event listener, this is what the NUI messages sent by the LUA side arrive at, they are
|
||||||
// then handled properly via a switch/case that runs the relevant code
|
// then handled properly via a switch/case that runs the relevant code
|
||||||
window.addEventListener( "message", function( event ) {
|
window.addEventListener( "message", function( event ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user