add replay button

This commit is contained in:
rick 2022-12-13 02:00:00 +01:00
parent 16a1193e56
commit 9313f91c74
Signed by: Rick
GPG key ID: 4A6223D66294EB20

View file

@ -3,6 +3,8 @@
#include <stdlib.h>
#include <string.h>
#include "read_events.h"
#include "read_file.h"
#include "ui.h"
ui_infos * init_ui(char *name)
@ -41,9 +43,11 @@ int draw_ui(ui_infos *ptr)
igText("Fichier : %s", ptr->name);
igBegin("Test", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration);
igText("Test");
if (ptr->is_recording)
{
igButton("Appuyer sur les clics droit et gauche pour arrêter d'enregistrer.", (ImVec2) { 0, 0 });
ptr->is_recording = listen(ptr->file);
if (ptr->is_recording)
{
@ -57,6 +61,12 @@ int draw_ui(ui_infos *ptr)
{
ptr->is_recording = 1;
}
if (igButton("Replay", (ImVec2) {0, 0}))
{
rewind(ptr->file);
readfile(ptr->file);
}
}
igEnd();