mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Updated key lock message
The key lock message now reads "Radar key binds enabled" and "Radar key binds blocked". Green and red are also used to signify the state of the key binds, this hopefully makes it a bit more clear what it does, as well as the state of the key lock.
This commit is contained in:
@@ -159,6 +159,14 @@ button:focus { outline: none; }
|
||||
color: rgb(255, 255, 0);
|
||||
}
|
||||
|
||||
.green {
|
||||
color: rgb( 0, 255, 0 );
|
||||
}
|
||||
|
||||
.red {
|
||||
color: rgb( 255, 0, 0 );
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 11px;
|
||||
height: 15.4px;
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
<button id="closeUiSettings" class="close">CLOSE</button>
|
||||
</div>
|
||||
|
||||
<p id="keyLockLabel">Radar key lock <span id="keyLockStateLabel"></span></p>
|
||||
<p id="keyLockLabel">Radar key binds <span id="keyLockStateLabel"></span></p>
|
||||
|
||||
<div id="helpWindow">
|
||||
<iframe id="helpWeb" src="about:blank"></iframe>
|
||||
|
||||
14
nui/radar.js
14
nui/radar.js
@@ -605,17 +605,27 @@ function menu( optionText, option )
|
||||
elements.patrolSpeed.html( option );
|
||||
}
|
||||
|
||||
var keyLockTimeout;
|
||||
|
||||
// Makes the key lock label fade in then fade out after 2 seconds
|
||||
function displayKeyLock( state )
|
||||
{
|
||||
let sl = elements.keyLock.stateLabel;
|
||||
|
||||
// Set the state label text to enabled or disabled
|
||||
elements.keyLock.stateLabel.html( state ? "enabled" : "disabled" );
|
||||
sl.html( state ? "blocked" : "enabled" );
|
||||
|
||||
// Change the colour of the altered text
|
||||
state ? sl.addClass( "red" ).removeClass( "green" ) : sl.addClass( "green" ).removeClass( "red" );
|
||||
|
||||
// Fade in the label
|
||||
elements.keyLock.label.fadeIn();
|
||||
|
||||
// Clear the timeout if it already exists
|
||||
clearTimeout( keyLockTimeout );
|
||||
|
||||
// Make the label fade out after 2 seconds
|
||||
setTimeout( function() {
|
||||
keyLockTimeout = setTimeout( function() {
|
||||
elements.keyLock.label.fadeOut();
|
||||
}, 2000 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user