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:
Dan
2020-11-13 17:32:34 +00:00
parent b687908a91
commit f5e55c4728
3 changed files with 21 additions and 3 deletions

View File

@@ -159,6 +159,14 @@ button:focus { outline: none; }
color: rgb(255, 255, 0); color: rgb(255, 255, 0);
} }
.green {
color: rgb( 0, 255, 0 );
}
.red {
color: rgb( 255, 0, 0 );
}
.arrow { .arrow {
width: 11px; width: 11px;
height: 15.4px; height: 15.4px;

View File

@@ -300,7 +300,7 @@
<button id="closeUiSettings" class="close">CLOSE</button> <button id="closeUiSettings" class="close">CLOSE</button>
</div> </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"> <div id="helpWindow">
<iframe id="helpWeb" src="about:blank"></iframe> <iframe id="helpWeb" src="about:blank"></iframe>

View File

@@ -605,17 +605,27 @@ function menu( optionText, option )
elements.patrolSpeed.html( option ); elements.patrolSpeed.html( option );
} }
var keyLockTimeout;
// Makes the key lock label fade in then fade out after 2 seconds // Makes the key lock label fade in then fade out after 2 seconds
function displayKeyLock( state ) function displayKeyLock( state )
{ {
let sl = elements.keyLock.stateLabel;
// Set the state label text to enabled or disabled // 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 // Fade in the label
elements.keyLock.label.fadeIn(); elements.keyLock.label.fadeIn();
// Clear the timeout if it already exists
clearTimeout( keyLockTimeout );
// Make the label fade out after 2 seconds // Make the label fade out after 2 seconds
setTimeout( function() { keyLockTimeout = setTimeout( function() {
elements.keyLock.label.fadeOut(); elements.keyLock.label.fadeOut();
}, 2000 ); }, 2000 );
} }