gzdoom/wadsrc/static/zscript/events.txt

49 lines
1.8 KiB
Text
Raw Normal View History

class StaticEventHandler : Object native
2017-01-22 02:15:30 +00:00
{
// static event handlers CAN register other static event handlers.
// unlike EventHandler.Create that will not create them.
protected static native StaticEventHandler Create(class<StaticEventHandler> type);
protected static native StaticEventHandler CreateOnce(class<StaticEventHandler> type);
protected static native StaticEventHandler Find(Class<StaticEventHandler> type); // just for convenience. who knows.
protected static native bool Register(StaticEventHandler handler);
protected static native bool Unregister(StaticEventHandler handler);
// world stuff
virtual void WorldLoaded() {}
virtual void WorldUnloaded() {}
virtual void WorldThingSpawned() {}
// render stuff
virtual void RenderFrame() {}
2017-01-22 02:15:30 +00:00
}
class StaticRenderEventHandler : StaticEventHandler native
2017-01-22 02:15:30 +00:00
{
// for frame and camera
native readonly Vector3 ViewPos;
native readonly double ViewAngle;
native readonly double ViewPitch;
native readonly double ViewRoll;
native readonly double FracTic;
native readonly Actor Camera;
}
class StaticWorldEventHandler : StaticEventHandler native
{
// for world
native readonly bool IsSaveGame; // this is set to true if static WorldLoaded was triggered during savegame loading.
native readonly Actor Thing; // this is for WorldThingSpawned
}
class EventHandler : StaticEventHandler native
{
static native StaticEventHandler Create(class<StaticEventHandler> type);
static native StaticEventHandler CreateOnce(class<StaticEventHandler> type);
static native StaticEventHandler Find(class<StaticEventHandler> type);
static native bool Register(StaticEventHandler handler);
static native bool Unregister(StaticEventHandler handler);
}
class RenderEventHandler : StaticRenderEventHandler native { }