From 92dc2a748713ff015978945ac443216f25a32891 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 30 Mar 2021 21:45:16 -0500 Subject: [PATCH] Init chatbox script --- scripts/client/chatbox.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js index dd762be1..f89bd49a 100644 --- a/scripts/client/chatbox.js +++ b/scripts/client/chatbox.js @@ -19,8 +19,25 @@ let maxChatBoxLines = 6; // =========================================================================== -bindKey(SDLK_PAGEUP, KEYSTATE_DOWN, chatBoxScrollUp); -bindKey(SDLK_PAGEDOWN, KEYSTATE_DOWN, chatBoxScrollDown); +function initChatBoxScript() { + logToConsole(LOG_DEBUG, "[Asshat.ChatBox]: Initializing chatbox script ..."); + bindChatBoxKeys(); + logToConsole(LOG_DEBUG, "[Asshat.ChatBox]: Chatbox script initialized!"); +} + +// =========================================================================== + +function bindChatBoxKeys() { + bindKey(SDLK_PAGEUP, KEYSTATE_DOWN, chatBoxScrollUp); + bindKey(SDLK_PAGEDOWN, KEYSTATE_DOWN, chatBoxScrollDown); +} + +// =========================================================================== + +function unBindChatBoxKeys() { + unbindKey(SDLK_PAGEUP); + unbindKey(SDLK_PAGEDOWN); +} // ===========================================================================