TESTANIMATION: added ent type cycling

Martin Gerhardy 2019-12-10 17:09:25 +01:00
parent 12a7603dc1
commit df2a2bc23d
2 changed files with 17 additions and 0 deletions

View File

@ -2,5 +2,7 @@ space "animation_cycle 1"
ctrl+space "animation_cycle -1"
e "animation_cycle 1"
q "animation_cycle -1"
y "animation_cycleenttype 1"
c "animation_cycleenttype -1"
r "animation_cycletype 1"
t "animation_cycletype -1"

View File

@ -64,6 +64,21 @@ core::AppState TestAnimation::onConstruct() {
animationEntity()->setAnimation((animation::Animation)_animationIdx);
});
core::Command::registerCommand("animation_cycleenttype", [this] (const core::CmdArgs& argv) {
int offset = 1;
if (argv.size() > 0) {
offset = core::string::toInt(argv[0]);
}
int current = (int)_entityType;
current += offset;
while (current < 0) {
current += std::enum_value(EntityType::Max);
}
current %= (int)EntityType::Max;
_entityType = (EntityType)current;
loadAnimationEntity();
});
core::Command::registerCommand("animation_cycletype", [this] (const core::CmdArgs& argv) {
int offset = 1;
if (argv.size() > 0) {