diff --git a/DeerStudio/src/DeerStudio/EditorEngine/EditorEngine.cpp b/DeerStudio/src/DeerStudio/EditorEngine/EditorEngine.cpp index 83dac5d..2268724 100644 --- a/DeerStudio/src/DeerStudio/EditorEngine/EditorEngine.cpp +++ b/DeerStudio/src/DeerStudio/EditorEngine/EditorEngine.cpp @@ -42,13 +42,13 @@ namespace Deer { registerEditorEngineFunctions(); registerDockPanel(); - extract_angelScript(); - loadScripts(); scriptModule = scriptEngine->GetModule("DeerModule"); scriptContext = scriptEngine->CreateContext(); + extract_angelScript(); + extractDockPanels(); active = true; diff --git a/roe/Editor/active_entity.as b/roe/Editor/active_entity.as index b20ad38..0261cfc 100644 --- a/roe/Editor/active_entity.as +++ b/roe/Editor/active_entity.as @@ -1,10 +1,2 @@ Entity activeEntity = Engine::getRoot(); - -Entity get_activeEntity() const property { - return activeEntity; -} - -void set_activeEntity(Entity ent) property { - activeEntity = ent; -} \ No newline at end of file diff --git a/roe/Editor/as.predefined b/roe/Editor/as.predefined index 6ff6647..32519cb 100644 --- a/roe/Editor/as.predefined +++ b/roe/Editor/as.predefined @@ -366,7 +366,7 @@ namespace UI { // Popups & Context menus // Show a context menu popup with callback - void contextMenuPopup(const string& in label, ReciverFunc@ cb); + void contextMenuPopup(const string& in label, any@ data, ReciverFunc@ cb); // Popup attached to an item with label, data, and callback void contextItemPopup(const string& in label, any@ data, ReciverFunc@ cb); // Show a modal popup blocking interaction until closed diff --git a/roe/Editor/as.predefined_tmp b/roe/Editor/as.predefined_tmp new file mode 100644 index 0000000..e5aa689 --- /dev/null +++ b/roe/Editor/as.predefined_tmp @@ -0,0 +1,253 @@ +//This file was generated automatically +enum ResourceType { + Mesh = 1, + Shader = 2 +} +class string { + ~string(); + string(); + string(const string&in); + string& opAssign(const string&in); + string& opAddAssign(const string&in); + bool opEquals(const string&in) const; + int opCmp(const string&in) const; + string opAdd(const string&in) const; + uint length() const; + void resize(uint); + bool isEmpty() const; + uint8& opIndex(uint); + const uint8& opIndex(uint) const; + string& opAssign(double); + string& opAddAssign(double); + string opAdd(double) const; + string opAdd_r(double) const; + string& opAssign(float); + string& opAddAssign(float); + string opAdd(float) const; + string opAdd_r(float) const; + string& opAssign(int64); + string& opAddAssign(int64); + string opAdd(int64) const; + string opAdd_r(int64) const; + string& opAssign(uint64); + string& opAddAssign(uint64); + string opAdd(uint64) const; + string opAdd_r(uint64) const; + string& opAssign(bool); + string& opAddAssign(bool); + string opAdd(bool) const; + string opAdd_r(bool) const; + string substr(uint start = 0, int count = - 1) const; + int findFirst(const string&in, uint start = 0) const; + int findFirstOf(const string&in, uint start = 0) const; + int findFirstNotOf(const string&in, uint start = 0) const; + int findLast(const string&in, int start = - 1) const; + int findLastOf(const string&in, int start = - 1) const; + int findLastNotOf(const string&in, int start = - 1) const; + void insert(uint pos, const string&in other); + void erase(uint pos, int count = - 1); +} +class ref { + ~ref(); + ref(); + ref(const ref&in); + ref(const ?&in); + void opCast(?&out); + ref& opHndlAssign(const ref&in); + ref& opHndlAssign(const ?&in); + bool opEquals(const ref&in) const; + bool opEquals(const ?&in) const; +} +class any { + any& opAssign(any&in); + void store(?&in); + void store(const int64&in); + void store(const double&in); + bool retrieve(?&out); + bool retrieve(int64&out); + bool retrieve(double&out); +} +class Entity { + string get_name() const; + void set_name(string&in); + int get_id() const; + Entity createChild(const string&in); + bool get_isRoot() const; + void destroy(); + bool get_exists() const; + Entity get_parent(); + void set_parent(Entity); + bool isDescendantOf(Entity); + bool opEquals(const Entity&in) const; + EntityChilds get_childs() const; + TransformComponent get_transform() const; + MeshComponent getMeshComponent(); + MeshComponent createMeshComponent(); + bool hasMeshComponent(); + void removeMeshComponent(); + ShaderComponent getShaderComponent(); + ShaderComponent createShaderComponent(); + bool hasShaderComponent(); + void removeShaderComponent(); + CameraComponent getCameraComponent(); + CameraComponent createCameraComponent(); + bool hasCameraComponent(); + void removeCameraComponent(); +} +class EntityChilds { + int get_count() const; + Entity opIndex(int) const; +} +class TransformComponent { + vec3 get_position() const; + vec3 get_scale() const; + vec3 get_rotation() const; + void set_position(const vec3); + void set_scale(const vec3); + void set_rotation(const vec3); +} +class MeshComponent { + bool get_isActive() const; + bool get_hasMesh() const; + void clear(); + string getMesh(); + void setMesh(string&in); + void set_isActive(const bool); +} +class ShaderComponent { + bool get_hasShader() const; + void clear(); + string getShader(); + void setShader(const string&in); +} +class CameraComponent { + float get_fov() const; + float get_aspectRatio() const; + float get_nearZ() const; + float get_farZ() const; + void set_fov(float); + void set_aspectRatio(float); + void set_nearZ(float); + void set_farZ(float); +} +class vec3 { + vec3(); + vec3(float, float = 0, float = 0); + vec3 opAdds(const vec3&in); + vec3 opSub(const vec3&in) const; + vec3 opNeg() const; + vec3 opMul(float) const; + float x; + float y; + float z; +} +class quat { + ~quat(); + quat(); + quat(const quat&in); + quat(float, float, float, float); + quat opMul(const quat&in) const; + vec3 getEuler() const; + void setEuler(vec3); + float x; + float y; + float z; + float w; +} +class Transform { + Transform(); + vec3 position; + vec3 scale; + quat rotation; +} +class Camera { + ~Camera(); + float fov; + float aspect; + float nearZ; + float farZ; +} +class SceneCamera { + ~SceneCamera(); + Camera camera; + Transform transform; +} +class FrameBuffer { + void clearRGBA(int, int, int, int); + int get_height() const; + void resize(int, int); + string get_name() const; +} +class Environment { + void render(SceneCamera, FrameBuffer); + Entity getRootEntity(); + Entity getEntity(int); + string get_name() const; +} +class DockPanel { + void onRender(); +} +string formatInt(int64 val, const string&in options = "", uint width = 0); +string formatUInt(uint64 val, const string&in options = "", uint width = 0); +string formatFloat(double val, const string&in options = "", uint width = 0, uint precision = 0); +int64 parseInt(const string&in, uint base = 10, uint&out byteCount = 0); +uint64 parseUInt(const string&in, uint base = 10, uint&out byteCount = 0); +double parseFloat(const string&in, uint&out byteCount = 0); +namespace Engine { Entity getRoot(); } +namespace UI { bool button(const string&in); } +namespace UI { bool buttonCenter(const string&in); } +namespace UI { bool buttonEnd(const string&in); } +namespace UI { bool checkbox(const string&in, bool); } +namespace UI { bool checkboxDisabled(const string&in, bool); } +namespace UI { void drawFrameBuffer(FrameBuffer, int, int); } +namespace UI { void drawFrameBufferCentered(FrameBuffer, int, int); } +namespace UI { void drawIcon(const string&in, int); } +namespace UI { void drawIconCentered(const string&in, int); } +namespace UI { bool inputText(const string&in, const string&in, string&out); } +namespace UI { bool isItemClicked(int); } +namespace UI { bool isMouseDoubleClicked(int); } +namespace UI { float magicSlider(const string&in, float, float); } +namespace UI { vec3 magicSlider3(const string&in, vec3, float); } +namespace UI { bool menuItem(const string&in); } +namespace UI { void menuItemDisabled(const string&in); } +namespace UI { void menuSpace(const string&in, any@, ReciverFunc@); } +namespace UI { void sameline(); } +namespace UI { void separator(); } +namespace UI { void space(); } +namespace UI { void space(int, int = 10); } +namespace UI { void text(const string&in); } +namespace UI { void textCenter(const string&in); } +namespace UI { void textColor(float, float, float, const string&in); } +namespace UI { void textEnd(const string&in); } +namespace UI { void title(const string&in); } +namespace UI { void titleCenter(const string&in); } +namespace UI { void titleCenterY(const string&in, int); } +namespace UI { void titleEnd(const string&in); } +namespace Engine { FrameBuffer createRGBA8FrameBuffer(const string&in, int, int); } +namespace Engine { FrameBuffer getFrameBuffer(const string&in); } +namespace Engine { Environment getMainEnvironment(); } +namespace Engine { Environment createEnvironment(const string&in); } +namespace Engine { Environment getEnvironment(const string&in); } +namespace UI { void setupAutomaticColumns(int); } +namespace UI { void setupColumns(int); } +namespace UI { void endColumns(); } +namespace UI { void nextColumn(); } +namespace Resource { int getResourceCount(ResourceType, const string&in); } +namespace Resource { string getResourceNameById(ResourceType, const string&in, int); } +namespace Resource { string getResourcePathById(ResourceType, const string&in, int); } +namespace Resource { int getDirCount(ResourceType, const string&in); } +namespace Resource { string getDirPathById(ResourceType, const string&in, int); } +namespace Resource { string getDirNameById(ResourceType, const string&in, int); } +namespace Engine { void print(const string&in); } +namespace UI { void treeNodeLeaf(const string&in, bool); } +namespace UI { bool treeNode(const string&in, bool, any@, ReciverFunc@); } +namespace UI { bool componentNode(const string&in, any@, ReciverFunc@); } +namespace UI { bool componentNode_contextMenu(const string&in, any@, ReciverFunc@, ReciverFunc@); } +namespace UI { void contextItemPopup(const string&in, any@, ReciverFunc@); } +namespace UI { void contextMenuPopup(const string&in, any@, ReciverFunc@); } +namespace UI { void modalPopup(const string&in, ReciverFunc@); } +namespace UI { void simplePopup(const string&in, ReciverFunc@); } +namespace UI { void openPopup(const string&in, any@); } +namespace UI { void closePopup(); } +namespace UI { void dragDropSource(const string&in, any@, const string&in); } +namespace UI { void dragDropTarget(const string&in, any@, TransferFunc@); }