Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions rootex/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "core/resource_files/text_resource_file.h"
#include "core/resource_files/particle_effect_resource_file.h"
#include "event_manager.h"
#include "components/space/transform_animation_component.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this line above, where all other component header files are being included. (Line 29)


extern "C" int luaopen_lpeg(lua_State* L);

Expand Down Expand Up @@ -449,6 +450,7 @@ void LuaInterpreter::registerTypes()
{
sol::usertype<Entity> entity = rootex.new_usertype<Entity>("Entity",
"transform", sol::property(&Entity::getComponent<TransformComponent>),
"transformAnimation", sol::property(&Entity::getComponent<TransformAnimationComponent>),
"model", sol::property(&Entity::getComponent<ModelComponent>),
"animatedModel", sol::property(&Entity::getComponent<AnimatedModelComponent>),
"particleEffect", sol::property(&Entity::getComponent<ParticleEffectComponent>),
Expand Down Expand Up @@ -522,6 +524,15 @@ void LuaInterpreter::registerTypes()
sol::base_classes, sol::bases<Component, RenderableComponent>());
modelComponent["getModelResourceFile"] = &ModelComponent::getModelResourceFile;
}
{
sol::usertype<TransformAnimationComponent> transformAnimationComponent = rootex.new_usertype<TransformAnimationComponent>(
"TransformAnimationComponent",
sol::base_classes, sol::bases<Component>());
transformAnimationComponent["setPlaying"] = &TransformAnimationComponent::setPlaying;
transformAnimationComponent["reset"] = &TransformAnimationComponent::reset;
transformAnimationComponent["isPlaying"] = &TransformAnimationComponent::isPlaying;
transformAnimationComponent["hasEnded"] = &TransformAnimationComponent::hasEnded;
}
{
sol::usertype<AnimatedModelComponent> animatedModelComponent = rootex.new_usertype<AnimatedModelComponent>(
"AnimatedModelComponent",
Expand Down