From 2db542f6927807e964ddb7a5962e2f5cd14e3123 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Sat, 19 Nov 2016 23:10:48 +0800 Subject: [PATCH] Fixes #12 Removed chatting code --- Source/Game.cpp | 3 +-- Source/Game.h | 3 +-- Source/GameDraw.cpp | 12 ++---------- Source/GameTick.cpp | 22 ---------------------- Source/Settings.cpp | 5 ----- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/Source/Game.cpp b/Source/Game.cpp index 1601442..f41a92a 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -124,7 +124,6 @@ int numchallengelevels = 0; bool console = false; std::string consoletext[15] = {}; -bool chatting = 0; std::string displaytext[15] = {}; float displaytime[15] = {}; float displayblinkdelay = 0; @@ -134,7 +133,7 @@ float consoleblinkdelay = 0; bool consoleblink = 0; int consoleselected = 0; -unsigned short crouchkey = 0, jumpkey = 0, forwardkey = 0, chatkey = 0, backkey = 0, leftkey = 0, rightkey = 0, drawkey = 0, throwkey = 0, attackkey = 0; +unsigned short crouchkey = 0, jumpkey = 0, forwardkey = 0, backkey = 0, leftkey = 0, rightkey = 0, drawkey = 0, throwkey = 0, attackkey = 0; unsigned short consolekey = 0; int loading = 0; diff --git a/Source/Game.h b/Source/Game.h index f5b4207..98f6f64 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -136,7 +136,6 @@ extern int numchallengelevels; extern bool console; extern std::string consoletext[15]; -extern bool chatting; extern std::string displaytext[15]; extern float displaytime[15]; extern float displayblinkdelay; @@ -153,7 +152,7 @@ extern float changedelay; extern bool waiting; extern Account* accountactive; -extern unsigned short crouchkey, jumpkey, forwardkey, chatkey, backkey, leftkey, rightkey, drawkey, throwkey, attackkey; +extern unsigned short crouchkey, jumpkey, forwardkey, backkey, leftkey, rightkey, drawkey, throwkey, attackkey; extern unsigned short consolekey; void newGame(); diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 76eadb1..37c4f8d 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -1438,16 +1438,8 @@ int Game::DrawGLScene(StereoSide side) displaytime[0] = 0; glEnable(GL_TEXTURE_2D); glColor4f(1, 1, 1, 1); - if (chatting) { - sprintf (string, " ]"); - text->glPrint(10, 30 + screenheight - 330, string, 0, 1, screenwidth, screenheight); - if (displayblink) { - sprintf (string, "_"); - text->glPrint(30 + (float)(displayselected) * 10, 30 + (screenheight - 330), string, 0, 1, screenwidth, screenheight); - } - } - for (i = 0; i < 15; i++) - if ((i != 0 || chatting) && displaytime[i] < 4) + for (i = 1; i < 15; i++) + if (displaytime[i] < 4) for (j = 0; j < displaytext[i].size(); j++) { glColor4f(1, 1, 1, 4 - displaytime[i]); sprintf (string, "%c", displaytext[i][j]); diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 122471a..e062d66 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -6567,28 +6567,6 @@ void Game::Tick() } } - if (Input::isKeyPressed(chatkey) && !console && !chatting && debugmode) - chatting = 1; - - if (chatting) { - inputText(displaytext[0], &displayselected); - if (!waiting) { - if (!displaytext[0].empty()) { - displaytext[0].clear(); - displayselected = 0; - } - chatting = 0; - } - - displayblinkdelay -= multiplier; - if (displayblinkdelay <= 0) { - displayblinkdelay = .3; - displayblink = 1 - displayblink; - } - } - if (chatting) - keyboardfrozen = true; - if (Input::isKeyPressed(consolekey) && debugmode) { console = !console; if (console) { diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 38bf9b2..2a1ad12 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -65,7 +65,6 @@ void DefaultSettings() throwkey = SDL_SCANCODE_Q; attackkey = MOUSEBUTTON1; consolekey = SDL_SCANCODE_GRAVE; - chatkey = SDL_SCANCODE_T; } void SaveSettings() @@ -157,8 +156,6 @@ void SaveSettings() opstream << attackkey; opstream << "\nConsole key:\n"; opstream << consolekey; - opstream << "\nChat key:\n"; - opstream << chatkey; opstream << "\nDamage bar:\n"; opstream << showdamagebar; opstream << "\nStereoMode:\n"; @@ -278,8 +275,6 @@ bool LoadSettings() ipstream >> attackkey; } else if ( !strncmp(setting, "Console key", 11) ) { ipstream >> consolekey; - } else if ( !strncmp(setting, "Chat key", 8) ) { - ipstream >> chatkey; } else if ( !strncmp(setting, "Damage bar", 10) ) { ipstream >> showdamagebar; } else if ( !strncmp(setting, "StereoMode", 10) ) { -- 2.39.5