Started implementing deficated editor GUI
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "CharacterModule.h"
|
||||
#include "CharacterAnimationModule.h"
|
||||
#include "CharacterManagerModule.h"
|
||||
#include "VehicleManagerModule.h"
|
||||
#include "BoatModule.h"
|
||||
#include "EventTriggerModule.h"
|
||||
#include "SlotsModule.h"
|
||||
@@ -365,12 +366,14 @@ LuaData::LuaData()
|
||||
float x = lua_tonumber(L, 2);
|
||||
float y = lua_tonumber(L, 3);
|
||||
float z = lua_tonumber(L, 4);
|
||||
flecs::entity e = ECS::get().entity();
|
||||
Ogre::Quaternion orientation(Ogre::Radian(yaw),
|
||||
Ogre::Vector3(0, 1, 0));
|
||||
Ogre::Vector3 position(x, y, z);
|
||||
e.set<BoatType>(
|
||||
{ "boat.scene", position, orientation });
|
||||
flecs::entity e =
|
||||
ECS::get_mut<VehicleManagerModule>()
|
||||
.createVehicleAtPosition(
|
||||
"boat", position, orientation);
|
||||
ECS::modified<VehicleManagerModule>();
|
||||
int ret = idmap.add_entity(e);
|
||||
lua_pushinteger(L, ret);
|
||||
std::cout << "boat created: " << ret << std::endl;
|
||||
@@ -380,12 +383,14 @@ LuaData::LuaData()
|
||||
float x = lua_tonumber(L, 2);
|
||||
float y = lua_tonumber(L, 3);
|
||||
float z = lua_tonumber(L, 4);
|
||||
flecs::entity e = ECS::get().entity();
|
||||
Ogre::Quaternion orientation(Ogre::Radian(yaw),
|
||||
Ogre::Vector3(0, 1, 0));
|
||||
Ogre::Vector3 position(x, y, z);
|
||||
e.set<BoatType>(
|
||||
{ "raft.scene", position, orientation });
|
||||
flecs::entity e =
|
||||
ECS::get_mut<VehicleManagerModule>()
|
||||
.createVehicleAtPosition(
|
||||
"raft", position, orientation);
|
||||
ECS::modified<VehicleManagerModule>();
|
||||
int ret = idmap.add_entity(e);
|
||||
lua_pushinteger(L, ret);
|
||||
std::cout << "raft created: " << ret << std::endl;
|
||||
@@ -840,6 +845,7 @@ LuaModule::LuaModule(flecs::world &ecs)
|
||||
{
|
||||
ecs.module<LuaModule>();
|
||||
ecs.import <SlotsModule>();
|
||||
ecs.import <VehicleManagerModule>();
|
||||
ecs.component<LuaChildEventTrigger>();
|
||||
ecs.component<LuaBase>()
|
||||
.on_add([](LuaBase &lua) {
|
||||
@@ -849,11 +855,6 @@ LuaModule::LuaModule(flecs::world &ecs)
|
||||
})
|
||||
.add(flecs::Singleton);
|
||||
ecs.component<LuaEvent>().add(flecs::Singleton);
|
||||
if (!ecs.has<LuaBase>())
|
||||
ecs.add<LuaBase>();
|
||||
if (!ecs.has<LuaEvent>())
|
||||
ecs.set<LuaEvent>({});
|
||||
|
||||
ecs.system<const EngineData, LuaBase>("LuaUpdate")
|
||||
.kind(flecs::OnUpdate)
|
||||
.each([](const EngineData &eng, LuaBase &lua) {
|
||||
|
||||
Reference in New Issue
Block a user