This commit is contained in:
Vortrex
2021-06-05 17:31:17 -05:00
parent 75c264eace
commit 7b44801a20
61 changed files with 1075 additions and 1078 deletions

View File

@@ -15,25 +15,25 @@ let keyBindLongHoldDuration = 1500;
// ===========================================================================
function initKeyBindScript() {
logToConsole(LOG_DEBUG, "[Asshat.KeyBind]: Initializing key bind script ...");
logToConsole(LOG_DEBUG, "[Asshat.KeyBind]: Key bind script initialized!");
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Initializing key bind script ...");
logToConsole(LOG_DEBUG, "[VRR.KeyBind]: Key bind script initialized!");
}
// ===========================================================================
function bindAccountKey(key, keyState) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
bindKey(toInteger(key), keyState, function(event) {
if(hasKeyBindDelayElapsed()) {
if(canLocalPlayerUseKeyBinds()) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Using keybind for key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Using keybind for key ${sdl.getKeyName(key)} (${key})`);
lastKeyBindUse = sdl.ticks;
tellServerPlayerUsedKeyBind(key);
} else {
logToConsole(LOG_ERROR, `[Asshat.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not allowed to use keybinds!`);
logToConsole(LOG_ERROR, `[VRR.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not allowed to use keybinds!`);
}
} else {
logToConsole(LOG_ERROR, `[Asshat.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not enough time has passed since last keybind use!`);
logToConsole(LOG_ERROR, `[VRR.KeyBind]: Failed to use keybind for key ${sdl.getKeyName(key)} (${key}) - Not enough time has passed since last keybind use!`);
}
});
}
@@ -41,7 +41,7 @@ function bindAccountKey(key, keyState) {
// ===========================================================================
function unBindAccountKey(key) {
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Unbinded key ${sdl.getKeyName(key)} (${key})`);
logToConsole(LOG_DEBUG, `[VRR.KeyBind]: Unbinded key ${sdl.getKeyName(key)} (${key})`);
unbindKey(key);
return true;
}