mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Rename InputEmitter to EventEmitter.
Add screen_resize event.
This commit is contained in:
parent
aec372feb8
commit
15e700008e
1 changed files with 12 additions and 3 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue