~ecs/public-inbox

abort to state::IDLE on escape instead of exiting v1 PROPOSED

Evan Johnston: 1
 abort to state::IDLE on escape instead of exiting

 1 files changed, 4 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~ecs/public-inbox/patches/48052/mbox | git am -3
Learn more about email & git

[PATCH] abort to state::IDLE on escape instead of exiting Export this patch

---
 main.ha | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/main.ha b/main.ha
index b47d64f..0af09a9 100644
--- a/main.ha
+++ b/main.ha
@@ -86,6 +86,7 @@ export fn main() void = {
	raylib::SetTraceLogLevel(raylib::TraceLogLevel::LOG_NONE);
	raylib::InitWindow(0, 0, "ecstimer");
	raylib::SetTargetFPS(60);
	raylib::SetExitKey(0);

	let timer_state = timer_state {
		state = state::IDLE,
@@ -150,6 +151,9 @@ export fn main() void = {
				output_time(timer_state)!;
			};
		};
		if (raylib::IsKeyPressed(raylib::KeyboardKey::KEY_ESCAPE)) {
			timer_state.state = state::IDLE;
		};
		raylib::BeginDrawing();
		raylib::ClearBackground(raylib::BLACK);
		render_state(timer_state);
-- 
2.37.1
Maybe exit on q as well