|
@@ -22,19 +22,42 @@
|
|
|
|
|
|
|
|
// TODO: migrate these interfaces out to the d.ts and migrate the static strings to some common location
|
|
// TODO: migrate these interfaces out to the d.ts and migrate the static strings to some common location
|
|
|
export const ModalError = "ModalError";
|
|
export const ModalError = "ModalError";
|
|
|
-export interface ModalErrorEvent {
|
|
|
|
|
|
|
+export function ModalErrorEvent(callback: Atomic.EventCallback<ModalErrorEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(ModalError, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface ModalErrorEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
title: string;
|
|
title: string;
|
|
|
message: string;
|
|
message: string;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
export const PlayerStartRequest = "EditorPlayRequest";
|
|
export const PlayerStartRequest = "EditorPlayRequest";
|
|
|
|
|
+export function PlayerStartRequestEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerStartRequest, callback);
|
|
|
|
|
+}
|
|
|
export const PlayerStarted = "EditorPlayerStarted";
|
|
export const PlayerStarted = "EditorPlayerStarted";
|
|
|
|
|
+export function PlayerStartedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerStarted, callback);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export const PlayerStopped = "EditorPlayerStopped";
|
|
export const PlayerStopped = "EditorPlayerStopped";
|
|
|
|
|
+export function PlayerStoppedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerStopped, callback);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export const PlayerPaused = "EditorPlayerPaused";
|
|
export const PlayerPaused = "EditorPlayerPaused";
|
|
|
|
|
+export function PlayerPausedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerPaused, callback);
|
|
|
|
|
+}
|
|
|
export const PlayerResumed = "EditorPlayerResumed";
|
|
export const PlayerResumed = "EditorPlayerResumed";
|
|
|
|
|
+export function PlayerResumedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerPaused, callback);
|
|
|
|
|
+}
|
|
|
export const PlayerLog = "EditorPlayerLog";
|
|
export const PlayerLog = "EditorPlayerLog";
|
|
|
-export interface PlayerLogEvent {
|
|
|
|
|
|
|
+export function PlayerLogEvent(callback: Atomic.EventCallback<PlayerLogEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(PlayerLog, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface PlayerLogEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
message: string;
|
|
message: string;
|
|
|
level: number;
|
|
level: number;
|
|
@@ -43,7 +66,10 @@ export interface PlayerLogEvent {
|
|
|
|
|
|
|
|
|
|
|
|
|
export const ActiveSceneEditorChange = "EditorActiveSceneEditorChange";
|
|
export const ActiveSceneEditorChange = "EditorActiveSceneEditorChange";
|
|
|
-export interface ActiveSceneEditorChangeEvent {
|
|
|
|
|
|
|
+export function ActiveSceneEditorChangeEvent(callback: Atomic.EventCallback<ActiveSceneEditorChangeEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(ActiveSceneEditorChange, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface ActiveSceneEditorChangeEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
sceneEditor: Editor.SceneEditor3D;
|
|
sceneEditor: Editor.SceneEditor3D;
|
|
|
|
|
|
|
@@ -51,34 +77,63 @@ export interface ActiveSceneEditorChangeEvent {
|
|
|
|
|
|
|
|
|
|
|
|
|
export const SceneClosed = "EditorSceneClosed";
|
|
export const SceneClosed = "EditorSceneClosed";
|
|
|
-export interface SceneClosedEvent {
|
|
|
|
|
|
|
+export function SceneClosedEvent(callback: Atomic.EventCallback<SceneClosedEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(SceneClosed, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface SceneClosedEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
scene: Atomic.Scene;
|
|
scene: Atomic.Scene;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const ContentFolderChanged = "ContentFolderChanged";
|
|
export const ContentFolderChanged = "ContentFolderChanged";
|
|
|
-export interface ContentFolderChangedEvent {
|
|
|
|
|
|
|
+export function ContentFolderChangedEvent(callback: Atomic.EventCallback<ContentFolderChangedEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(ContentFolderChanged, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface ContentFolderChangedEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
path: string;
|
|
path: string;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const CloseProject = "EditorCloseProject";
|
|
export const CloseProject = "EditorCloseProject";
|
|
|
|
|
+export function CloseProjectEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(CloseProject, callback);
|
|
|
|
|
+}
|
|
|
export const ProjectClosed = "EditorProjectClosed";
|
|
export const ProjectClosed = "EditorProjectClosed";
|
|
|
|
|
+export function ProjectClosedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(ProjectClosed, callback);
|
|
|
|
|
+}
|
|
|
export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
|
|
export const ProjectUnloadedNotification = "ProjectUnloadedNotification";
|
|
|
|
|
+export function ProjectUnloadedNotificationEvent(callback: Atomic.EventCallback<null>){
|
|
|
|
|
+ return Atomic.ScriptEvent(ProjectUnloadedNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
export const RequestProjectLoad = "RequestProjectLoad";
|
|
export const RequestProjectLoad = "RequestProjectLoad";
|
|
|
-export interface RequestProjectLoadEvent {
|
|
|
|
|
|
|
+export function RequestProjectLoadEvent(callback: Atomic.EventCallback<RequestProjectLoadEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(RequestProjectLoad, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface RequestProjectLoadEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the .atomic file
|
|
// The full path to the .atomic file
|
|
|
path: string;
|
|
path: string;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+export const ProjectLoaded = "ProjectLoaded";
|
|
|
|
|
+export function ProjectLoadedEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(ProjectLoaded, callback);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export const LoadProject = "EditorLoadProject";
|
|
export const LoadProject = "EditorLoadProject";
|
|
|
|
|
+export function LoadProjectEvent(callback: Atomic.EventCallback<LoadProjectEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(LoadProject, callback);
|
|
|
|
|
+}
|
|
|
export const LoadProjectNotification = "EditorLoadProjectNotification";
|
|
export const LoadProjectNotification = "EditorLoadProjectNotification";
|
|
|
-export interface LoadProjectEvent {
|
|
|
|
|
|
|
+export function LoadProjectNotificationEvent(callback: Atomic.EventCallback<LoadProjectEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(LoadProjectNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface LoadProjectEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the .atomic file
|
|
// The full path to the .atomic file
|
|
|
path: string;
|
|
path: string;
|
|
@@ -86,22 +141,39 @@ export interface LoadProjectEvent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const SaveAllResources = "EditorSaveAllResources";
|
|
export const SaveAllResources = "EditorSaveAllResources";
|
|
|
|
|
+export function SaveAllResourcesEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(SaveAllResources, callback);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
export const SaveResource = "EditorSaveResource";
|
|
export const SaveResource = "EditorSaveResource";
|
|
|
|
|
+export function SaveResourceEvent(callback: Atomic.EventCallback<SaveResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(SaveResource, callback);
|
|
|
|
|
+}
|
|
|
/**
|
|
/**
|
|
|
* Called once the resource has been saved
|
|
* Called once the resource has been saved
|
|
|
* @type {String}
|
|
* @type {String}
|
|
|
*/
|
|
*/
|
|
|
export const SaveResourceNotification = "EditorSaveResourceNotification";
|
|
export const SaveResourceNotification = "EditorSaveResourceNotification";
|
|
|
-export interface SaveResourceEvent {
|
|
|
|
|
|
|
+export function SaveResourceNotificationEvent(callback: Atomic.EventCallback<SaveResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(SaveResourceNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface SaveResourceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the resource to save / empty or undefined for current
|
|
// The full path to the resource to save / empty or undefined for current
|
|
|
path: string;
|
|
path: string;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+export const EditorResourceCloseCanceled = "EditorResourceCloseCanceled";
|
|
|
|
|
+export function EditorResourceCloseCanceledEvent(callback: Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(EditorResourceCloseCanceled, callback);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export const EditorResourceClose = "EditorResourceClose";
|
|
export const EditorResourceClose = "EditorResourceClose";
|
|
|
-export interface EditorCloseResourceEvent {
|
|
|
|
|
|
|
+export function EditorResourceCloseEvent(callback: Atomic.EventCallback<EditorCloseResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(EditorResourceClose, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface EditorCloseResourceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
editor:Editor.ResourceEditor;
|
|
editor:Editor.ResourceEditor;
|
|
|
navigateToAvailableResource:boolean;
|
|
navigateToAvailableResource:boolean;
|
|
@@ -109,7 +181,10 @@ export interface EditorCloseResourceEvent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const EditResource = "EditorEditResource";
|
|
export const EditResource = "EditorEditResource";
|
|
|
-export interface EditResourceEvent {
|
|
|
|
|
|
|
+export function EditResourceEvent(callback: Atomic.EventCallback<EditResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(EditResource, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface EditResourceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the resource to edit
|
|
// The full path to the resource to edit
|
|
|
path: string;
|
|
path: string;
|
|
@@ -122,7 +197,10 @@ export const DeleteResource = "EditorDeleteResource";
|
|
|
* @type {String}
|
|
* @type {String}
|
|
|
*/
|
|
*/
|
|
|
export const DeleteResourceNotification = "DeleteResourceNotification";
|
|
export const DeleteResourceNotification = "DeleteResourceNotification";
|
|
|
-export interface DeleteResourceEvent {
|
|
|
|
|
|
|
+export function DeleteResourceNotificationEvent(callback: Atomic.EventCallback<DeleteResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(DeleteResourceNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface DeleteResourceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the resource to edit
|
|
// The full path to the resource to edit
|
|
|
path: string;
|
|
path: string;
|
|
@@ -135,7 +213,10 @@ export const RenameResource = "EditorRenameResource";
|
|
|
* @type {String}
|
|
* @type {String}
|
|
|
*/
|
|
*/
|
|
|
export const RenameResourceNotification = "RenameResourceNotification";
|
|
export const RenameResourceNotification = "RenameResourceNotification";
|
|
|
-export interface RenameResourceEvent {
|
|
|
|
|
|
|
+export function RenameResourceNotificationEvent(callback: Atomic.EventCallback<RenameResourceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(RenameResourceNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface RenameResourceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the resource to edit
|
|
// The full path to the resource to edit
|
|
|
path: string;
|
|
path: string;
|
|
@@ -154,7 +235,10 @@ export interface SceneEditStateChangeEvent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const InspectorProjectReference = "InspectorProjectReference";
|
|
export const InspectorProjectReference = "InspectorProjectReference";
|
|
|
-export interface InspectorProjectReferenceEvent {
|
|
|
|
|
|
|
+export function InspectorProjectReferenceEvent(callback : Atomic.EventCallback<InspectorProjectReferenceEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(InspectorProjectReference, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface InspectorProjectReferenceEvent extends Atomic.EventMetaData {
|
|
|
|
|
|
|
|
// The full path to the resource to edit
|
|
// The full path to the resource to edit
|
|
|
path: string;
|
|
path: string;
|
|
@@ -162,7 +246,10 @@ export interface InspectorProjectReferenceEvent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const UserPreferencesChangedNotification = "UserPreferencesChangedNotification";
|
|
export const UserPreferencesChangedNotification = "UserPreferencesChangedNotification";
|
|
|
-export interface UserPreferencesChangedEvent {
|
|
|
|
|
|
|
+export function UserPreferencesChangedNotificationEvent(callback : Atomic.EventCallback<UserPreferencesChangedEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(UserPreferencesChangedNotification, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface UserPreferencesChangedEvent extends Atomic.EventMetaData {
|
|
|
/**
|
|
/**
|
|
|
* JSON string of the project preferences
|
|
* JSON string of the project preferences
|
|
|
*/
|
|
*/
|
|
@@ -175,12 +262,40 @@ export interface UserPreferencesChangedEvent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const WebViewLoadEnd = "WebViewLoadEnd";
|
|
export const WebViewLoadEnd = "WebViewLoadEnd";
|
|
|
|
|
+export function WebViewLoadEndEvent(callback : Atomic.EventCallback<null>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(WebViewLoadEnd, callback);
|
|
|
|
|
+}
|
|
|
export const WebMessage = "WebMessage";
|
|
export const WebMessage = "WebMessage";
|
|
|
|
|
+export function WebMessageEvent(callback: Atomic.EventCallback<WebMessageEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(WebMessage, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface WebMessageEvent extends Atomic.EventMetaData {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Could be either a JSON formatted object or a simple string
|
|
|
|
|
+ * @type {string}
|
|
|
|
|
+ */
|
|
|
|
|
+ request: string;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
// interface to pass modal error messages from core modules
|
|
// interface to pass modal error messages from core modules
|
|
|
export const EditorModal = "EditorModal";
|
|
export const EditorModal = "EditorModal";
|
|
|
-export interface EditorModalEvent {
|
|
|
|
|
|
|
+export function EditorModalEvent(callback: Atomic.EventCallback<EditorModalEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(EditorModal, callback);
|
|
|
|
|
+}
|
|
|
|
|
+export interface EditorModalEvent extends Atomic.EventMetaData {
|
|
|
uiType: number; // EDITOR_ERROR_MODAL, etc)
|
|
uiType: number; // EDITOR_ERROR_MODAL, etc)
|
|
|
title: string; // for modal errors, title text
|
|
title: string; // for modal errors, title text
|
|
|
message: string; // for modal errors, error text
|
|
message: string; // for modal errors, error text
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+export const AttributeEditResourceChangedEventName = "AttributeEditResourceChanged";
|
|
|
|
|
+export function AttributeEditResourceChangedEvent(callback: Atomic.EventCallback<AttributeEditResourceChangedEvent>) {
|
|
|
|
|
+ return Atomic.ScriptEvent(AttributeEditResourceChangedEventName, callback);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export interface AttributeEditResourceChangedEvent extends Atomic.EventMetaData {
|
|
|
|
|
+
|
|
|
|
|
+ //attrInfoEdit: AttributeInfoEdit;
|
|
|
|
|
+ resource: Atomic.Resource;
|
|
|
|
|
+
|
|
|
|
|
+}
|