add replay button
This commit is contained in:
parent
16a1193e56
commit
9313f91c74
1 changed files with 10 additions and 0 deletions
10
src/ui.c
10
src/ui.c
|
@ -3,6 +3,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "read_events.h"
|
||||||
|
#include "read_file.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
ui_infos * init_ui(char *name)
|
ui_infos * init_ui(char *name)
|
||||||
|
@ -41,9 +43,11 @@ int draw_ui(ui_infos *ptr)
|
||||||
igText("Fichier : %s", ptr->name);
|
igText("Fichier : %s", ptr->name);
|
||||||
igBegin("Test", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration);
|
igBegin("Test", NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration);
|
||||||
igText("Test");
|
igText("Test");
|
||||||
|
|
||||||
if (ptr->is_recording)
|
if (ptr->is_recording)
|
||||||
{
|
{
|
||||||
igButton("Appuyer sur les clics droit et gauche pour arrêter d'enregistrer.", (ImVec2) { 0, 0 });
|
igButton("Appuyer sur les clics droit et gauche pour arrêter d'enregistrer.", (ImVec2) { 0, 0 });
|
||||||
|
|
||||||
ptr->is_recording = listen(ptr->file);
|
ptr->is_recording = listen(ptr->file);
|
||||||
if (ptr->is_recording)
|
if (ptr->is_recording)
|
||||||
{
|
{
|
||||||
|
@ -57,6 +61,12 @@ int draw_ui(ui_infos *ptr)
|
||||||
{
|
{
|
||||||
ptr->is_recording = 1;
|
ptr->is_recording = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (igButton("Replay", (ImVec2) {0, 0}))
|
||||||
|
{
|
||||||
|
rewind(ptr->file);
|
||||||
|
readfile(ptr->file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
igEnd();
|
igEnd();
|
||||||
|
|
Loading…
Reference in a new issue