From 15e700008e6ec60a98c908fa7666ac9174998c0a Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Fri, 3 Feb 2023 22:58:36 +0100 Subject: [PATCH] Rename InputEmitter to EventEmitter. Add screen_resize event. --- .../Runtime/{InputEmitter.cs => EventEmitter.cs} | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) rename Capy64/Runtime/{InputEmitter.cs => EventEmitter.cs} (92%) diff --git a/Capy64/Runtime/InputEmitter.cs b/Capy64/Runtime/EventEmitter.cs similarity index 92% rename from Capy64/Runtime/InputEmitter.cs rename to Capy64/Runtime/EventEmitter.cs index 44bbd7a..918e7bf 100644 --- a/Capy64/Runtime/InputEmitter.cs +++ b/Capy64/Runtime/EventEmitter.cs @@ -9,14 +9,14 @@ using Capy64.Runtime.Extensions; namespace Capy64.Runtime; -internal class InputEmitter +internal class EventEmitter { - private EventEmitter _eventEmitter; + private Eventing.EventEmitter _eventEmitter; private LuaState _runtime; private const int rebootDelay = 30; private int heldReboot = 0; - public InputEmitter(EventEmitter eventEmitter, LuaState runtime) + public EventEmitter(Eventing.EventEmitter eventEmitter, LuaState runtime) { _eventEmitter = eventEmitter; _runtime = runtime; @@ -34,6 +34,7 @@ internal class InputEmitter _eventEmitter.OnChar += OnChar; _eventEmitter.OnTick += OnTick; + _eventEmitter.OnScreenSizeChange += OnScreenSizeChange; } public void Unregister() @@ -180,4 +181,12 @@ internal class InputEmitter return 1; }); } + + private void OnScreenSizeChange(object sender, EventArgs e) + { + _runtime.QueueEvent("screen_resize", LK => + { + return 0; + }); + } }