|
|
@@ -18,7 +18,7 @@ export class ResourceDelete extends ModalWindow {
|
|
|
|
|
|
this.asset = asset;
|
|
|
this.init("Delete Resource", "AtomicEditor/editor/ui/resourcedelete.tb.txt");
|
|
|
- var message = <Atomic.UIEditField> this.getWidget("message");
|
|
|
+ var message = <Atomic.UIEditField>this.getWidget("message");
|
|
|
|
|
|
var text = "Are you sure you want to delete resource:\n\n";
|
|
|
text += asset.path;
|
|
|
@@ -70,7 +70,7 @@ export class CreateFolder extends ModalWindow {
|
|
|
|
|
|
this.resourcePath = resourcePath;
|
|
|
this.init("New Folder", "AtomicEditor/editor/ui/resourcenewfolder.tb.txt");
|
|
|
- this.nameField = <Atomic.UIEditField> this.getWidget("folder_name");
|
|
|
+ this.nameField = <Atomic.UIEditField>this.getWidget("folder_name");
|
|
|
}
|
|
|
|
|
|
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
@@ -117,7 +117,7 @@ export class CreateComponent extends ModalWindow {
|
|
|
|
|
|
this.resourcePath = resourcePath;
|
|
|
this.init("New Component", "AtomicEditor/editor/ui/resourcecreatecomponent.tb.txt");
|
|
|
- this.nameField = <Atomic.UIEditField> this.getWidget("component_name");
|
|
|
+ this.nameField = <Atomic.UIEditField>this.getWidget("component_name");
|
|
|
}
|
|
|
|
|
|
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
@@ -138,7 +138,7 @@ export class CreateComponent extends ModalWindow {
|
|
|
|
|
|
this.hide();
|
|
|
|
|
|
- this.sendEvent(EditorEvents.EditResource, { path:outputFile});
|
|
|
+ this.sendEvent(EditorEvents.EditResource, { path: outputFile });
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -170,7 +170,7 @@ export class CreateScript extends ModalWindow {
|
|
|
|
|
|
this.resourcePath = resourcePath;
|
|
|
this.init("New Script", "AtomicEditor/editor/ui/resourcecreatecomponent.tb.txt");
|
|
|
- this.nameField = <Atomic.UIEditField> this.getWidget("component_name");
|
|
|
+ this.nameField = <Atomic.UIEditField>this.getWidget("component_name");
|
|
|
}
|
|
|
|
|
|
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
@@ -191,7 +191,7 @@ export class CreateScript extends ModalWindow {
|
|
|
|
|
|
this.hide();
|
|
|
|
|
|
- this.sendEvent(EditorEvents.EditResource, { path:outputFile});
|
|
|
+ this.sendEvent(EditorEvents.EditResource, { path: outputFile });
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -223,7 +223,7 @@ export class CreateScene extends ModalWindow {
|
|
|
|
|
|
this.resourcePath = resourcePath;
|
|
|
this.init("New Scene", "AtomicEditor/editor/ui/resourcecreatecomponent.tb.txt");
|
|
|
- this.nameField = <Atomic.UIEditField> this.getWidget("component_name");
|
|
|
+ this.nameField = <Atomic.UIEditField>this.getWidget("component_name");
|
|
|
}
|
|
|
|
|
|
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
@@ -243,7 +243,7 @@ export class CreateScene extends ModalWindow {
|
|
|
|
|
|
this.hide();
|
|
|
|
|
|
- this.sendEvent(EditorEvents.EditResource, { path:outputFile});
|
|
|
+ this.sendEvent(EditorEvents.EditResource, { path: outputFile });
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -275,7 +275,7 @@ export class CreateMaterial extends ModalWindow {
|
|
|
|
|
|
this.resourcePath = resourcePath;
|
|
|
this.init("New Material", "AtomicEditor/editor/ui/resourcecreatecomponent.tb.txt");
|
|
|
- this.nameField = <Atomic.UIEditField> this.getWidget("component_name");
|
|
|
+ this.nameField = <Atomic.UIEditField>this.getWidget("component_name");
|
|
|
}
|
|
|
|
|
|
handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
@@ -295,7 +295,7 @@ export class CreateMaterial extends ModalWindow {
|
|
|
|
|
|
this.hide();
|
|
|
|
|
|
- this.sendEvent(EditorEvents.EditResource, { path:outputFile});
|
|
|
+ this.sendEvent(EditorEvents.EditResource, { path: outputFile });
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -318,3 +318,55 @@ export class CreateMaterial extends ModalWindow {
|
|
|
nameField: Atomic.UIEditField;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+export class RenameAsset extends ModalWindow {
|
|
|
+
|
|
|
+ constructor(asset: ToolCore.Asset) {
|
|
|
+
|
|
|
+ super();
|
|
|
+
|
|
|
+ this.asset = asset;
|
|
|
+ this.init("Rename Resource", "AtomicEditor/editor/ui/renameasset.tb.txt");
|
|
|
+
|
|
|
+ var currentName = <Atomic.UITextField>this.getWidget("current_name");
|
|
|
+ this.nameEdit = <Atomic.UIEditField>this.getWidget("new_name");
|
|
|
+
|
|
|
+ currentName.text = asset.name;
|
|
|
+ this.nameEdit.text = asset.name;
|
|
|
+
|
|
|
+ this.resizeToFitContent();
|
|
|
+ this.center();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
|
|
|
+
|
|
|
+ if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
|
|
|
+
|
|
|
+ var id = ev.target.id;
|
|
|
+
|
|
|
+ if (id == "rename") {
|
|
|
+
|
|
|
+ this.hide();
|
|
|
+
|
|
|
+ if (this.asset.name != this.nameEdit.text)
|
|
|
+ this.asset.rename(this.nameEdit.text);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == "cancel") {
|
|
|
+
|
|
|
+ this.hide();
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ nameEdit: Atomic.UIEditField;
|
|
|
+ asset: ToolCore.Asset;
|
|
|
+
|
|
|
+}
|