Rename InputEmitter to EventEmitter.

Add screen_resize event.
This commit is contained in:
Alessandro Proto 2023-02-03 22:58:36 +01:00
parent aec372feb8
commit 15e700008e

View file

@ -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;
});
}
}