From 766a30240d3aa82b154c256d0ab27e9b45e81258 Mon Sep 17 00:00:00 2001 From: Felanbird <41973452+Felanbird@users.noreply.github.com> Date: Sun, 2 Oct 2022 17:17:32 -0400 Subject: [PATCH] Add debug hotkey for test sub messages (#4037) --- src/controllers/hotkeys/ActionNames.hpp | 1 + src/widgets/Window.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/controllers/hotkeys/ActionNames.hpp b/src/controllers/hotkeys/ActionNames.hpp index aa335a16c..538fc42e1 100644 --- a/src/controllers/hotkeys/ActionNames.hpp +++ b/src/controllers/hotkeys/ActionNames.hpp @@ -158,6 +158,7 @@ inline const std::map actionNames{ {"addMiscMessage", ActionDefinition{"Debug: Add misc test message"}}, {"addRewardMessage", ActionDefinition{"Debug: Add reward test message"}}, + {"addSubMessage", ActionDefinition{"Debug: Add sub test message"}}, #endif {"moveTab", ActionDefinition{ diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index 74f024993..f976b0c53 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -249,6 +249,14 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions) getApp()->twitch->addFakeMessage(msg); return ""; }); + + actions.emplace("addSubMessage", [=](std::vector) -> QString { + const auto &messages = getSampleSubMessages(); + static int index = 0; + const auto &msg = messages[index++ % messages.size()]; + getApp()->twitch->addFakeMessage(msg); + return ""; + }); #endif }