diff --git a/dist/r3.js b/dist/r3.js index 624c921..6672f8c 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -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(); diff --git a/package.json b/package.json index 68c5556..cca1c5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.205", + "version" : "2.0.206", "description": "", "private": true, "dependencies": { diff --git a/r3.php b/r3.php index 2597ed1..fde031d 100755 --- a/r3.php +++ b/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++; } diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index 09bf872..db02e9e 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -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 diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index ef497b5..7c95adc 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -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 diff --git a/src/r3/r3-runtime/r3-runtime.js b/src/r3/r3-runtime/r3-runtime.js index fbf6e57..cc255c9 100644 --- a/src/r3/r3-runtime/r3-runtime.js +++ b/src/r3/r3-runtime/r3-runtime.js @@ -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 diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index 2cc5b3d..4f37bfa 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -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 ); diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index 72668bc..f5d5b06 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -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 ); diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index 9b7d382..df4063f 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -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 diff --git a/src/templates/generated_event_listeners_start.template b/src/templates/generated_event_listeners_start.template index b193e84..aafe785 100644 --- a/src/templates/generated_event_listeners_start.template +++ b/src/templates/generated_event_listeners_start.template @@ -1,4 +1,4 @@ - this.subscriptions['EVENT_NAME'] = new Event.Subscribe( + this.subscriptions['EVENT_NAME'] = Event.Subscribe( FULL_EVENT_NAME, SYSTEM_NAME.CALL_BACK ); diff --git a/src/templates/generated_static_event_listeners_start.template b/src/templates/generated_static_event_listeners_start.template index 25b05ed..c786000 100644 --- a/src/templates/generated_static_event_listeners_start.template +++ b/src/templates/generated_static_event_listeners_start.template @@ -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 ); diff --git a/version b/version index a91d456..ab9e439 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.205 \ No newline at end of file +2.0.206 \ No newline at end of file