Add debug hotkey for test sub messages (#4037)

This commit is contained in:
Felanbird 2022-10-02 17:17:32 -04:00 committed by GitHub
parent 54129f76a3
commit 766a30240d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -158,6 +158,7 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
{"addMiscMessage", ActionDefinition{"Debug: Add misc test message"}}, {"addMiscMessage", ActionDefinition{"Debug: Add misc test message"}},
{"addRewardMessage", {"addRewardMessage",
ActionDefinition{"Debug: Add reward test message"}}, ActionDefinition{"Debug: Add reward test message"}},
{"addSubMessage", ActionDefinition{"Debug: Add sub test message"}},
#endif #endif
{"moveTab", {"moveTab",
ActionDefinition{ ActionDefinition{

View file

@ -249,6 +249,14 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
getApp()->twitch->addFakeMessage(msg); getApp()->twitch->addFakeMessage(msg);
return ""; return "";
}); });
actions.emplace("addSubMessage", [=](std::vector<QString>) -> QString {
const auto &messages = getSampleSubMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->twitch->addFakeMessage(msg);
return "";
});
#endif #endif
} }