From ecc7b7138003e0b0c18a5f52a6d42ba4145f6325 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Wed, 22 Sep 2021 13:07:05 +0200 Subject: [PATCH] entities become transient systems --- .r3_history | 1 + dist/index.html | 6 + dist/r3.js | 660 +++++++++++++++--- package.json | 2 +- src/r3/r3-component-code.js | 364 ++++++++++ src/r3/r3-component/index.js | 2 + src/r3/r3-component/r3-component-canvas.js | 6 +- src/r3/r3-component/r3-component-d-o-m.js | 6 +- src/r3/r3-component/r3-component-graphics.js | 6 +- src/r3/r3-component/r3-component-image.js | 6 +- src/r3/r3-component/r3-component-input.js | 6 +- src/r3/r3-component/r3-component-material.js | 6 +- src/r3/r3-component/r3-component-mesh.js | 6 +- src/r3/r3-component/r3-component-texture.js | 6 +- src/r3/r3-component/r3-component-touch.js | 6 +- src/r3/r3-component/r3-component.js | 9 +- src/r3/r3-entity/r3-entity-slider.js | 241 ++++++- src/r3/r3-entity/r3-entity.js | 7 +- src/r3/r3-event.js | 166 ++--- src/r3/r3-project.js | 6 +- src/r3/r3-r3.js | 5 +- src/r3/r3-system/r3-system-linking.js | 26 + src/templates/entity_extends.template | 11 + .../generated_event_listeners_start.template | 4 +- src/templates/initialize_after.template | 10 +- src/templates/token.db | 24 +- version | 2 +- 27 files changed, 1392 insertions(+), 208 deletions(-) create mode 100644 src/r3/r3-component-code.js diff --git a/.r3_history b/.r3_history index 960bae4..bd0675a 100644 --- a/.r3_history +++ b/.r3_history @@ -40,3 +40,4 @@ r3 create RuntimeImage runtime_base ./r3-runtime/ r3 create RuntimeWebImage runtime_extends RuntimeImage ./r3-runtime/ r3 create RuntimeNodeJSImage runtime_extends RuntimeImage ./r3-runtime/ r3 create Runtime base ./r3-runtime/ +r3 create ComponentCode component_extends Component diff --git a/dist/index.html b/dist/index.html index ffaf564..5e06083 100644 --- a/dist/index.html +++ b/dist/index.html @@ -30,6 +30,12 @@ window.addEventListener("load", function(){ let canvas = new R3.Canvas(); let image = new R3.Image(); + let slider = new R3.Entity.Slider( + { + canvas : canvas, + images : [image] + } + ); }); diff --git a/dist/r3.js b/dist/r3.js index 8c7b335..26883e8 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.851'; - static compileDate = '2021 Sep 21 - 14:45:57 pm'; + static version = '2.0.869'; + static compileDate = '2021 Sep 22 - 13:06:11 pm'; } class Runtime { @@ -1323,6 +1323,11 @@ class SystemLinking extends System { SystemLinking.OnComponentInitialized ); + SystemLinking.Subscriptions['ENTITY_INITIALIZED'] = Event.Subscribe( + Event.ENTITY_INITIALIZED, + SystemLinking.OnEntityInitialized + ); + SystemLinking.Subscriptions['INSTANCE_CREATED'] = Event.Subscribe( Event.INSTANCE_CREATED, SystemLinking.OnInstanceCreated @@ -1352,6 +1357,9 @@ class SystemLinking extends System { SystemLinking.Subscriptions['COMPONENT_INITIALIZED'].remove(); delete SystemLinking.Subscriptions['COMPONENT_INITIALIZED']; + SystemLinking.Subscriptions['ENTITY_INITIALIZED'].remove(); + delete SystemLinking.Subscriptions['ENTITY_INITIALIZED']; + SystemLinking.Subscriptions['INSTANCE_CREATED'].remove(); delete SystemLinking.Subscriptions['INSTANCE_CREATED']; @@ -1384,12 +1392,19 @@ class SystemLinking extends System { */ static OnComponentInitialized(object) { - //GENERATED_STATIC_ON_COMPONENT_INITIALIZED_METHOD_START - //GENERATED_STATIC_ON_COMPONENT_INITIALIZED_METHOD_END - - //CUSTOM_STATIC_ON_COMPONENT_INITIALIZED_METHOD_START console.log('component initialized'); - //CUSTOM_STATIC_ON_COMPONENT_INITIALIZED_METHOD_END + + } + + /** + * OnEntityInitialized() + * - Listens to events of type Event.ENTITY_INITIALIZED and executes this function. + * @param object (The event data passed as argument - typically an R3Object) + * @return + */ + static OnEntityInitialized(object) { + + console.log('entity initialized'); } @@ -2256,91 +2271,95 @@ class Event { } -Event.BLACKLISTED_COMPONENT_INSTANCE_REQUEST = 0x1; -Event.COMPONENT_CREATED = 0x2; -Event.COMPONENT_INITIALIZED = 0x3; -Event.CREATE_INSTANCE_BEFORE = 0x4; -Event.DISPOSE_INSTANCE = 0x5; -Event.DISPOSE_OBJECT = 0x6; -Event.DOM_COMPONENT_INITIALIZED = 0x7; -Event.ENTITY_CREATED = 0x8; -Event.ENTITY_INITIALIZED = 0x9; -Event.GET_API_URL = 0xa; -Event.GET_RUNTIME = 0xb; -Event.GET_WINDOW_SIZE = 0xc; -Event.GRAPHICS_COMPONENT_INITIALIZED = 0xd; -Event.IMAGE_COMPONENT_INITIALIZED = 0xe; -Event.IMAGE_INSTANCE_CREATED = 0xf; -Event.INPUT_COMPONENT_INITIALIZED = 0x10; -Event.INSTANCE_CREATED = 0x11; -Event.INSTANCE_DISPOSED = 0x12; -Event.KEYBOARD_DOWN = 0x13; -Event.KEYBOARD_UP = 0x14; -Event.MOUSE_DOWN = 0x15; -Event.MOUSE_MOVE = 0x16; -Event.MOUSE_UP = 0x17; -Event.MOUSE_WHEEL = 0x18; -Event.OBJECT_CREATED = 0x19; -Event.OBJECT_INITIALIZED = 0x1a; -Event.PAUSE = 0x1b; -Event.PROJECT_INITIALIZED = 0x1c; -Event.RESTART = 0x1d; -Event.START = 0x1e; -Event.TOUCH_CANCEL = 0x1f; -Event.TOUCH_END = 0x20; -Event.TOUCH_MOVE = 0x21; -Event.TOUCH_START = 0x22; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x23; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x24; -Event.UPDATE_INSTANCE_AFTER = 0x25; -Event.UPDATE_INSTANCE_BEFORE = 0x26; -Event.UPDATE_INSTANCE_PROPERTY = 0x27; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x28; -Event.MAX_EVENTS = 0x29; +Event.BEFORE_RENDER = 0x1; +Event.BLACKLISTED_COMPONENT_INSTANCE_REQUEST = 0x2; +Event.COMPONENT_CREATED = 0x3; +Event.COMPONENT_INITIALIZED = 0x4; +Event.CREATE_INSTANCE_BEFORE = 0x5; +Event.DISPOSE_INSTANCE = 0x6; +Event.DISPOSE_OBJECT = 0x7; +Event.DOM_COMPONENT_INITIALIZED = 0x8; +Event.ENTITY_CREATED = 0x9; +Event.ENTITY_INITIALIZED = 0xa; +Event.GET_API_URL = 0xb; +Event.GET_RUNTIME = 0xc; +Event.GET_WINDOW_SIZE = 0xd; +Event.GRAPHICS_COMPONENT_INITIALIZED = 0xe; +Event.IMAGE_COMPONENT_INITIALIZED = 0xf; +Event.IMAGE_INSTANCE_CREATED = 0x10; +Event.INPUT_COMPONENT_INITIALIZED = 0x11; +Event.INSTANCE_CREATED = 0x12; +Event.INSTANCE_DISPOSED = 0x13; +Event.KEYBOARD_DOWN = 0x14; +Event.KEYBOARD_UP = 0x15; +Event.MOUSE_DOWN = 0x16; +Event.MOUSE_MOVE = 0x17; +Event.MOUSE_UP = 0x18; +Event.MOUSE_WHEEL = 0x19; +Event.OBJECT_CREATED = 0x1a; +Event.OBJECT_INITIALIZED = 0x1b; +Event.PAUSE = 0x1c; +Event.PROJECT_INITIALIZED = 0x1d; +Event.RESTART = 0x1e; +Event.SLIDER_ENTITY_INITIALIZED = 0x1f; +Event.START = 0x20; +Event.TOUCH_CANCEL = 0x21; +Event.TOUCH_END = 0x22; +Event.TOUCH_MOVE = 0x23; +Event.TOUCH_START = 0x24; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x25; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x26; +Event.UPDATE_INSTANCE_AFTER = 0x27; +Event.UPDATE_INSTANCE_BEFORE = 0x28; +Event.UPDATE_INSTANCE_PROPERTY = 0x29; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2a; +Event.MAX_EVENTS = 0x2b; Event.GetEventName = function(eventId) { switch(eventId) { - case 0x1 : return 'blacklisted_component_instance_request'; - case 0x2 : return 'component_created'; - case 0x3 : return 'component_initialized'; - case 0x4 : return 'create_instance_before'; - case 0x5 : return 'dispose_instance'; - case 0x6 : return 'dispose_object'; - case 0x7 : return 'dom_component_initialized'; - case 0x8 : return 'entity_created'; - case 0x9 : return 'entity_initialized'; - case 0xa : return 'get_api_url'; - case 0xb : return 'get_runtime'; - case 0xc : return 'get_window_size'; - case 0xd : return 'graphics_component_initialized'; - case 0xe : return 'image_component_initialized'; - case 0xf : return 'image_instance_created'; - case 0x10 : return 'input_component_initialized'; - case 0x11 : return 'instance_created'; - case 0x12 : return 'instance_disposed'; - case 0x13 : return 'keyboard_down'; - case 0x14 : return 'keyboard_up'; - case 0x15 : return 'mouse_down'; - case 0x16 : return 'mouse_move'; - case 0x17 : return 'mouse_up'; - case 0x18 : return 'mouse_wheel'; - case 0x19 : return 'object_created'; - case 0x1a : return 'object_initialized'; - case 0x1b : return 'pause'; - case 0x1c : return 'project_initialized'; - case 0x1d : return 'restart'; - case 0x1e : return 'start'; - case 0x1f : return 'touch_cancel'; - case 0x20 : return 'touch_end'; - case 0x21 : return 'touch_move'; - case 0x22 : return 'touch_start'; - case 0x23 : return 'update_from_instance_after'; - case 0x24 : return 'update_from_instance_before'; - case 0x25 : return 'update_instance_after'; - case 0x26 : return 'update_instance_before'; - case 0x27 : return 'update_instance_property'; - case 0x28 : return 'update_property_from_instance'; + case 0x1 : return 'before_render'; + case 0x2 : return 'blacklisted_component_instance_request'; + case 0x3 : return 'component_created'; + case 0x4 : return 'component_initialized'; + case 0x5 : return 'create_instance_before'; + case 0x6 : return 'dispose_instance'; + case 0x7 : return 'dispose_object'; + case 0x8 : return 'dom_component_initialized'; + case 0x9 : return 'entity_created'; + case 0xa : return 'entity_initialized'; + case 0xb : return 'get_api_url'; + case 0xc : return 'get_runtime'; + case 0xd : return 'get_window_size'; + case 0xe : return 'graphics_component_initialized'; + case 0xf : return 'image_component_initialized'; + case 0x10 : return 'image_instance_created'; + case 0x11 : return 'input_component_initialized'; + case 0x12 : return 'instance_created'; + case 0x13 : return 'instance_disposed'; + case 0x14 : return 'keyboard_down'; + case 0x15 : return 'keyboard_up'; + case 0x16 : return 'mouse_down'; + case 0x17 : return 'mouse_move'; + case 0x18 : return 'mouse_up'; + case 0x19 : return 'mouse_wheel'; + case 0x1a : return 'object_created'; + case 0x1b : return 'object_initialized'; + case 0x1c : return 'pause'; + case 0x1d : return 'project_initialized'; + case 0x1e : return 'restart'; + case 0x1f : return 'slider_entity_initialized'; + case 0x20 : return 'start'; + case 0x21 : return 'touch_cancel'; + case 0x22 : return 'touch_end'; + case 0x23 : return 'touch_move'; + case 0x24 : return 'touch_start'; + case 0x25 : return 'update_from_instance_after'; + case 0x26 : return 'update_from_instance_before'; + case 0x27 : return 'update_instance_after'; + case 0x28 : return 'update_instance_before'; + case 0x29 : return 'update_instance_property'; + case 0x2a : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } @@ -2567,11 +2586,14 @@ class Entity extends R3Object { this.initialized = true; - Event.Emit(Event.OBJECT_INITIALIZED, this); Event.Emit(Event.ENTITY_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -2666,7 +2688,10 @@ Entity.MAX_ENTITY = 0x1; Properties: - + - canvas (Default value null - The Canvas Component to which this entity binds its custom code + components) + - images (Default value [] - The Image Components which will be used to slide from one image to the + next) Static Properties: @@ -2714,6 +2739,32 @@ class EntitySlider extends Entity { if (typeof options.components === 'undefined') { options.components = []; } + /** + * started - Indicates whether or not this entity is active (subscribing to events) or not + */ + if (typeof options.started === 'undefined') { + options.started = false; + } + /** + * subscriptions - An association object which hold the subscription handles for Events this system is listening + * to. The system can stop receiving events by calling remove() on a handle. + */ + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } + + /** + * canvas - The Canvas Component to which this entity binds its custom code components + */ + if (typeof options.canvas === 'undefined') { + options.canvas = null; + } + /** + * images - The Image Components which will be used to slide from one image to the next + */ + if (typeof options.images === 'undefined') { + options.images = []; + } Object.assign(this, options); @@ -2725,6 +2776,128 @@ class EntitySlider extends Entity { } + /** + * initialize() + * - Notifies all systems listening that this component initialized. + */ + initialize() { + + super.initialize(); + + Event.Emit(Event.SLIDER_ENTITY_INITIALIZED, this); + + if (this.initializeDepth === this.maxDepth) { + + if (this instanceof R3.Component) { + this.createInstance(); + } + + if (this instanceof R3.Entity) { + this.start(); + } + + } else { + this.initializeDepth++; + } + + } + + /** + * start() + * - Starts the entity by subscribing to all events + */ + start() { + + this.subscriptions['BEFORE_RENDER'] = this.subscribe( + Event.BEFORE_RENDER, + this.OnBeforeRender + ); + + this.subscriptions['TOUCH_START'] = this.subscribe( + Event.TOUCH_START, + this.OnTouchStart + ); + + this.subscriptions['TOUCH_MOVE'] = this.subscribe( + Event.TOUCH_MOVE, + this.OnTouchMove + ); + + this.subscriptions['TOUCH_END'] = this.subscribe( + Event.TOUCH_END, + this.OnTouchEnd + ); + + this.started = true; + + console.log('Started transient system: EntitySlider'); + + } + + /** + * stop() + * - Stops this entity by removing all subscriptions to events + */ + stop() { + + this.subscriptions['BEFORE_RENDER'].remove(); + delete this.subscriptions['BEFORE_RENDER']; + + this.subscriptions['TOUCH_START'].remove(); + delete this.subscriptions['TOUCH_START']; + + this.subscriptions['TOUCH_MOVE'].remove(); + delete this.subscriptions['TOUCH_MOVE']; + + this.subscriptions['TOUCH_END'].remove(); + delete this.subscriptions['TOUCH_END']; + + this.started = false; + + console.log('Stopped transient system: EntitySlider'); + + } + + /** + * OnBeforeRender() + * - Listens to events of type Event.BEFORE_RENDER and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnBeforeRender(data) { + + } + + /** + * OnTouchStart() + * - Listens to events of type Event.TOUCH_START and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchStart(data) { + + } + + /** + * OnTouchMove() + * - Listens to events of type Event.TOUCH_MOVE and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchMove(data) { + + } + + /** + * OnTouchEnd() + * - Listens to events of type Event.TOUCH_END and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchEnd(data) { + + } + } /** @@ -2849,7 +3022,11 @@ class Component extends R3Object { Event.Emit(Event.COMPONENT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -2946,7 +3123,8 @@ Component.MESH = 0x5; Component.TEXTURE = 0x6; Component.INPUT = 0x7; Component.TOUCH = 0x8; -Component.MAX_COMPONENT = 0x9; +Component.CODE = 0x9; +Component.MAX_COMPONENT = 0xa; /** @@ -3123,7 +3301,11 @@ class ComponentDOM extends Component { Event.Emit(Event.DOM_COMPONENT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -3430,7 +3612,11 @@ class ComponentCanvas extends ComponentDOM { super.initialize(); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -3748,7 +3934,11 @@ class ComponentGraphics extends Component { Event.Emit(Event.GRAPHICS_COMPONENT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -4105,7 +4295,11 @@ class ComponentImage extends ComponentGraphics { Event.Emit(Event.IMAGE_COMPONENT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -4579,7 +4773,11 @@ class ComponentMaterial extends ComponentGraphics { super.initialize(); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -4827,7 +5025,11 @@ class ComponentMesh extends ComponentGraphics { super.initialize(); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -5075,7 +5277,11 @@ class ComponentTexture extends ComponentGraphics { super.initialize(); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -5307,7 +5513,11 @@ class ComponentInput extends Component { Event.Emit(Event.INPUT_COMPONENT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -5555,7 +5765,245 @@ class ComponentTouch extends ComponentInput { super.initialize(); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + + } else { + this.initializeDepth++; + } + + } + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + if (property === 'maxDepth') { + this.instance.maxDepth = this.maxDepth; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : 'maxDepth', + instanceProperty : 'maxDepth' + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + if (property === 'maxDepth' || property === 'all') { + this.maxDepth = this.instance.maxDepth; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : 'maxDepth', + instanceProperty : 'maxDepth' + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + +} + +/** + + Class R3.Event.Object.Component.Code + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely + identifies it everywhere (client and server side)) + - name (Default value 'Object ' + options.id - Each Object has a name) + - parent (Default value null - All objects could have a parent) + - children (Default value [] - All objects could have some children) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to ComponentCode] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class ComponentCode extends Component { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.maxDepth === 'undefined') { + options.maxDepth = 0; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + options.maxDepth = options.callDepth; + + /** + * initialized - A boolean which indicates whether or not this component has initialized + */ + if (typeof options.initialized === 'undefined') { + options.initialized = false; + } + /** + * instance - Holds the current instance of this object as determined (built) by the runtime object. + */ + if (typeof options.instance === 'undefined') { + options.instance = null; + } + /** + * maxDepth - Indicates the maximum call depth of this component + */ + if (typeof options.maxDepth === 'undefined') { + options.maxDepth = options.callDepth; + } + /** + * initializeDepth - The amount of times this component passed through initialize() functions + */ + if (typeof options.initializeDepth === 'undefined') { + options.initializeDepth = 0; + } + + super(options); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + } + + /** + * initialize() + * - Notifies all systems listening that this component initialized. + */ + initialize() { + + super.initialize(); + + if (this.initializeDepth === this.maxDepth) { + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -5724,7 +6172,11 @@ class Project extends R3Object { Event.Emit(Event.PROJECT_INITIALIZED, this); if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -6993,6 +7445,7 @@ Component.Graphics.Mesh = ComponentMesh; Component.Graphics.Texture = ComponentTexture; Component.Input = ComponentInput; Component.Input.Touch = ComponentTouch; +Component.Code = ComponentCode; Runtime.Coder = RuntimeCoder; Runtime.Coder.CodeMirror = RuntimeCodeMirror; Runtime.DOM = RuntimeDOM; @@ -7024,6 +7477,7 @@ R3.Material = Component.Graphics.Material; R3.Mesh = Component.Graphics.Mesh; R3.Texture = Component.Graphics.Texture; R3.Touch = Component.Input.Touch; +R3.Code = Component.Code; console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate); R3.System.DOM.Start(); diff --git a/package.json b/package.json index 062ebcc..9425edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.851", + "version" : "2.0.869", "description": "", "private": true, "dependencies": { diff --git a/src/r3/r3-component-code.js b/src/r3/r3-component-code.js new file mode 100644 index 0000000..60c12ba --- /dev/null +++ b/src/r3/r3-component-code.js @@ -0,0 +1,364 @@ +const Event = require('./r3-event'); +const Utils = require('./r3-utils'); +const Component = require('./r3-component.js'); + +/** + + GENERATED_INHERITED_START + + Class R3.Event.Object.Component.Code + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(15) - Each Object receives an 15 digit random ID which uniquely + identifies it everywhere (client and server side)) + - name (Default value 'Object ' + options.id - Each Object has a name) + - parent (Default value null - All objects could have a parent) + - children (Default value [] - All objects could have some children) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to ComponentCode] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + GENERATED_INHERITED_END + + TEMPLATE_OPTIONS_START + initialized=false - A boolean which indicates whether or not this component has initialized + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + maxDepth=options.callDepth - Indicates the maximum call depth of this component + initializeDepth=0 - The amount of times this component passed through initialize() functions + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START + CUSTOM_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + CUSTOM_INSTANCE_OPTIONS_MAPPING_START + CUSTOM_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + instance + initializeDepth + initialized + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + initialize() - Notifies all systems listening that this component initialized. + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + CUSTOM_METHODS_START + CUSTOM_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + + **/ + +class ComponentCode extends Component { + + //GENERATED_CONSTRUCTOR_START + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.maxDepth === 'undefined') { + options.maxDepth = 0; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + options.maxDepth = options.callDepth; + + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * initialized - A boolean which indicates whether or not this component has initialized + */ + if (typeof options.initialized === 'undefined') { + options.initialized = false; + } + /** + * instance - Holds the current instance of this object as determined (built) by the runtime object. + */ + if (typeof options.instance === 'undefined') { + options.instance = null; + } + /** + * maxDepth - Indicates the maximum call depth of this component + */ + if (typeof options.maxDepth === 'undefined') { + options.maxDepth = options.callDepth; + } + /** + * initializeDepth - The amount of times this component passed through initialize() functions + */ + if (typeof options.initializeDepth === 'undefined') { + options.initializeDepth = 0; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + super(options); + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + //CUSTOM_OPTIONS_INIT_START + //CUSTOM_OPTIONS_INIT_END + + Object.assign(this, options); + + //CUSTOM_BEFORE_INIT_START + //CUSTOM_BEFORE_INIT_END + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + //CUSTOM_AFTER_INIT_START + //CUSTOM_AFTER_INIT_END + } + //GENERATED_CONSTRUCTOR_END + + //GENERATED_TEMPLATE_METHODS_START + + /** + * initialize() + * - Notifies all systems listening that this component initialized. + */ + initialize() { + + //GENERATED_INITIALIZE_METHOD_START + super.initialize(); + //GENERATED_INITIALIZE_METHOD_END + + //CUSTOM_INITIALIZE_METHOD_START + //CUSTOM_INITIALIZE_METHOD_END + + //GENERATED_INITIALIZE_METHOD_AFTER_START + if (this.initializeDepth === this.maxDepth) { + + if (this instanceof R3.Component) { + this.createInstance(); + } + + } else { + this.initializeDepth++; + } + //GENERATED_INITIALIZE_METHOD_AFTER_END + + } + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'maxDepth') { + this.instance.maxDepth = this.maxDepth; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : 'maxDepth', + instanceProperty : 'maxDepth' + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + //GENERATED_UPDATE_INSTANCE_METHOD_AFTER_START + //GENERATED_UPDATE_INSTANCE_METHOD_AFTER_END + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'maxDepth' || property === 'all') { + this.maxDepth = this.instance.maxDepth; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : 'maxDepth', + instanceProperty : 'maxDepth' + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_START + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_AFTER_END + + } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START + //GENERATED_METHODS_END + + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END +} + +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START +//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END + +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END + +module.exports = ComponentCode; diff --git a/src/r3/r3-component/index.js b/src/r3/r3-component/index.js index 9c6ae34..3375de7 100644 --- a/src/r3/r3-component/index.js +++ b/src/r3/r3-component/index.js @@ -9,6 +9,7 @@ const ComponentMesh = require('./r3-component-mesh.js'); const ComponentTexture = require('./r3-component-texture.js'); const ComponentInput = require('./r3-component-input.js'); const ComponentTouch = require('./r3-component-touch.js'); +const ComponentCode = require('.-code.js'); //GENERATED_IMPORTS_END //GENERATED_INDEX_BODY_START @@ -21,6 +22,7 @@ Component.Graphics.Mesh = ComponentMesh; Component.Graphics.Texture = ComponentTexture; Component.Input = ComponentInput; Component.Input.Touch = ComponentTouch; +Component.Code = ComponentCode; //GENERATED_INDEX_BODY_END //GENERATED_EXPORTS_START diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index af509a5..f922fd8 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -291,7 +291,11 @@ class ComponentCanvas extends ComponentDOM { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-d-o-m.js b/src/r3/r3-component/r3-component-d-o-m.js index 0636384..f4f9d99 100644 --- a/src/r3/r3-component/r3-component-d-o-m.js +++ b/src/r3/r3-component/r3-component-d-o-m.js @@ -249,7 +249,11 @@ class ComponentDOM extends Component { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-graphics.js b/src/r3/r3-component/r3-component-graphics.js index b08e6f8..8b09ef2 100644 --- a/src/r3/r3-component/r3-component-graphics.js +++ b/src/r3/r3-component/r3-component-graphics.js @@ -241,7 +241,11 @@ class ComponentGraphics extends Component { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index 81880ec..67035b6 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -382,7 +382,11 @@ class ComponentImage extends ComponentGraphics { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-input.js b/src/r3/r3-component/r3-component-input.js index d73c789..34cee60 100644 --- a/src/r3/r3-component/r3-component-input.js +++ b/src/r3/r3-component/r3-component-input.js @@ -241,7 +241,11 @@ class ComponentInput extends Component { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 78b2419..d9f5183 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -258,7 +258,11 @@ class ComponentMaterial extends ComponentGraphics { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index c43f2c6..f6f4a2e 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -258,7 +258,11 @@ class ComponentMesh extends ComponentGraphics { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index ee1cc79..9fd9d36 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -258,7 +258,11 @@ class ComponentTexture extends ComponentGraphics { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index b073878..93e94d0 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -258,7 +258,11 @@ class ComponentTouch extends ComponentInput { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index 8d2069f..cedcd8d 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -180,7 +180,11 @@ class Component extends R3Object { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } @@ -331,7 +335,8 @@ Component.MESH = 0x5; Component.TEXTURE = 0x6; Component.INPUT = 0x7; Component.TOUCH = 0x8; -Component.MAX_COMPONENT = 0x9; +Component.CODE = 0x9; +Component.MAX_COMPONENT = 0xa; //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-entity/r3-entity-slider.js b/src/r3/r3-entity/r3-entity-slider.js index 402d8c5..2d49ebf 100644 --- a/src/r3/r3-entity/r3-entity-slider.js +++ b/src/r3/r3-entity/r3-entity-slider.js @@ -87,7 +87,10 @@ const Entity = require('.././r3-entity.js'); Properties: - + - canvas (Default value null - The Canvas Component to which this entity binds its custom code + components) + - images (Default value [] - The Image Components which will be used to slide from one image to the + next) Static Properties: @@ -106,9 +109,13 @@ const Entity = require('.././r3-entity.js'); TEMPLATE_OPTIONS_START parent=null - The parent R3.Object of this component components=[] - A list of components that this entity is composed of + started=false - Indicates whether or not this entity is active (subscribing to events) or not + subscriptions={} - An association object which hold the subscription handles for Events this system is listening to. The system can stop receiving events by calling remove() on a handle. TEMPLATE_OPTIONS_END CUSTOM_OPTIONS_START + canvas=null - The Canvas Component to which this entity binds its custom code components + images=[] - The Image Components which will be used to slide from one image to the next CUSTOM_OPTIONS_END TEMPLATE_STATIC_OPTIONS_START @@ -118,6 +125,9 @@ const Entity = require('.././r3-entity.js'); CUSTOM_STATIC_OPTIONS_END TEMPLATE_METHODS_START + initialize() - Notifies all systems listening that this component initialized. + start() - Starts the entity by subscribing to all events + stop() - Stops this entity by removing all subscriptions to events TEMPLATE_METHODS_END CUSTOM_METHODS_START @@ -129,6 +139,13 @@ const Entity = require('.././r3-entity.js'); CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END + CUSTOM_EVENT_LISTENERS_START + Event.BEFORE_RENDER + Event.TOUCH_START + Event.TOUCH_MOVE + Event.TOUCH_END + CUSTOM_EVENT_LISTENERS_END + **/ class EntitySlider extends Entity { @@ -165,9 +182,34 @@ class EntitySlider extends Entity { if (typeof options.components === 'undefined') { options.components = []; } + /** + * started - Indicates whether or not this entity is active (subscribing to events) or not + */ + if (typeof options.started === 'undefined') { + options.started = false; + } + /** + * subscriptions - An association object which hold the subscription handles for Events this system is listening + * to. The system can stop receiving events by calling remove() on a handle. + */ + if (typeof options.subscriptions === 'undefined') { + options.subscriptions = {}; + } //GENERATED_TEMPLATE_OPTIONS_INIT_END //GENERATED_OPTIONS_INIT_START + /** + * canvas - The Canvas Component to which this entity binds its custom code components + */ + if (typeof options.canvas === 'undefined') { + options.canvas = null; + } + /** + * images - The Image Components which will be used to slide from one image to the next + */ + if (typeof options.images === 'undefined') { + options.images = []; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -190,11 +232,208 @@ class EntitySlider extends Entity { //GENERATED_CONSTRUCTOR_END //GENERATED_TEMPLATE_METHODS_START + + /** + * initialize() + * - Notifies all systems listening that this component initialized. + */ + initialize() { + + //GENERATED_INITIALIZE_METHOD_START + super.initialize(); + //GENERATED_INITIALIZE_METHOD_END + + //CUSTOM_INITIALIZE_METHOD_START + Event.Emit(Event.SLIDER_ENTITY_INITIALIZED, this); + //CUSTOM_INITIALIZE_METHOD_END + + //GENERATED_INITIALIZE_METHOD_AFTER_START + if (this.initializeDepth === this.maxDepth) { + + if (this instanceof R3.Component) { + this.createInstance(); + } + + if (this instanceof R3.Entity) { + this.start(); + } + + } else { + this.initializeDepth++; + } + //GENERATED_INITIALIZE_METHOD_AFTER_END + + } + + /** + * start() + * - Starts the entity by subscribing to all events + */ + start() { + + //GENERATED_START_METHOD_START + + //GENERATED_EVENT_LISTENERS_START_START + this.subscriptions['BEFORE_RENDER'] = this.subscribe( + Event.BEFORE_RENDER, + this.OnBeforeRender + ); + + this.subscriptions['TOUCH_START'] = this.subscribe( + Event.TOUCH_START, + this.OnTouchStart + ); + + this.subscriptions['TOUCH_MOVE'] = this.subscribe( + Event.TOUCH_MOVE, + this.OnTouchMove + ); + + this.subscriptions['TOUCH_END'] = this.subscribe( + Event.TOUCH_END, + this.OnTouchEnd + ); + + //GENERATED_EVENT_LISTENERS_START_END + + //CUSTOM_BEFORE_SYSTEM_START_START + //CUSTOM_BEFORE_SYSTEM_START_END + + this.started = true; + + console.log('Started transient system: EntitySlider'); + //GENERATED_START_METHOD_END + + //CUSTOM_START_METHOD_START + //CUSTOM_START_METHOD_END + + //GENERATED_START_METHOD_AFTER_START + //GENERATED_START_METHOD_AFTER_END + + } + + /** + * stop() + * - Stops this entity by removing all subscriptions to events + */ + stop() { + + //GENERATED_STOP_METHOD_START + + //GENERATED_EVENT_LISTENERS_STOP_START + this.subscriptions['BEFORE_RENDER'].remove(); + delete this.subscriptions['BEFORE_RENDER']; + + this.subscriptions['TOUCH_START'].remove(); + delete this.subscriptions['TOUCH_START']; + + this.subscriptions['TOUCH_MOVE'].remove(); + delete this.subscriptions['TOUCH_MOVE']; + + this.subscriptions['TOUCH_END'].remove(); + delete this.subscriptions['TOUCH_END']; + + //GENERATED_EVENT_LISTENERS_STOP_END + + //CUSTOM_BEFORE_SYSTEM_STOP_START + //CUSTOM_BEFORE_SYSTEM_STOP_END + + this.started = false; + + console.log('Stopped transient system: EntitySlider'); + //GENERATED_STOP_METHOD_END + + //CUSTOM_STOP_METHOD_START + //CUSTOM_STOP_METHOD_END + + //GENERATED_STOP_METHOD_AFTER_START + //GENERATED_STOP_METHOD_AFTER_END + + } //GENERATED_TEMPLATE_METHODS_END //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_EVENT_LISTENER_METHODS_START + + /** + * OnBeforeRender() + * - Listens to events of type Event.BEFORE_RENDER and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnBeforeRender(data) { + + //GENERATED_ON_BEFORE_RENDER_METHOD_START + //GENERATED_ON_BEFORE_RENDER_METHOD_END + + //CUSTOM_ON_BEFORE_RENDER_METHOD_START + //CUSTOM_ON_BEFORE_RENDER_METHOD_END + + //GENERATED_ON_BEFORE_RENDER_METHOD_AFTER_START + //GENERATED_ON_BEFORE_RENDER_METHOD_AFTER_END + + } + + /** + * OnTouchStart() + * - Listens to events of type Event.TOUCH_START and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchStart(data) { + + //GENERATED_ON_TOUCH_START_METHOD_START + //GENERATED_ON_TOUCH_START_METHOD_END + + //CUSTOM_ON_TOUCH_START_METHOD_START + //CUSTOM_ON_TOUCH_START_METHOD_END + + //GENERATED_ON_TOUCH_START_METHOD_AFTER_START + //GENERATED_ON_TOUCH_START_METHOD_AFTER_END + + } + + /** + * OnTouchMove() + * - Listens to events of type Event.TOUCH_MOVE and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchMove(data) { + + //GENERATED_ON_TOUCH_MOVE_METHOD_START + //GENERATED_ON_TOUCH_MOVE_METHOD_END + + //CUSTOM_ON_TOUCH_MOVE_METHOD_START + //CUSTOM_ON_TOUCH_MOVE_METHOD_END + + //GENERATED_ON_TOUCH_MOVE_METHOD_AFTER_START + //GENERATED_ON_TOUCH_MOVE_METHOD_AFTER_END + + } + + /** + * OnTouchEnd() + * - Listens to events of type Event.TOUCH_END and executes this function. + * @param data (The event data passed as argument - typically an R3Object) + * @return null + */ + OnTouchEnd(data) { + + //GENERATED_ON_TOUCH_END_METHOD_START + //GENERATED_ON_TOUCH_END_METHOD_END + + //CUSTOM_ON_TOUCH_END_METHOD_START + //CUSTOM_ON_TOUCH_END_METHOD_END + + //GENERATED_ON_TOUCH_END_METHOD_AFTER_START + //GENERATED_ON_TOUCH_END_METHOD_AFTER_END + + } + //GENERATED_EVENT_LISTENER_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START //GENERATED_TEMPLATE_STATIC_METHODS_END diff --git a/src/r3/r3-entity/r3-entity.js b/src/r3/r3-entity/r3-entity.js index 0c71b0c..daccdf3 100644 --- a/src/r3/r3-entity/r3-entity.js +++ b/src/r3/r3-entity/r3-entity.js @@ -169,13 +169,16 @@ class Entity extends R3Object { //GENERATED_INITIALIZE_METHOD_END //CUSTOM_INITIALIZE_METHOD_START - Event.Emit(Event.OBJECT_INITIALIZED, this); Event.Emit(Event.ENTITY_INITIALIZED, this); //CUSTOM_INITIALIZE_METHOD_END //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index bd4a09b..04d2ac6 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -345,91 +345,95 @@ class Event { //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_EVENTS_START -Event.BLACKLISTED_COMPONENT_INSTANCE_REQUEST = 0x1; -Event.COMPONENT_CREATED = 0x2; -Event.COMPONENT_INITIALIZED = 0x3; -Event.CREATE_INSTANCE_BEFORE = 0x4; -Event.DISPOSE_INSTANCE = 0x5; -Event.DISPOSE_OBJECT = 0x6; -Event.DOM_COMPONENT_INITIALIZED = 0x7; -Event.ENTITY_CREATED = 0x8; -Event.ENTITY_INITIALIZED = 0x9; -Event.GET_API_URL = 0xa; -Event.GET_RUNTIME = 0xb; -Event.GET_WINDOW_SIZE = 0xc; -Event.GRAPHICS_COMPONENT_INITIALIZED = 0xd; -Event.IMAGE_COMPONENT_INITIALIZED = 0xe; -Event.IMAGE_INSTANCE_CREATED = 0xf; -Event.INPUT_COMPONENT_INITIALIZED = 0x10; -Event.INSTANCE_CREATED = 0x11; -Event.INSTANCE_DISPOSED = 0x12; -Event.KEYBOARD_DOWN = 0x13; -Event.KEYBOARD_UP = 0x14; -Event.MOUSE_DOWN = 0x15; -Event.MOUSE_MOVE = 0x16; -Event.MOUSE_UP = 0x17; -Event.MOUSE_WHEEL = 0x18; -Event.OBJECT_CREATED = 0x19; -Event.OBJECT_INITIALIZED = 0x1a; -Event.PAUSE = 0x1b; -Event.PROJECT_INITIALIZED = 0x1c; -Event.RESTART = 0x1d; -Event.START = 0x1e; -Event.TOUCH_CANCEL = 0x1f; -Event.TOUCH_END = 0x20; -Event.TOUCH_MOVE = 0x21; -Event.TOUCH_START = 0x22; -Event.UPDATE_FROM_INSTANCE_AFTER = 0x23; -Event.UPDATE_FROM_INSTANCE_BEFORE = 0x24; -Event.UPDATE_INSTANCE_AFTER = 0x25; -Event.UPDATE_INSTANCE_BEFORE = 0x26; -Event.UPDATE_INSTANCE_PROPERTY = 0x27; -Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x28; -Event.MAX_EVENTS = 0x29; +Event.BEFORE_RENDER = 0x1; +Event.BLACKLISTED_COMPONENT_INSTANCE_REQUEST = 0x2; +Event.COMPONENT_CREATED = 0x3; +Event.COMPONENT_INITIALIZED = 0x4; +Event.CREATE_INSTANCE_BEFORE = 0x5; +Event.DISPOSE_INSTANCE = 0x6; +Event.DISPOSE_OBJECT = 0x7; +Event.DOM_COMPONENT_INITIALIZED = 0x8; +Event.ENTITY_CREATED = 0x9; +Event.ENTITY_INITIALIZED = 0xa; +Event.GET_API_URL = 0xb; +Event.GET_RUNTIME = 0xc; +Event.GET_WINDOW_SIZE = 0xd; +Event.GRAPHICS_COMPONENT_INITIALIZED = 0xe; +Event.IMAGE_COMPONENT_INITIALIZED = 0xf; +Event.IMAGE_INSTANCE_CREATED = 0x10; +Event.INPUT_COMPONENT_INITIALIZED = 0x11; +Event.INSTANCE_CREATED = 0x12; +Event.INSTANCE_DISPOSED = 0x13; +Event.KEYBOARD_DOWN = 0x14; +Event.KEYBOARD_UP = 0x15; +Event.MOUSE_DOWN = 0x16; +Event.MOUSE_MOVE = 0x17; +Event.MOUSE_UP = 0x18; +Event.MOUSE_WHEEL = 0x19; +Event.OBJECT_CREATED = 0x1a; +Event.OBJECT_INITIALIZED = 0x1b; +Event.PAUSE = 0x1c; +Event.PROJECT_INITIALIZED = 0x1d; +Event.RESTART = 0x1e; +Event.SLIDER_ENTITY_INITIALIZED = 0x1f; +Event.START = 0x20; +Event.TOUCH_CANCEL = 0x21; +Event.TOUCH_END = 0x22; +Event.TOUCH_MOVE = 0x23; +Event.TOUCH_START = 0x24; +Event.UPDATE_FROM_INSTANCE_AFTER = 0x25; +Event.UPDATE_FROM_INSTANCE_BEFORE = 0x26; +Event.UPDATE_INSTANCE_AFTER = 0x27; +Event.UPDATE_INSTANCE_BEFORE = 0x28; +Event.UPDATE_INSTANCE_PROPERTY = 0x29; +Event.UPDATE_PROPERTY_FROM_INSTANCE = 0x2a; +Event.MAX_EVENTS = 0x2b; Event.GetEventName = function(eventId) { switch(eventId) { - case 0x1 : return 'blacklisted_component_instance_request'; - case 0x2 : return 'component_created'; - case 0x3 : return 'component_initialized'; - case 0x4 : return 'create_instance_before'; - case 0x5 : return 'dispose_instance'; - case 0x6 : return 'dispose_object'; - case 0x7 : return 'dom_component_initialized'; - case 0x8 : return 'entity_created'; - case 0x9 : return 'entity_initialized'; - case 0xa : return 'get_api_url'; - case 0xb : return 'get_runtime'; - case 0xc : return 'get_window_size'; - case 0xd : return 'graphics_component_initialized'; - case 0xe : return 'image_component_initialized'; - case 0xf : return 'image_instance_created'; - case 0x10 : return 'input_component_initialized'; - case 0x11 : return 'instance_created'; - case 0x12 : return 'instance_disposed'; - case 0x13 : return 'keyboard_down'; - case 0x14 : return 'keyboard_up'; - case 0x15 : return 'mouse_down'; - case 0x16 : return 'mouse_move'; - case 0x17 : return 'mouse_up'; - case 0x18 : return 'mouse_wheel'; - case 0x19 : return 'object_created'; - case 0x1a : return 'object_initialized'; - case 0x1b : return 'pause'; - case 0x1c : return 'project_initialized'; - case 0x1d : return 'restart'; - case 0x1e : return 'start'; - case 0x1f : return 'touch_cancel'; - case 0x20 : return 'touch_end'; - case 0x21 : return 'touch_move'; - case 0x22 : return 'touch_start'; - case 0x23 : return 'update_from_instance_after'; - case 0x24 : return 'update_from_instance_before'; - case 0x25 : return 'update_instance_after'; - case 0x26 : return 'update_instance_before'; - case 0x27 : return 'update_instance_property'; - case 0x28 : return 'update_property_from_instance'; + case 0x1 : return 'before_render'; + case 0x2 : return 'blacklisted_component_instance_request'; + case 0x3 : return 'component_created'; + case 0x4 : return 'component_initialized'; + case 0x5 : return 'create_instance_before'; + case 0x6 : return 'dispose_instance'; + case 0x7 : return 'dispose_object'; + case 0x8 : return 'dom_component_initialized'; + case 0x9 : return 'entity_created'; + case 0xa : return 'entity_initialized'; + case 0xb : return 'get_api_url'; + case 0xc : return 'get_runtime'; + case 0xd : return 'get_window_size'; + case 0xe : return 'graphics_component_initialized'; + case 0xf : return 'image_component_initialized'; + case 0x10 : return 'image_instance_created'; + case 0x11 : return 'input_component_initialized'; + case 0x12 : return 'instance_created'; + case 0x13 : return 'instance_disposed'; + case 0x14 : return 'keyboard_down'; + case 0x15 : return 'keyboard_up'; + case 0x16 : return 'mouse_down'; + case 0x17 : return 'mouse_move'; + case 0x18 : return 'mouse_up'; + case 0x19 : return 'mouse_wheel'; + case 0x1a : return 'object_created'; + case 0x1b : return 'object_initialized'; + case 0x1c : return 'pause'; + case 0x1d : return 'project_initialized'; + case 0x1e : return 'restart'; + case 0x1f : return 'slider_entity_initialized'; + case 0x20 : return 'start'; + case 0x21 : return 'touch_cancel'; + case 0x22 : return 'touch_end'; + case 0x23 : return 'touch_move'; + case 0x24 : return 'touch_start'; + case 0x25 : return 'update_from_instance_after'; + case 0x26 : return 'update_from_instance_before'; + case 0x27 : return 'update_instance_after'; + case 0x28 : return 'update_instance_before'; + case 0x29 : return 'update_instance_property'; + case 0x2a : return 'update_property_from_instance'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/src/r3/r3-project.js b/src/r3/r3-project.js index 32e34c6..95e0231 100644 --- a/src/r3/r3-project.js +++ b/src/r3/r3-project.js @@ -161,7 +161,11 @@ class Project extends R3Object { //GENERATED_INITIALIZE_METHOD_AFTER_START if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + } else { this.initializeDepth++; } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index de7e45a..1bce48e 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.851'; - static compileDate = '2021 Sep 21 - 14:45:57 pm'; + static version = '2.0.869'; + static compileDate = '2021 Sep 22 - 13:06:11 pm'; } //GENERATED_IMPORTS_START @@ -29,6 +29,7 @@ R3.Material = Component.Graphics.Material; R3.Mesh = Component.Graphics.Mesh; R3.Texture = Component.Graphics.Texture; R3.Touch = Component.Input.Touch; +R3.Code = Component.Code; //GENERATED_DEFINES_END //CUSTOM_CONVENIENT_DEFINES_START diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index b11e050..eec1a3e 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -67,6 +67,7 @@ const System = require('.././r3-system.js'); CUSTOM_STATIC_EVENT_LISTENERS_START Event.OBJECT_CREATED Event.COMPONENT_INITIALIZED + Event.ENTITY_INITIALIZED Event.INSTANCE_CREATED Event.CREATE_INSTANCE_BEFORE - @returns boolean delayInstance which indicates whether or not instance creation is delayed (handled) by another system. (i.e. where instance creation order is of importance) CUSTOM_STATIC_EVENT_LISTENERS_END @@ -142,6 +143,11 @@ class SystemLinking extends System { SystemLinking.OnComponentInitialized ); + SystemLinking.Subscriptions['ENTITY_INITIALIZED'] = Event.Subscribe( + Event.ENTITY_INITIALIZED, + SystemLinking.OnEntityInitialized + ); + SystemLinking.Subscriptions['INSTANCE_CREATED'] = Event.Subscribe( Event.INSTANCE_CREATED, SystemLinking.OnInstanceCreated @@ -184,6 +190,9 @@ class SystemLinking extends System { SystemLinking.Subscriptions['COMPONENT_INITIALIZED'].remove(); delete SystemLinking.Subscriptions['COMPONENT_INITIALIZED']; + SystemLinking.Subscriptions['ENTITY_INITIALIZED'].remove(); + delete SystemLinking.Subscriptions['ENTITY_INITIALIZED']; + SystemLinking.Subscriptions['INSTANCE_CREATED'].remove(); delete SystemLinking.Subscriptions['INSTANCE_CREATED']; @@ -249,6 +258,23 @@ class SystemLinking extends System { } + /** + * OnEntityInitialized() + * - Listens to events of type Event.ENTITY_INITIALIZED and executes this function. + * @param object (The event data passed as argument - typically an R3Object) + * @return + */ + static OnEntityInitialized(object) { + + //GENERATED_STATIC_ON_ENTITY_INITIALIZED_METHOD_START + //GENERATED_STATIC_ON_ENTITY_INITIALIZED_METHOD_END + + //CUSTOM_STATIC_ON_ENTITY_INITIALIZED_METHOD_START + console.log('entity initialized'); + //CUSTOM_STATIC_ON_ENTITY_INITIALIZED_METHOD_END + + } + /** * OnInstanceCreated() * - Listens to events of type Event.INSTANCE_CREATED and executes this function. diff --git a/src/templates/entity_extends.template b/src/templates/entity_extends.template index de339d8..bf77d1a 100644 --- a/src/templates/entity_extends.template +++ b/src/templates/entity_extends.template @@ -11,6 +11,8 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); TEMPLATE_OPTIONS_START parent=null - The parent R3.Object of this component components=[] - A list of components that this entity is composed of + started=false - Indicates whether or not this entity is active (subscribing to events) or not + subscriptions={} - An association object which hold the subscription handles for Events this system is listening to. The system can stop receiving events by calling remove() on a handle. TEMPLATE_OPTIONS_END CUSTOM_OPTIONS_START @@ -23,6 +25,9 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); CUSTOM_STATIC_OPTIONS_END TEMPLATE_METHODS_START + initialize() - Notifies all systems listening that this component initialized. + start() - Starts the entity by subscribing to all events + stop() - Stops this entity by removing all subscriptions to events TEMPLATE_METHODS_END CUSTOM_METHODS_START @@ -34,6 +39,9 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END + CUSTOM_EVENT_LISTENERS_START + CUSTOM_EVENT_LISTENERS_END + **/ class CLASS_NAME extends EXTEND_CLASS { @@ -47,6 +55,9 @@ class CLASS_NAME extends EXTEND_CLASS { //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_EVENT_LISTENER_METHODS_START + //GENERATED_EVENT_LISTENER_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START //GENERATED_TEMPLATE_STATIC_METHODS_END diff --git a/src/templates/generated_event_listeners_start.template b/src/templates/generated_event_listeners_start.template index aafe785..a293537 100644 --- a/src/templates/generated_event_listeners_start.template +++ b/src/templates/generated_event_listeners_start.template @@ -1,5 +1,5 @@ - this.subscriptions['EVENT_NAME'] = Event.Subscribe( + this.subscriptions['EVENT_NAME'] = this.subscribe( FULL_EVENT_NAME, - SYSTEM_NAME.CALL_BACK + this.CALL_BACK ); diff --git a/src/templates/initialize_after.template b/src/templates/initialize_after.template index 63286df..4b89970 100644 --- a/src/templates/initialize_after.template +++ b/src/templates/initialize_after.template @@ -1,5 +1,13 @@ if (this.initializeDepth === this.maxDepth) { - this.createInstance(); + + if (this instanceof R3.Component) { + this.createInstance(); + } + + if (this instanceof R3.Entity) { + this.start(); + } + } else { this.initializeDepth++; } \ No newline at end of file diff --git a/src/templates/token.db b/src/templates/token.db index 4311c11..99c122e 100644 --- a/src/templates/token.db +++ b/src/templates/token.db @@ -25,10 +25,20 @@ GENERATED_INITIALIZE_METHOD_AFTER GENERATED_METHOD_NAME_UPPERCASE_METHOD GENERATED_METHOD_NAME_UPPERCASE_METHOD_AFTER GENERATED_METHODS +GENERATED_ON_BEFORE_RENDER_METHOD +GENERATED_ON_BEFORE_RENDER_METHOD_AFTER +GENERATED_ON_TOUCH_END_METHOD +GENERATED_ON_TOUCH_END_METHOD_AFTER +GENERATED_ON_TOUCH_MOVE_METHOD +GENERATED_ON_TOUCH_MOVE_METHOD_AFTER +GENERATED_ON_TOUCH_START_METHOD +GENERATED_ON_TOUCH_START_METHOD_AFTER GENERATED_OPTIONS_INIT GENERATED_OUT_OF_CLASS_IMPLEMENTATION GENERATED_SET_RUNTIME_METHOD GENERATED_SET_RUNTIME_METHOD_AFTER +GENERATED_START_METHOD +GENERATED_START_METHOD_AFTER GENERATED_STATIC_ASYNC_METHOD GENERATED_STATIC_EMIT_METHOD GENERATED_STATIC_EVENT_LISTENER_METHODS @@ -36,8 +46,10 @@ GENERATED_STATIC_EVENT_LISTENERS_START GENERATED_STATIC_EVENT_LISTENERS_STOP GENERATED_STATIC_METHOD_NAME_UPPERCASE_METHOD GENERATED_STATIC_METHODS +GENERATED_STATIC_ON_COMPONENT_INITIALIZED_METHOD GENERATED_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD GENERATED_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD +GENERATED_STATIC_ON_ENTITY_INITIALIZED_METHOD GENERATED_STATIC_ON_GET_API_URL_METHOD GENERATED_STATIC_ON_GET_RUNTIME_METHOD GENERATED_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD @@ -49,7 +61,6 @@ GENERATED_STATIC_ON_MOUSE_MOVE_METHOD GENERATED_STATIC_ON_MOUSE_UP_METHOD GENERATED_STATIC_ON_MOUSE_WHEEL_METHOD GENERATED_STATIC_ON_OBJECT_CREATED_METHOD -GENERATED_STATIC_ON_OBJECT_INITIALIZED_METHOD GENERATED_STATIC_ON_PROJECT_INITIALIZED_METHOD GENERATED_STATIC_ON_TOUCH_CANCEL_METHOD GENERATED_STATIC_ON_TOUCH_END_METHOD @@ -59,6 +70,8 @@ GENERATED_STATIC_OPTIONS_INIT GENERATED_STATIC_START_METHOD GENERATED_STATIC_STOP_METHOD GENERATED_STATIC_SUBSCRIBE_METHOD +GENERATED_STOP_METHOD +GENERATED_STOP_METHOD_AFTER GENERATED_SUBSCRIBE_METHOD GENERATED_SUBSCRIBE_METHOD_AFTER GENERATED_TEMPLATE_METHODS @@ -93,17 +106,24 @@ CUSTOM_INITIALIZE_METHOD CUSTOM_INSTANCE_OPTIONS_MAPPING CUSTOM_METHOD_NAME_UPPERCASE_METHOD CUSTOM_METHODS +CUSTOM_ON_BEFORE_RENDER_METHOD +CUSTOM_ON_TOUCH_END_METHOD +CUSTOM_ON_TOUCH_MOVE_METHOD +CUSTOM_ON_TOUCH_START_METHOD CUSTOM_OPTIONS CUSTOM_OPTIONS_INIT CUSTOM_OUT_OF_CLASS_IMPLEMENTATION CUSTOM_SET_RUNTIME_METHOD +CUSTOM_START_METHOD CUSTOM_STATIC_ASYNC_METHOD CUSTOM_STATIC_EMIT_METHOD CUSTOM_STATIC_EVENT_LISTENERS CUSTOM_STATIC_METHOD_NAME_UPPERCASE_METHOD CUSTOM_STATIC_METHODS +CUSTOM_STATIC_ON_COMPONENT_INITIALIZED_METHOD CUSTOM_STATIC_ON_CREATE_INSTANCE_BEFORE_METHOD CUSTOM_STATIC_ON_DOM_COMPONENT_INITIALIZED_METHOD +CUSTOM_STATIC_ON_ENTITY_INITIALIZED_METHOD CUSTOM_STATIC_ON_GET_API_URL_METHOD CUSTOM_STATIC_ON_GET_RUNTIME_METHOD CUSTOM_STATIC_ON_IMAGE_INSTANCE_CREATED_METHOD @@ -115,7 +135,6 @@ CUSTOM_STATIC_ON_MOUSE_MOVE_METHOD CUSTOM_STATIC_ON_MOUSE_UP_METHOD CUSTOM_STATIC_ON_MOUSE_WHEEL_METHOD CUSTOM_STATIC_ON_OBJECT_CREATED_METHOD -CUSTOM_STATIC_ON_OBJECT_INITIALIZED_METHOD CUSTOM_STATIC_ON_PROJECT_INITIALIZED_METHOD CUSTOM_STATIC_ON_TOUCH_CANCEL_METHOD CUSTOM_STATIC_ON_TOUCH_END_METHOD @@ -125,6 +144,7 @@ CUSTOM_STATIC_OPTIONS CUSTOM_STATIC_START_METHOD CUSTOM_STATIC_STOP_METHOD CUSTOM_STATIC_SUBSCRIBE_METHOD +CUSTOM_STOP_METHOD CUSTOM_SUBSCRIBE_METHOD CUSTOM_UPDATE_FROM_INSTANCE_METHOD CUSTOM_UPDATE_INSTANCE_METHOD diff --git a/version b/version index 2c0e912..2f9c566 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.851 \ No newline at end of file +2.0.869 \ No newline at end of file