From c83e6064ceca990dc41eab4f4bbc231a123ff6e4 Mon Sep 17 00:00:00 2001 From: assertivist Date: Tue, 15 Sep 2026 19:58:26 -0700 Subject: [PATCH 1/4] catch some bugs in the new options screen - actually remap keys after changes to key mapping - attempt to fix crashes on linux --- src/game/CAvaraApp.cpp | 4 +++ src/game/CPlayerManager.cpp | 50 ++++++++++++++++++++----------------- src/game/CPlayerManager.h | 3 ++- src/gui/CSettingsWindow.cpp | 3 +++ src/gui/CommandList.h | 1 + 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/game/CAvaraApp.cpp b/src/game/CAvaraApp.cpp index 34e1f2adc..a4d07a285 100644 --- a/src/game/CAvaraApp.cpp +++ b/src/game/CAvaraApp.cpp @@ -518,6 +518,10 @@ bool CAvaraAppImpl::DoCommand(int theCommand) { } break; } + case kKeyboardMappingReset: { + auto mgr = itsGame->GetPlayerManager(itsGame->GetLocalPlayer()); + mgr->SetupInputMapping(); + } default: break; } diff --git a/src/game/CPlayerManager.cpp b/src/game/CPlayerManager.cpp index 55de91c02..4f85c5a44 100644 --- a/src/game/CPlayerManager.cpp +++ b/src/game/CPlayerManager.cpp @@ -52,6 +52,33 @@ void CPlayerManagerImpl::IPlayerManager(CAvaraGame *theGame, short id, CNetManag oldMouse.v = mouseCenterPosition.v; lastMouseControlTime = 0; + SetupInputMapping(); + // mainScreenRect = &(*GetMainDevice())->gdRect; + // mouseCenterPosition.h = (mainScreenRect->left + mainScreenRect->right) / 2; + // mouseCenterPosition.v = (mainScreenRect->top + mainScreenRect->bottom) / 2; + + // theRoster = aRoster; + theNetManager = aNetManager; + levelCRC = 0; + levelTag = ""; + position = id; + itsPlayer = NULL; + + mugPict = NULL; + mugSize = -1; + mugState = 0; + + NetDisconnect(); + SetLocal(); + if (slot == 0) { + CPlayerManagerImpl::theServerPlayer = this; + } + + prevKeyboardActive = keyboardActive; +} + +void CPlayerManagerImpl::SetupInputMapping() { + // Mirrors what's in Preferences.h for kKeyboardMappingTag json commandBits = {{"forward", 1 << kfuForward}, {"backward", 1 << kfuReverse}, @@ -126,29 +153,6 @@ void CPlayerManagerImpl::IPlayerManager(CAvaraGame *theGame, short id, CNetManag controllerButtonMap[SDL_CONTROLLER_BUTTON_RIGHTSHOULDER] = 1 << kfuLoadGrenade; controllerButtonMap[SDL_CONTROLLER_BUTTON_BACK] = 1 << kfuAbortGame; controllerButtonMap[SDL_CONTROLLER_BUTTON_START] = 1 << kfuPauseGame; - - // mainScreenRect = &(*GetMainDevice())->gdRect; - // mouseCenterPosition.h = (mainScreenRect->left + mainScreenRect->right) / 2; - // mouseCenterPosition.v = (mainScreenRect->top + mainScreenRect->bottom) / 2; - - // theRoster = aRoster; - theNetManager = aNetManager; - levelCRC = 0; - levelTag = ""; - position = id; - itsPlayer = NULL; - - mugPict = NULL; - mugSize = -1; - mugState = 0; - - NetDisconnect(); - SetLocal(); - if (slot == 0) { - CPlayerManagerImpl::theServerPlayer = this; - } - - prevKeyboardActive = keyboardActive; } void CPlayerManagerImpl::SetPlayer(CAbstractPlayer *thePlayer) { diff --git a/src/game/CPlayerManager.h b/src/game/CPlayerManager.h index f89f5c058..2e787c0b4 100644 --- a/src/game/CPlayerManager.h +++ b/src/game/CPlayerManager.h @@ -147,6 +147,7 @@ class CPlayerManager { virtual void IncrementAskAgainTime(int) = 0; virtual void SetShowScoreboard(bool b) = 0; virtual bool GetShowScoreboard() = 0; + virtual void SetupInputMapping() = 0; }; class CPlayerManagerImpl : public CDirectObject, public CPlayerManager, public std::enable_shared_from_this { @@ -315,6 +316,6 @@ class CPlayerManagerImpl : public CDirectObject, public CPlayerManager, public s virtual void IncrementAskAgainTime(int); virtual void SetShowScoreboard(bool b); virtual bool GetShowScoreboard(); - + virtual void SetupInputMapping(); void PlaybackAndRecord(FunctionTable &ft); }; diff --git a/src/gui/CSettingsWindow.cpp b/src/gui/CSettingsWindow.cpp index a42f933dc..327764bd2 100644 --- a/src/gui/CSettingsWindow.cpp +++ b/src/gui/CSettingsWindow.cpp @@ -12,6 +12,7 @@ #include "AssetManager.h" #include "ARGBColor.h" #include "NVGUtil.h" +#include "CommandList.h" std::string stringForAction(std::string action) { json theKeys = gApplication->Get(kKeyboardMappingTag); @@ -38,6 +39,7 @@ CSettingsWindow::CSettingsWindow(CApplication *app) : CWindow(app, "Avara Settin NVGcontext *ctx = app->nvgContext(); currentlyMappingKey = false; + keyMapWindow = 0; std::string kbIconsPath = AssetManager::GetImagePath(NoPackage, "control48px.png"); keyboardIconsDataHandle = nvgCreateImage(ctx, kbIconsPath.c_str(), 0); @@ -187,6 +189,7 @@ CSettingsWindow::CSettingsWindow(CApplication *app) : CWindow(app, "Avara Settin keyMapWindow->setCallback([this, longbutton, actionKey] (int status) { refreshKeyboardMappingWindow(status); longbutton->setCaption(stringForAction(actionKey)); + this->mApplication->DoCommand(kKeyboardMappingReset); }); }); keyboardConfigIndex++; diff --git a/src/gui/CommandList.h b/src/gui/CommandList.h index de4a0bebf..0bc66297b 100644 --- a/src/gui/CommandList.h +++ b/src/gui/CommandList.h @@ -51,6 +51,7 @@ enum { kShowInfoPanel, kShowLevelListWind, kPrepareShowLevelListWind, + kKeyboardMappingReset, kUseDefaultDirectory = 250, kAutoSaveScores, From 185a9269ce6109b406f7de08cbd179a79cbbb3eb Mon Sep 17 00:00:00 2001 From: assertivist Date: Tue, 15 Sep 2026 21:22:39 -0700 Subject: [PATCH 2/4] more crash fix attempts --- src/gui/CKeyboardMappingWindow.cpp | 5 +++++ src/gui/CSettingsWindow.cpp | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/CKeyboardMappingWindow.cpp b/src/gui/CKeyboardMappingWindow.cpp index 401bf78dc..9fd638d13 100644 --- a/src/gui/CKeyboardMappingWindow.cpp +++ b/src/gui/CKeyboardMappingWindow.cpp @@ -8,6 +8,7 @@ #include "CKeyboardMappingWindow.h" #include "Preferences.h" #include "CApplication.h" +#include "CommandList.h" CKeyboardMappingWindow::CKeyboardMappingWindow(CApplication *app, const std::string &actionDesc, const std::string &key, int imageOffset, int imageHandle) : CWindow(app, "Keyboard Mapping") { setTitle("Map Keys to Action"); @@ -75,6 +76,7 @@ void CKeyboardMappingWindow::removeMappingButton(const std::string &action, cons SDL_Log("Delete %s bound to %s", key.c_str(), action.c_str()); removeKeyBind(key); if (mCallback) mCallback(1); + gathering = false; dispose(); }); } @@ -107,6 +109,7 @@ bool CKeyboardMappingWindow::handleSDLEvent(SDL_Event &event) { void CKeyboardMappingWindow::addKeyBind(const std::string &keyname) { json allmap = mApplication->Get(kKeyboardMappingTag); + if (!(allmap.size()) || !theKey) return; auto theKeyCStr = theKey->c_str(); auto k = allmap.at(theKeyCStr); if (k.is_array()) { @@ -128,6 +131,7 @@ void CKeyboardMappingWindow::addKeyBind(const std::string &keyname) { allmap[theKeyCStr] = new_arr; } mApplication->Set(kKeyboardMappingTag, allmap); + this->mApplication->DoCommand(kKeyboardMappingReset); } void CKeyboardMappingWindow::removeKeyBind(const std::string &keyname) { @@ -152,4 +156,5 @@ void CKeyboardMappingWindow::removeKeyBind(const std::string &keyname) { allmap[theKey->c_str()] = json(""); } mApplication->Set(kKeyboardMappingTag, allmap); + this->mApplication->DoCommand(kKeyboardMappingReset); } diff --git a/src/gui/CSettingsWindow.cpp b/src/gui/CSettingsWindow.cpp index 327764bd2..0de68d30f 100644 --- a/src/gui/CSettingsWindow.cpp +++ b/src/gui/CSettingsWindow.cpp @@ -12,7 +12,6 @@ #include "AssetManager.h" #include "ARGBColor.h" #include "NVGUtil.h" -#include "CommandList.h" std::string stringForAction(std::string action) { json theKeys = gApplication->Get(kKeyboardMappingTag); @@ -189,7 +188,6 @@ CSettingsWindow::CSettingsWindow(CApplication *app) : CWindow(app, "Avara Settin keyMapWindow->setCallback([this, longbutton, actionKey] (int status) { refreshKeyboardMappingWindow(status); longbutton->setCaption(stringForAction(actionKey)); - this->mApplication->DoCommand(kKeyboardMappingReset); }); }); keyboardConfigIndex++; From cc35e438f3547e1689d81315831af3c421194b1d Mon Sep 17 00:00:00 2001 From: assertivist Date: Wed, 16 Sep 2026 02:29:49 -0700 Subject: [PATCH 3/4] actually reset keymap for local player --- src/game/CAvaraApp.cpp | 4 +-- src/game/CPlayerManager.cpp | 2 +- src/gui/CKeyboardMappingWindow.cpp | 48 ++++++++++++------------------ src/gui/CKeyboardMappingWindow.h | 7 ++--- src/gui/CSettingsWindow.cpp | 13 ++++---- src/gui/CSettingsWindow.h | 2 +- 6 files changed, 34 insertions(+), 42 deletions(-) diff --git a/src/game/CAvaraApp.cpp b/src/game/CAvaraApp.cpp index a4d07a285..472ddd8a7 100644 --- a/src/game/CAvaraApp.cpp +++ b/src/game/CAvaraApp.cpp @@ -519,8 +519,8 @@ bool CAvaraAppImpl::DoCommand(int theCommand) { break; } case kKeyboardMappingReset: { - auto mgr = itsGame->GetPlayerManager(itsGame->GetLocalPlayer()); - mgr->SetupInputMapping(); + auto player = CPlayerManagerImpl::LocalPlayer(); + if (player) player->SetupInputMapping(); } default: break; diff --git a/src/game/CPlayerManager.cpp b/src/game/CPlayerManager.cpp index 4f85c5a44..9ef471d50 100644 --- a/src/game/CPlayerManager.cpp +++ b/src/game/CPlayerManager.cpp @@ -78,7 +78,7 @@ void CPlayerManagerImpl::IPlayerManager(CAvaraGame *theGame, short id, CNetManag } void CPlayerManagerImpl::SetupInputMapping() { - + keyMap.clear(); // Mirrors what's in Preferences.h for kKeyboardMappingTag json commandBits = {{"forward", 1 << kfuForward}, {"backward", 1 << kfuReverse}, diff --git a/src/gui/CKeyboardMappingWindow.cpp b/src/gui/CKeyboardMappingWindow.cpp index 9fd638d13..734b3859a 100644 --- a/src/gui/CKeyboardMappingWindow.cpp +++ b/src/gui/CKeyboardMappingWindow.cpp @@ -10,9 +10,9 @@ #include "CApplication.h" #include "CommandList.h" -CKeyboardMappingWindow::CKeyboardMappingWindow(CApplication *app, const std::string &actionDesc, const std::string &key, int imageOffset, int imageHandle) : CWindow(app, "Keyboard Mapping") { +CKeyboardMappingWindow::CKeyboardMappingWindow(CApplication *app, const std::string &actionDesc, const std::string &action, int imageOffset, int imageHandle) : CWindow(app, "Keyboard Mapping") { setTitle("Map Keys to Action"); - theKey = new std::string(key); + theAction = new std::string(action); auto layout = new nanogui::GridLayout(nanogui::Orientation::Horizontal, 2, nanogui::Alignment::Fill, 25, 25); layout->setRowAlignment(nanogui::Alignment::Middle); layout->setColAlignment(nanogui::Alignment::Middle); @@ -30,20 +30,18 @@ CKeyboardMappingWindow::CKeyboardMappingWindow(CApplication *app, const std::str //actionLabel->setFixedWidth(300); actionLabel->setCaption(actionDesc); - currentlyMapping = new std::string(key); - json allmap = app->Get(kKeyboardMappingTag); - auto k = allmap.at(key); + auto k = allmap.at(action); if (k.is_array()) { for (auto ik : k.items()) { std::string sdlkey = ik.value(); add(sdlkey); - removeMappingButton(key, sdlkey); + removeMappingButton(action, sdlkey); } } else { add(k); - removeMappingButton(key, k); + removeMappingButton(action, k); } addbtn = add("Add New"); addbtn->setBackgroundColor(kGUIAccentPositive); @@ -56,8 +54,8 @@ CKeyboardMappingWindow::CKeyboardMappingWindow(CApplication *app, const std::str closeBtn->setCallback([this] { setModal(false); setVisible(false); + gathering = false; if (mCallback) mCallback(0); - dispose(); }); setNeedsLayout(); setVisible(true); @@ -75,18 +73,13 @@ void CKeyboardMappingWindow::removeMappingButton(const std::string &action, cons keybtn->setCallback([this, action, key] { SDL_Log("Delete %s bound to %s", key.c_str(), action.c_str()); removeKeyBind(key); - if (mCallback) mCallback(1); gathering = false; - dispose(); + if (mCallback) mCallback(1); }); } -void CKeyboardMappingWindow::gatherKey() { - gathering = true; -} - bool CKeyboardMappingWindow::editing() { - return true; + return gathering; } bool CKeyboardMappingWindow::handleSDLEvent(SDL_Event &event) { @@ -94,12 +87,10 @@ bool CKeyboardMappingWindow::handleSDLEvent(SDL_Event &event) { if (event.type == SDL_KEYDOWN) { auto sym = event.key.keysym.sym; auto name = SDL_GetKeyName(sym); - //actionLabel->setCaption(name); SDL_Log("%d %s", sym, name); addKeyBind(name); gathering = false; if (mCallback) mCallback(1); - dispose(); return true; } } @@ -109,35 +100,35 @@ bool CKeyboardMappingWindow::handleSDLEvent(SDL_Event &event) { void CKeyboardMappingWindow::addKeyBind(const std::string &keyname) { json allmap = mApplication->Get(kKeyboardMappingTag); - if (!(allmap.size()) || !theKey) return; - auto theKeyCStr = theKey->c_str(); - auto k = allmap.at(theKeyCStr); + if (!(allmap.size()) || !theAction) return; + auto theActionCStr = theAction->c_str(); + auto k = allmap.at(theActionCStr); if (k.is_array()) { bool found = false; for (auto ik : k.items()) { if (ik.value() == keyname) { found = true; - SDL_Log("Not binding %s to %s because it is already bound", theKeyCStr, keyname.c_str()); + SDL_Log("Not binding %s to %s because it is already bound", theActionCStr, keyname.c_str()); } } if (!found) { k.push_back(json(keyname)); - allmap[theKeyCStr] = k; + allmap[theActionCStr] = k; } } else if (k != keyname) { json new_arr = nlohmann::json::array(); new_arr = {k, json(keyname)}; - allmap[theKeyCStr] = new_arr; + allmap[theActionCStr] = new_arr; } mApplication->Set(kKeyboardMappingTag, allmap); - this->mApplication->DoCommand(kKeyboardMappingReset); } void CKeyboardMappingWindow::removeKeyBind(const std::string &keyname) { - json allmap = mApplication->Get(kKeyboardMappingTag); - auto k = allmap.at(theKey->c_str()); + if (!(allmap.size()) || !theAction) return; + auto theActionCStr = theAction->c_str(); + auto k = allmap.at(theActionCStr); auto remove_idxs = std::vector(); if (k.is_array()) { int ik_idx = 0; @@ -150,11 +141,10 @@ void CKeyboardMappingWindow::removeKeyBind(const std::string &keyname) { for (auto idx : remove_idxs) { k.erase(idx); } - allmap[theKey->c_str()] = k; + allmap[theActionCStr] = k; } else { - allmap[theKey->c_str()] = json(""); + allmap[theActionCStr] = json(""); } mApplication->Set(kKeyboardMappingTag, allmap); - this->mApplication->DoCommand(kKeyboardMappingReset); } diff --git a/src/gui/CKeyboardMappingWindow.h b/src/gui/CKeyboardMappingWindow.h index 82ab0d60e..977ff2495 100644 --- a/src/gui/CKeyboardMappingWindow.h +++ b/src/gui/CKeyboardMappingWindow.h @@ -13,19 +13,18 @@ class CKeyboardMappingWindow : public CWindow { public: - CKeyboardMappingWindow(CApplication *app, const std::string &actionDesc, const std::string &key, int imageOffset, int imageHandle); + CKeyboardMappingWindow(CApplication *app, const std::string &actionDesc, const std::string &action, int imageOffset, int imageHandle); virtual bool editing(); bool handleSDLEvent(SDL_Event &event); - void gatherKey(); - bool gathering = false; std::function callback() const { return mCallback; } void setCallback(const std::function &callback) { mCallback = callback; } protected: + bool gathering = false; std::function mCallback; void removeMappingButton(const std::string &action, const std::string &key); void addKeyBind(const std::string &keyname); void removeKeyBind(const std::string &keyname); - std::string *theKey; + std::string *theAction; SpriteWidget *actionIcon; nanogui::Label *actionLabel; nanogui::Label *currentLabel; diff --git a/src/gui/CSettingsWindow.cpp b/src/gui/CSettingsWindow.cpp index 0de68d30f..591717b78 100644 --- a/src/gui/CSettingsWindow.cpp +++ b/src/gui/CSettingsWindow.cpp @@ -12,6 +12,7 @@ #include "AssetManager.h" #include "ARGBColor.h" #include "NVGUtil.h" +#include "CommandList.h" std::string stringForAction(std::string action) { json theKeys = gApplication->Get(kKeyboardMappingTag); @@ -185,9 +186,9 @@ CSettingsWindow::CSettingsWindow(CApplication *app) : CWindow(app, "Avara Settin currentlyMappingActionDesc = actionDesc; currentlyMappingButton = longbutton; keyMapWindow = new CKeyboardMappingWindow(this->mApplication, actionDesc, actionKey, keyboardIconOffset, keyboardIconsDataHandle); - keyMapWindow->setCallback([this, longbutton, actionKey] (int status) { + keyMapWindow->setCallback([this, longbutton] (int status) { + longbutton->setCaption(stringForAction(currentlyMappingAction)); refreshKeyboardMappingWindow(status); - longbutton->setCaption(stringForAction(actionKey)); }); }); keyboardConfigIndex++; @@ -208,19 +209,21 @@ CSettingsWindow::CSettingsWindow(CApplication *app) : CWindow(app, "Avara Settin void CSettingsWindow::refreshKeyboardMappingWindow(int status) { if (status) { + keyMapWindow->dispose(); keyMapWindow = new CKeyboardMappingWindow(this->mApplication, currentlyMappingActionDesc, currentlyMappingAction, currentlyMappingKeyboardIconOffset, keyboardIconsDataHandle); keyMapWindow->setCallback([this] (int status) { - refreshKeyboardMappingWindow(status); currentlyMappingButton->setCaption(stringForAction(currentlyMappingAction)); + refreshKeyboardMappingWindow(status); }); } else { currentlyMappingKey = false; } + this->mApplication->DoCommand(kKeyboardMappingReset); } bool CSettingsWindow::currentlyMapping() { - return keyMapWindow && keyMapWindow->gathering; + return keyMapWindow && keyMapWindow->editing(); } CKeyboardMappingWindow* CSettingsWindow::getKeyMapWindow() { @@ -233,7 +236,7 @@ bool CSettingsWindow::editing() { bool CSettingsWindow::handleSDLEvent(SDL_Event &event) { SDL_Log("CSettingsWindowEvent"); - if (keyMapWindow && keyMapWindow->gathering) { + if (keyMapWindow && keyMapWindow->editing()) { return keyMapWindow->handleSDLEvent(event); } return false; diff --git a/src/gui/CSettingsWindow.h b/src/gui/CSettingsWindow.h index c12d4c138..5db0c7517 100644 --- a/src/gui/CSettingsWindow.h +++ b/src/gui/CSettingsWindow.h @@ -20,7 +20,7 @@ class CSettingsWindow : public CWindow { virtual bool editing(); bool handleSDLEvent(SDL_Event &event); bool currentlyMapping(); - CKeyboardMappingWindow* getKeyMapWindow(); + CKeyboardMappingWindow *getKeyMapWindow(); void refreshKeyboardMappingWindow(int status); protected: nanogui::TabWidget *mPrefTabs; From 2ea2fa1d28530708cd7966a385fb39f62a104092 Mon Sep 17 00:00:00 2001 From: assertivist Date: Wed, 16 Sep 2026 02:59:10 -0700 Subject: [PATCH 4/4] fix the tests i broke with changes to player manager, add a text command to show the tracker window if you're already joined to a server or hosting --- src/game/CAvaraApp.cpp | 2 +- src/game/CPlayerManager.cpp | 4 ++-- src/game/CPlayerManager.h | 4 ++-- src/tests.cpp | 1 + src/tui/CommandManager.cpp | 7 +++++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/game/CAvaraApp.cpp b/src/game/CAvaraApp.cpp index 472ddd8a7..2b971a9ae 100644 --- a/src/game/CAvaraApp.cpp +++ b/src/game/CAvaraApp.cpp @@ -520,7 +520,7 @@ bool CAvaraAppImpl::DoCommand(int theCommand) { } case kKeyboardMappingReset: { auto player = CPlayerManagerImpl::LocalPlayer(); - if (player) player->SetupInputMapping(); + if (player) player->ResetKeyMap(); } default: break; diff --git a/src/game/CPlayerManager.cpp b/src/game/CPlayerManager.cpp index 9ef471d50..12988c678 100644 --- a/src/game/CPlayerManager.cpp +++ b/src/game/CPlayerManager.cpp @@ -52,7 +52,7 @@ void CPlayerManagerImpl::IPlayerManager(CAvaraGame *theGame, short id, CNetManag oldMouse.v = mouseCenterPosition.v; lastMouseControlTime = 0; - SetupInputMapping(); + ResetKeyMap(); // mainScreenRect = &(*GetMainDevice())->gdRect; // mouseCenterPosition.h = (mainScreenRect->left + mainScreenRect->right) / 2; // mouseCenterPosition.v = (mainScreenRect->top + mainScreenRect->bottom) / 2; @@ -77,7 +77,7 @@ void CPlayerManagerImpl::IPlayerManager(CAvaraGame *theGame, short id, CNetManag prevKeyboardActive = keyboardActive; } -void CPlayerManagerImpl::SetupInputMapping() { +void CPlayerManagerImpl::ResetKeyMap() { keyMap.clear(); // Mirrors what's in Preferences.h for kKeyboardMappingTag json commandBits = {{"forward", 1 << kfuForward}, diff --git a/src/game/CPlayerManager.h b/src/game/CPlayerManager.h index 2e787c0b4..c9a4f6567 100644 --- a/src/game/CPlayerManager.h +++ b/src/game/CPlayerManager.h @@ -147,7 +147,7 @@ class CPlayerManager { virtual void IncrementAskAgainTime(int) = 0; virtual void SetShowScoreboard(bool b) = 0; virtual bool GetShowScoreboard() = 0; - virtual void SetupInputMapping() = 0; + virtual void ResetKeyMap() = 0; }; class CPlayerManagerImpl : public CDirectObject, public CPlayerManager, public std::enable_shared_from_this { @@ -316,6 +316,6 @@ class CPlayerManagerImpl : public CDirectObject, public CPlayerManager, public s virtual void IncrementAskAgainTime(int); virtual void SetShowScoreboard(bool b); virtual bool GetShowScoreboard(); - virtual void SetupInputMapping(); + virtual void ResetKeyMap(); void PlaybackAndRecord(FunctionTable &ft); }; diff --git a/src/tests.cpp b/src/tests.cpp index cedde7faf..b9aaea05e 100644 --- a/src/tests.cpp +++ b/src/tests.cpp @@ -120,6 +120,7 @@ class TestPlayerManager : public CPlayerManager { virtual void IncrementAskAgainTime(int) {} virtual void SetShowScoreboard(bool b) {} virtual bool GetShowScoreboard() { return false; } + virtual void ResetKeyMap(){} private: FunctionTable *ft; diff --git a/src/tui/CommandManager.cpp b/src/tui/CommandManager.cpp index 7978c392b..b68c79343 100644 --- a/src/tui/CommandManager.cpp +++ b/src/tui/CommandManager.cpp @@ -129,6 +129,13 @@ CommandManager::CommandManager(CAvaraAppImpl *theApp) : itsApp(theApp) { return false; }); TextCommand::Register(cmd); + + cmd = new TextCommand("/tracker <- show the tracker window", + [this](VectorOfArgs vargs) -> bool { + itsApp->trackerWindow->setVisible(!itsApp->trackerWindow->visible()); + return false; + }); + TextCommand::Register(cmd); }