replay control clicks in open dialogs

This commit is contained in:
2024-07-03 22:16:34 -06:00
committed by Celtic Minstrel
parent 51986ef981
commit a7925affc5

View File

@@ -27,6 +27,7 @@
#include "tools/cursors.hpp"
#include "tools/prefs.hpp"
#include "tools/framerate_limiter.hpp"
#include "replay.hpp"
using namespace std;
using namespace ticpp;
@@ -534,7 +535,16 @@ void cDialog::handle_events() {
cFramerateLimiter fps_limiter;
while(dialogNotToast) {
while(win.pollEvent(currentEvent)) handle_one_event(currentEvent);
if(replaying){
if(next_action_type() == "control_click"){
Element* next_action = pop_next_action();
auto info = info_from_action(next_action);
eKeyMod mods = static_cast<eKeyMod>(atoi(info["mods"].c_str()));
controls[info["id"]]->triggerClickHandler(*this, info["id"], mods);
}
}else{
while(win.pollEvent(currentEvent)) handle_one_event(currentEvent);
}
// Ideally, this should be the only draw call that is done in a cycle.
draw();