mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Removed keyboard set code
This commit is contained in:
32
cl_radar.lua
32
cl_radar.lua
@@ -244,11 +244,7 @@ RADAR.vars =
|
|||||||
threadWaitTime = 500,
|
threadWaitTime = 500,
|
||||||
|
|
||||||
-- Key lock, when true, prevents any of the radar's key events from working, like the ELS key lock
|
-- Key lock, when true, prevents any of the radar's key events from working, like the ELS key lock
|
||||||
keyLock = false,
|
keyLock = false
|
||||||
|
|
||||||
-- Full keyboard, when true, the keybinds for the radar will be set to the keys on the numpad, when false, the
|
|
||||||
-- keybinds for the radar will be set to the number keys above WASD
|
|
||||||
fullKeyboard = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Speed conversion values
|
-- Speed conversion values
|
||||||
@@ -496,32 +492,6 @@ function RADAR:GetKeyLockState()
|
|||||||
return self.vars.keyLock
|
return self.vars.keyLock
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Toggles between the full and small keybinds
|
|
||||||
function RADAR:ToggleFullKeyboard()
|
|
||||||
-- Check the player state is valid
|
|
||||||
if ( PLY:VehicleStateValid() ) then
|
|
||||||
-- Toggle the full keyboard state
|
|
||||||
self.vars.fullKeyboard = not self.vars.fullKeyboard
|
|
||||||
|
|
||||||
-- Tell the NUI side to display the keybind message
|
|
||||||
SendNUIMessage( { _type = "displayKeybindChange", state = self:GetFullKeyboardState() } )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns the full keyboard state
|
|
||||||
function RADAR:GetFullKeyboardState()
|
|
||||||
return self.vars.fullKeyboard
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Returns which keybind set to use
|
|
||||||
function RADAR:GetKeybindType()
|
|
||||||
if ( self:GetFullKeyboardState() ) then
|
|
||||||
return "full"
|
|
||||||
else
|
|
||||||
return "small"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--[[----------------------------------------------------------------------------------
|
--[[----------------------------------------------------------------------------------
|
||||||
Radar menu functions
|
Radar menu functions
|
||||||
|
|||||||
@@ -997,11 +997,11 @@ button:focus { outline: none; }
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#keyLockLabel, #keyBindsLabel {
|
#keyLockLabel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 350px;
|
bottom: 300px;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
@@ -1011,11 +1011,7 @@ button:focus { outline: none; }
|
|||||||
|
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
#keyBindsLabel {
|
#keyLockLabel span {
|
||||||
bottom: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#keyLockLabel span, #keyBindsLabel span {
|
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="keyLockLabel">Radar key lock <span id="keyLockStateLabel"></span></p>
|
<p id="keyLockLabel">Radar key lock <span id="keyLockStateLabel"></span></p>
|
||||||
<p id="keyBindsLabel">Radar keybinds set for a <span id="keyBindsStateLabel"></span></p>
|
|
||||||
|
|
||||||
<div id="helpWindow">
|
<div id="helpWindow">
|
||||||
<iframe id="helpWeb" src="about:blank"></iframe>
|
<iframe id="helpWeb" src="about:blank"></iframe>
|
||||||
|
|||||||
23
nui/radar.js
23
nui/radar.js
@@ -150,11 +150,6 @@ const elements =
|
|||||||
stateLabel: $( "#keyLockStateLabel" )
|
stateLabel: $( "#keyLockStateLabel" )
|
||||||
},
|
},
|
||||||
|
|
||||||
keyBinds: {
|
|
||||||
label: $( "#keyBindsLabel" ),
|
|
||||||
stateLabel: $( "#keyBindsStateLabel" )
|
|
||||||
},
|
|
||||||
|
|
||||||
patrolSpeed: $( "#patrolSpeed" ),
|
patrolSpeed: $( "#patrolSpeed" ),
|
||||||
|
|
||||||
antennas: {
|
antennas: {
|
||||||
@@ -233,7 +228,6 @@ elements.plateReader.hide();
|
|||||||
elements.plateReaderBox.hide();
|
elements.plateReaderBox.hide();
|
||||||
elements.uiSettingsBox.hide();
|
elements.uiSettingsBox.hide();
|
||||||
elements.keyLock.label.hide();
|
elements.keyLock.label.hide();
|
||||||
elements.keyBinds.label.hide();
|
|
||||||
elements.helpWindow.hide();
|
elements.helpWindow.hide();
|
||||||
elements.qsvWindow.hide();
|
elements.qsvWindow.hide();
|
||||||
elements.newUser.hide();
|
elements.newUser.hide();
|
||||||
@@ -626,20 +620,6 @@ function displayKeyLock( state )
|
|||||||
}, 2000 );
|
}, 2000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayKeybindState( state )
|
|
||||||
{
|
|
||||||
// Set the state label text to enabled or disabled
|
|
||||||
elements.keyBinds.stateLabel.html( state ? "full keyboard" : "small keyboard" );
|
|
||||||
|
|
||||||
// Fade in the label
|
|
||||||
elements.keyBinds.label.fadeIn();
|
|
||||||
|
|
||||||
// Make the label fade out after 2 seconds
|
|
||||||
setTimeout( function() {
|
|
||||||
elements.keyBinds.label.fadeOut();
|
|
||||||
}, 2000 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function is used to send data back through to the LUA side
|
// This function is used to send data back through to the LUA side
|
||||||
function sendData( name, data ) {
|
function sendData( name, data ) {
|
||||||
$.post( "http://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) {
|
$.post( "http://" + resourceName + "/" + name, JSON.stringify( data ), function( datab ) {
|
||||||
@@ -1102,9 +1082,6 @@ window.addEventListener( "message", function( event ) {
|
|||||||
case "displayKeyLock":
|
case "displayKeyLock":
|
||||||
displayKeyLock( item.state );
|
displayKeyLock( item.state );
|
||||||
break;
|
break;
|
||||||
case "displayKeybindChange":
|
|
||||||
displayKeybindState( item.state );
|
|
||||||
return;
|
|
||||||
case "showNewUser":
|
case "showNewUser":
|
||||||
setEleVisible( elements.newUser, true );
|
setEleVisible( elements.newUser, true );
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user