Browse Source

Issue #497

Changed UIText field referencing in the project to fire on click instead of current OnFocusChangedEvent.
JohnnyWahib 9 years ago
parent
commit
42458829ef

+ 2 - 2
Script/AtomicEditor/ui/frames/inspector/AttributeInfoEdit.ts

@@ -702,9 +702,9 @@ class ResourceRefAttributeEdit extends AttributeInfoEdit {
                 }
                 this.editField.text = text;
 
-                this.editField.subscribeToEvent(this.editField, "UIWidgetFocusChanged", (ev: Atomic.UIWidgetFocusChangedEvent) => {
+                this.editField.subscribeToEvent(this.editField, "WidgetEvent", (ev: Atomic.UIWidgetEvent) => {
 
-                    if (ev.widget == this.editField && this.editField.focus) {
+                    if (ev.type == Atomic.UI_EVENT_TYPE_POINTER_DOWN) {
 
                         resource = <Atomic.Resource>object.getAttribute(this.attrInfo.name);
 

+ 2 - 2
Script/AtomicEditor/ui/frames/inspector/ComponentAttributeUI.ts

@@ -220,9 +220,9 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
 
         });
 
-        o.editField.subscribeToEvent(o.editField, "UIWidgetFocusChanged", (ev: Atomic.UIWidgetFocusChangedEvent) => {
+        o.editField.subscribeToEvent(o.editField, "WidgetEvent", (ev: Atomic.UIWidgetEvent) => {
 
-            if (ev.widget == o.editField && o.editField.focus && o.editField.text != "") {
+            if (ev.type == Atomic.UI_EVENT_TYPE_POINTER_DOWN) {
 
                 var pathName = materialEdit.pathReference;
                 this.sendEvent(EditorEvents.InspectorProjectReference, { "path": pathName });