1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-02 04:21:34 +00:00

[Client] Remove unnecessary mwmp::Main::pressedKey() function

Additionally, add comment around where it was originally used.
This commit is contained in:
David Cernat 2019-08-26 15:41:45 +03:00
parent e0f623fb87
commit 78a9a428a6
3 changed files with 11 additions and 9 deletions

View file

@ -21,6 +21,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/GUIController.hpp"
/*
End of tes3mp addition
*/
@ -863,7 +864,16 @@ namespace MWInput
void InputManager::keyPressed( const SDL_KeyboardEvent &arg )
{
mwmp::Main::pressedKey(arg.keysym.scancode);
/*
Start of tes3mp addition
Pass the pressed key to the multiplayer-specific GUI controller
*/
mwmp::Main::get().getGUIController()->pressedKey(arg.keysym.scancode);
/*
End of tes3mp addition
*/
// HACK: to make Morrowind's default keybinding for the console work without printing an extra "^" upon closing
// This assumes that SDL_TextInput events always come *after* the key event
// (which is somewhat reasonable, and hopefully true for all SDL platforms)

View file

@ -257,13 +257,6 @@ CellController *Main::getCellController() const
return mCellController;
}
void Main::pressedKey(int key)
{
if (pMain == nullptr) return;
if (get().getGUIController()->pressedKey(key))
return; // if any gui bind pressed
}
// When sending packets with ingame script values, certain packets
// should be ignored because of their potential for spam
bool Main::isValidPacketScript(std::string script)

View file

@ -25,7 +25,6 @@ namespace mwmp
static void destroy();
static const Main &get();
static void frame(float dt);
static void pressedKey(int key);
static bool isValidPacketScript(std::string script);
static std::string getResDir();