dummy editor module

This commit is contained in:
2019-12-07 18:09:53 +07:00
parent 903ad19b80
commit 5a9a75c1f2
9 changed files with 78 additions and 8 deletions

View File

@@ -53,6 +53,7 @@
#include "asset.hpp"
#include "asset.inl"
#include "atlas.hpp"
#include "editor.hpp"
#include "factory.hpp"
#include "factory.inl"
#include "flipbook.hpp"

View File

@@ -86,6 +86,7 @@ namespace e2d
class spine;
class sprite;
class editor;
class luasol;
class starter;
class world;

View File

@@ -0,0 +1,18 @@
/*******************************************************************************
* This file is part of the "Enduro2D"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/
#pragma once
#include "_high.hpp"
namespace e2d
{
class editor final : public module<editor> {
public:
editor();
~editor() noexcept final;
};
}

View File

@@ -0,0 +1,6 @@
---@class editor
local editor = {
}
---@type editor
_G.the_editor = _G.the_editor or editor

View File

@@ -10,6 +10,7 @@
namespace e2d::bindings::high
{
void bind_editor(sol::state& l);
void bind_library(sol::state& l);
void bind_luasol(sol::state& l);
void bind_world(sol::state& l);
@@ -33,6 +34,7 @@ namespace e2d::bindings::high
namespace e2d::bindings
{
inline void bind_high(sol::state& l) {
high::bind_editor(l);
high::bind_library(l);
high::bind_luasol(l);
high::bind_world(l);

View File

@@ -0,0 +1,18 @@
/*******************************************************************************
* This file is part of the "Enduro2D"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/
#include "_high_binds.hpp"
#include <enduro2d/high/editor.hpp>
namespace e2d::bindings::high
{
void bind_editor(sol::state& l) {
l.new_usertype<editor>("editor",
sol::no_constructor
);
}
}

View File

@@ -0,0 +1,25 @@
/*******************************************************************************
* This file is part of the "Enduro2D"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/
#include <enduro2d/high/editor.hpp>
#include <enduro2d/high/widgets/hierarchy_widget.hpp>
namespace
{
using namespace e2d;
}
namespace e2d
{
editor::editor() {
if ( modules::is_initialized<dbgui>() ) {
the<dbgui>().register_menu_widget<dbgui_widgets::hierarchy_widget>("Scene", "Hierarchy");
}
}
editor::~editor() noexcept = default;
}

View File

@@ -6,10 +6,11 @@
#include <enduro2d/high/starter.hpp>
#include <enduro2d/high/world.hpp>
#include <enduro2d/high/luasol.hpp>
#include <enduro2d/high/editor.hpp>
#include <enduro2d/high/factory.hpp>
#include <enduro2d/high/library.hpp>
#include <enduro2d/high/luasol.hpp>
#include <enduro2d/high/world.hpp>
#include <enduro2d/high/components/actor.hpp>
#include <enduro2d/high/components/behaviour.hpp>
@@ -32,8 +33,6 @@
#include <enduro2d/high/systems/script_system.hpp>
#include <enduro2d/high/systems/spine_system.hpp>
#include <enduro2d/high/widgets/hierarchy_widget.hpp>
namespace
{
using namespace e2d;
@@ -201,15 +200,13 @@ namespace e2d
params.library_params().root());
safe_module_initialize<world>();
if ( modules::is_initialized<dbgui>() ) {
the<dbgui>().register_menu_widget<dbgui_widgets::hierarchy_widget>("Scene", "Hierarchy");
}
safe_module_initialize<editor>();
}
starter::~starter() noexcept {
the<luasol>().collect_garbage();
modules::shutdown<editor>();
modules::shutdown<world>();
modules::shutdown<library>();
modules::shutdown<luasol>();

View File

@@ -6,6 +6,7 @@
#include <enduro2d/high/systems/script_system.hpp>
#include <enduro2d/high/editor.hpp>
#include <enduro2d/high/library.hpp>
#include <enduro2d/high/luasol.hpp>
#include <enduro2d/high/world.hpp>
@@ -31,6 +32,7 @@ namespace
}
void init_high_table(sol::state& s) {
s["the_editor"] = &the<editor>();
s["the_library"] = &the<library>();
s["the_luasol"] = &the<luasol>();
s["the_world"] = &the<world>();