fix events
parent
ff901ec709
commit
6aaffe6340
|
@ -1,6 +1,6 @@
|
|||
class R3 {
|
||||
static version = '2.0.205';
|
||||
static compileDate = '2021 Sep 08 - 06:39:38 am';
|
||||
static version = '2.0.206';
|
||||
static compileDate = '2021 Sep 08 - 07:14:46 am';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,9 +50,9 @@ class System {
|
|||
System.Started = false;
|
||||
System.Subscriptions = {};
|
||||
|
||||
System.SystemInput = 0x0;
|
||||
System.SystemLinking = 0x1;
|
||||
System.SystemSocket = 0x2;
|
||||
System.SYSTEM_INPUT = 0x0;
|
||||
System.SYSTEM_LINKING = 0x1;
|
||||
System.SYSTEM_SOCKET = 0x2;
|
||||
System.MAX_SYSTEMS = 0x3;
|
||||
|
||||
class Event {
|
||||
|
@ -1726,52 +1726,52 @@ class SystemInput extends System {
|
|||
*/
|
||||
static Start() {
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_START'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_START'] = Event.Subscribe(
|
||||
Event.TOUCH_START,
|
||||
SystemInput.OnTouchStart
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_END'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_END'] = Event.Subscribe(
|
||||
Event.TOUCH_END,
|
||||
SystemInput.OnTouchEnd
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_MOVE'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_MOVE'] = Event.Subscribe(
|
||||
Event.TOUCH_MOVE,
|
||||
SystemInput.OnTouchMove
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_CANCEL'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_CANCEL'] = Event.Subscribe(
|
||||
Event.TOUCH_CANCEL,
|
||||
SystemInput.OnTouchCancel
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['KEYBOARD_DOWN'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['KEYBOARD_DOWN'] = Event.Subscribe(
|
||||
Event.KEYBOARD_DOWN,
|
||||
SystemInput.OnKeyboardDown
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['KEYBOARD_UP'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['KEYBOARD_UP'] = Event.Subscribe(
|
||||
Event.KEYBOARD_UP,
|
||||
SystemInput.OnKeyboardUp
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_DOWN'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_DOWN'] = Event.Subscribe(
|
||||
Event.MOUSE_DOWN,
|
||||
SystemInput.OnMouseDown
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_UP'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_UP'] = Event.Subscribe(
|
||||
Event.MOUSE_UP,
|
||||
SystemInput.OnMouseUp
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_MOVE'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_MOVE'] = Event.Subscribe(
|
||||
Event.MOUSE_MOVE,
|
||||
SystemInput.OnMouseMove
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_WHEEL'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_WHEEL'] = Event.Subscribe(
|
||||
Event.MOUSE_WHEEL,
|
||||
SystemInput.OnMouseWheel
|
||||
);
|
||||
|
@ -2037,12 +2037,12 @@ class SystemLinking extends System {
|
|||
*/
|
||||
static Start(options) {
|
||||
|
||||
SystemLinking.Subscriptions['OBJECT_CREATED'] = new Event.Subscribe(
|
||||
SystemLinking.Subscriptions['OBJECT_CREATED'] = Event.Subscribe(
|
||||
Event.OBJECT_CREATED,
|
||||
SystemLinking.OnObjectCreated
|
||||
);
|
||||
|
||||
SystemLinking.Subscriptions['INSTANCE_CREATED'] = new Event.Subscribe(
|
||||
SystemLinking.Subscriptions['INSTANCE_CREATED'] = Event.Subscribe(
|
||||
Event.INSTANCE_CREATED,
|
||||
SystemLinking.OnInstanceCreated
|
||||
);
|
||||
|
@ -2318,18 +2318,18 @@ class Runtime extends Event {
|
|||
|
||||
}
|
||||
|
||||
Runtime.Coder = 0x0;
|
||||
Runtime.CodeMirror = 0x1;
|
||||
Runtime.Default = 0x2;
|
||||
Runtime.CODER = 0x0;
|
||||
Runtime.CODE_MIRROR = 0x1;
|
||||
Runtime.DEFAULT = 0x2;
|
||||
Runtime.GUI = 0x3;
|
||||
Runtime.ControlKit = 0x4;
|
||||
Runtime.Graphics = 0x5;
|
||||
Runtime.Three = 0x6;
|
||||
Runtime.Physics = 0x7;
|
||||
Runtime.Bullet = 0x8;
|
||||
Runtime.Socket = 0x9;
|
||||
Runtime.Statistics = 0xa;
|
||||
Runtime.Stats = 0xb;
|
||||
Runtime.CONTROL_KIT = 0x4;
|
||||
Runtime.GRAPHICS = 0x5;
|
||||
Runtime.THREE = 0x6;
|
||||
Runtime.PHYSICS = 0x7;
|
||||
Runtime.BULLET = 0x8;
|
||||
Runtime.SOCKET = 0x9;
|
||||
Runtime.STATISTICS = 0xa;
|
||||
Runtime.STATS = 0xb;
|
||||
Runtime.MAX_RUNTIMES = 0xc;
|
||||
|
||||
/**
|
||||
|
@ -3361,9 +3361,9 @@ class Component extends R3Object {
|
|||
|
||||
}
|
||||
|
||||
Component.Image = 0x0;
|
||||
Component.Input = 0x1;
|
||||
Component.Touch = 0x2;
|
||||
Component.IMAGE = 0x0;
|
||||
Component.INPUT = 0x1;
|
||||
Component.TOUCH = 0x2;
|
||||
Component.MAX_COMPONENTS = 0x3;
|
||||
|
||||
/**
|
||||
|
@ -4529,6 +4529,24 @@ R3.Runtime = Runtime;
|
|||
R3.Object = R3Object;
|
||||
R3.Component = Component;
|
||||
R3.Project = Project;
|
||||
System.Input = SystemInput;
|
||||
System.Linking = SystemLinking;
|
||||
System.Socket = SystemSocket;
|
||||
Component.Image = Image;
|
||||
Component.Input = Input;
|
||||
Component.Input.Touch = Touch;
|
||||
Runtime.Coder = Coder;
|
||||
Runtime.Coder.CodeMirror = CodeMirror;
|
||||
Runtime.Default = Default;
|
||||
Runtime.GUI = GUI;
|
||||
Runtime.GUI.ControlKit = ControlKit;
|
||||
Runtime.Graphics = Graphics;
|
||||
Runtime.Graphics.Three = Three;
|
||||
Runtime.Physics = Physics;
|
||||
Runtime.Physics.Bullet = Bullet;
|
||||
Runtime.Socket = Socket;
|
||||
Runtime.Statistics = Statistics;
|
||||
Runtime.Statistics.Stats = Stats;
|
||||
console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);
|
||||
R3.System.Input.Start();
|
||||
R3.System.Linking.Start();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "r3",
|
||||
"version" : "2.0.205",
|
||||
"version" : "2.0.206",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
|
27
r3.php
27
r3.php
|
@ -1333,6 +1333,31 @@ function generateR3Dist($nodes)
|
|||
}
|
||||
}
|
||||
|
||||
$indexFiles = [
|
||||
'src/r3/r3-system/index.js',
|
||||
'src/r3/r3-component/index.js',
|
||||
'src/r3/r3-runtime/index.js',
|
||||
];
|
||||
|
||||
foreach ($indexFiles as $indexFile) {
|
||||
|
||||
$savedGenerate = save($indexFile, $generateTokens)[1];
|
||||
|
||||
foreach ($savedGenerate as $key => $store) {
|
||||
|
||||
if ($key != 'GENERATED_INDEX_BODY') {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($store as $line) {
|
||||
fwrite($r3js, $line);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteSavedFile($indexFile . '.saved');
|
||||
}
|
||||
|
||||
foreach ($savedCustom as $key => $store)
|
||||
{
|
||||
foreach ($store as $line) {
|
||||
|
@ -1491,7 +1516,7 @@ function generateOutOfClassImplementationDefines($graph, $types)
|
|||
|
||||
$i = 0;
|
||||
foreach ($children as $child) {
|
||||
array_push($updateList, $parent->name . '.' . $child->name . ' = 0x' . dechex($i) . ";\n");
|
||||
array_push($updateList, $parent->name . '.' . strtoupper(from_camel_case($child->name)) . ' = 0x' . dechex($i) . ";\n");
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
|
|
@ -277,9 +277,9 @@ class Component extends R3Object {
|
|||
}
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Component.Image = 0x0;
|
||||
Component.Input = 0x1;
|
||||
Component.Touch = 0x2;
|
||||
Component.IMAGE = 0x0;
|
||||
Component.INPUT = 0x1;
|
||||
Component.TOUCH = 0x2;
|
||||
Component.MAX_COMPONENTS = 0x3;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class R3 {
|
||||
static version = '2.0.205';
|
||||
static compileDate = '2021 Sep 08 - 06:39:38 am';
|
||||
static version = '2.0.206';
|
||||
static compileDate = '2021 Sep 08 - 07:14:46 am';
|
||||
}
|
||||
|
||||
//GENERATED_IMPORTS_START
|
||||
|
|
|
@ -133,18 +133,18 @@ class Runtime extends Event {
|
|||
}
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
Runtime.Coder = 0x0;
|
||||
Runtime.CodeMirror = 0x1;
|
||||
Runtime.Default = 0x2;
|
||||
Runtime.CODER = 0x0;
|
||||
Runtime.CODE_MIRROR = 0x1;
|
||||
Runtime.DEFAULT = 0x2;
|
||||
Runtime.GUI = 0x3;
|
||||
Runtime.ControlKit = 0x4;
|
||||
Runtime.Graphics = 0x5;
|
||||
Runtime.Three = 0x6;
|
||||
Runtime.Physics = 0x7;
|
||||
Runtime.Bullet = 0x8;
|
||||
Runtime.Socket = 0x9;
|
||||
Runtime.Statistics = 0xa;
|
||||
Runtime.Stats = 0xb;
|
||||
Runtime.CONTROL_KIT = 0x4;
|
||||
Runtime.GRAPHICS = 0x5;
|
||||
Runtime.THREE = 0x6;
|
||||
Runtime.PHYSICS = 0x7;
|
||||
Runtime.BULLET = 0x8;
|
||||
Runtime.SOCKET = 0x9;
|
||||
Runtime.STATISTICS = 0xa;
|
||||
Runtime.STATS = 0xb;
|
||||
Runtime.MAX_RUNTIMES = 0xc;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
|
|
|
@ -192,52 +192,52 @@ class SystemInput extends System {
|
|||
//GENERATED_STATIC_START_METHOD_START
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||
SystemInput.Subscriptions['TOUCH_START'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_START'] = Event.Subscribe(
|
||||
Event.TOUCH_START,
|
||||
SystemInput.OnTouchStart
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_END'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_END'] = Event.Subscribe(
|
||||
Event.TOUCH_END,
|
||||
SystemInput.OnTouchEnd
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_MOVE'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_MOVE'] = Event.Subscribe(
|
||||
Event.TOUCH_MOVE,
|
||||
SystemInput.OnTouchMove
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['TOUCH_CANCEL'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['TOUCH_CANCEL'] = Event.Subscribe(
|
||||
Event.TOUCH_CANCEL,
|
||||
SystemInput.OnTouchCancel
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['KEYBOARD_DOWN'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['KEYBOARD_DOWN'] = Event.Subscribe(
|
||||
Event.KEYBOARD_DOWN,
|
||||
SystemInput.OnKeyboardDown
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['KEYBOARD_UP'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['KEYBOARD_UP'] = Event.Subscribe(
|
||||
Event.KEYBOARD_UP,
|
||||
SystemInput.OnKeyboardUp
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_DOWN'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_DOWN'] = Event.Subscribe(
|
||||
Event.MOUSE_DOWN,
|
||||
SystemInput.OnMouseDown
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_UP'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_UP'] = Event.Subscribe(
|
||||
Event.MOUSE_UP,
|
||||
SystemInput.OnMouseUp
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_MOVE'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_MOVE'] = Event.Subscribe(
|
||||
Event.MOUSE_MOVE,
|
||||
SystemInput.OnMouseMove
|
||||
);
|
||||
|
||||
SystemInput.Subscriptions['MOUSE_WHEEL'] = new Event.Subscribe(
|
||||
SystemInput.Subscriptions['MOUSE_WHEEL'] = Event.Subscribe(
|
||||
Event.MOUSE_WHEEL,
|
||||
SystemInput.OnMouseWheel
|
||||
);
|
||||
|
|
|
@ -186,12 +186,12 @@ class SystemLinking extends System {
|
|||
//GENERATED_STATIC_START_METHOD_START
|
||||
|
||||
//GENERATED_STATIC_EVENT_LISTENERS_START_START
|
||||
SystemLinking.Subscriptions['OBJECT_CREATED'] = new Event.Subscribe(
|
||||
SystemLinking.Subscriptions['OBJECT_CREATED'] = Event.Subscribe(
|
||||
Event.OBJECT_CREATED,
|
||||
SystemLinking.OnObjectCreated
|
||||
);
|
||||
|
||||
SystemLinking.Subscriptions['INSTANCE_CREATED'] = new Event.Subscribe(
|
||||
SystemLinking.Subscriptions['INSTANCE_CREATED'] = Event.Subscribe(
|
||||
Event.INSTANCE_CREATED,
|
||||
SystemLinking.OnInstanceCreated
|
||||
);
|
||||
|
|
|
@ -98,9 +98,9 @@ System.Subscriptions = {};
|
|||
//GENERATED_STATIC_OPTIONS_INIT_END
|
||||
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START
|
||||
System.SystemInput = 0x0;
|
||||
System.SystemLinking = 0x1;
|
||||
System.SystemSocket = 0x2;
|
||||
System.SYSTEM_INPUT = 0x0;
|
||||
System.SYSTEM_LINKING = 0x1;
|
||||
System.SYSTEM_SOCKET = 0x2;
|
||||
System.MAX_SYSTEMS = 0x3;
|
||||
//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
this.subscriptions['EVENT_NAME'] = new Event.Subscribe(
|
||||
this.subscriptions['EVENT_NAME'] = Event.Subscribe(
|
||||
FULL_EVENT_NAME,
|
||||
SYSTEM_NAME.CALL_BACK
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SYSTEM_NAME.Subscriptions['EVENT_NAME'] = new Event.Subscribe(
|
||||
SYSTEM_NAME.Subscriptions['EVENT_NAME'] = Event.Subscribe(
|
||||
FULL_EVENT_NAME,
|
||||
SYSTEM_NAME.CALL_BACK
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue