mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 14:11:32 +00:00
CLEANUP(animationbindings): camelCase all the things
This commit is contained in:
parent
1f4ab3b668
commit
6eee6e9468
2 changed files with 20 additions and 20 deletions
|
@ -234,9 +234,9 @@ namespace MWLua
|
||||||
[mechanics](const sol::object& object, const std::string& groupname, const sol::table& options) {
|
[mechanics](const sol::object& object, const std::string& groupname, const sol::table& options) {
|
||||||
uint32_t numberOfLoops = options.get_or("loops", std::numeric_limits<uint32_t>::max());
|
uint32_t numberOfLoops = options.get_or("loops", std::numeric_limits<uint32_t>::max());
|
||||||
float speed = options.get_or("speed", 1.f);
|
float speed = options.get_or("speed", 1.f);
|
||||||
std::string startKey = options.get_or<std::string>("startkey", "start");
|
std::string startKey = options.get_or<std::string>("startKey", "start");
|
||||||
std::string stopKey = options.get_or<std::string>("stopkey", "stop");
|
std::string stopKey = options.get_or<std::string>("stopKey", "stop");
|
||||||
bool forceLoop = options.get_or("forceloop", false);
|
bool forceLoop = options.get_or("forceLoop", false);
|
||||||
|
|
||||||
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object));
|
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object));
|
||||||
mechanics->playAnimationGroupLua(ptr, groupname, numberOfLoops, speed, startKey, stopKey, forceLoop);
|
mechanics->playAnimationGroupLua(ptr, groupname, numberOfLoops, speed, startKey, stopKey, forceLoop);
|
||||||
|
@ -247,20 +247,20 @@ namespace MWLua
|
||||||
ptr, groupname, std::numeric_limits<int>::max(), 1, "start", "stop", false);
|
ptr, groupname, std::numeric_limits<int>::max(), 1, "start", "stop", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
api["playBlended"] = [](const sol::object& object, std::string_view groupname, const sol::table& options) {
|
api["playBlended"] = [](const sol::object& object, std::string_view groupName, const sol::table& options) {
|
||||||
uint32_t loops = options.get_or("loops", 0u);
|
uint32_t loops = options.get_or("loops", 0u);
|
||||||
MWRender::Animation::AnimPriority priority = getPriorityArgument(options);
|
MWRender::Animation::AnimPriority priority = getPriorityArgument(options);
|
||||||
BlendMask blendMask = options.get_or("blendmask", BlendMask::BlendMask_All);
|
BlendMask blendMask = options.get_or("blendMask", BlendMask::BlendMask_All);
|
||||||
bool autoDisable = options.get_or("autodisable", true);
|
bool autoDisable = options.get_or("autoDisable", true);
|
||||||
float speed = options.get_or("speed", 1.0f);
|
float speed = options.get_or("speed", 1.0f);
|
||||||
std::string start = options.get_or<std::string>("startkey", "start");
|
std::string start = options.get_or<std::string>("startKey", "start");
|
||||||
std::string stop = options.get_or<std::string>("stopkey", "stop");
|
std::string stop = options.get_or<std::string>("stopKey", "stop");
|
||||||
float startpoint = options.get_or("startpoint", 0.0f);
|
float startPoint = options.get_or("startPoint", 0.0f);
|
||||||
bool forceLoop = options.get_or("forceloop", false);
|
bool forceLoop = options.get_or("forceLoop", false);
|
||||||
|
|
||||||
auto animation = getMutableAnimationOrThrow(ObjectVariant(object));
|
auto animation = getMutableAnimationOrThrow(ObjectVariant(object));
|
||||||
animation->play(groupname, priority, blendMask, autoDisable, speed, start, stop, startpoint, loops,
|
animation->play(groupName, priority, blendMask, autoDisable, speed, start, stop, startPoint, loops,
|
||||||
forceLoop || animation->isLoopingAnimation(groupname));
|
forceLoop || animation->isLoopingAnimation(groupName));
|
||||||
};
|
};
|
||||||
|
|
||||||
api["hasGroup"] = [](const sol::object& object, std::string_view groupname) -> bool {
|
api["hasGroup"] = [](const sol::object& object, std::string_view groupname) -> bool {
|
||||||
|
@ -287,11 +287,11 @@ namespace MWLua
|
||||||
context.mLuaManager->addAction(
|
context.mLuaManager->addAction(
|
||||||
[object = ObjectVariant(object), model = getStaticModelOrThrow(staticOrID),
|
[object = ObjectVariant(object), model = getStaticModelOrThrow(staticOrID),
|
||||||
effectId = options.get_or<std::string>("vfxId", ""), loop = options.get_or("loop", false),
|
effectId = options.get_or<std::string>("vfxId", ""), loop = options.get_or("loop", false),
|
||||||
bonename = options.get_or<std::string>("bonename", ""),
|
boneName = options.get_or<std::string>("boneName", ""),
|
||||||
particleTexture = options.get_or<std::string>("particleTextureOverride", "")] {
|
particleTexture = options.get_or<std::string>("particleTextureOverride", "")] {
|
||||||
MWRender::Animation* anim = getMutableAnimationOrThrow(ObjectVariant(object));
|
MWRender::Animation* anim = getMutableAnimationOrThrow(ObjectVariant(object));
|
||||||
|
|
||||||
anim->addEffect(model, effectId, loop, bonename, particleTexture);
|
anim->addEffect(model, effectId, loop, boneName, particleTexture);
|
||||||
},
|
},
|
||||||
"addVfxAction");
|
"addVfxAction");
|
||||||
});
|
});
|
||||||
|
|
|
@ -426,14 +426,14 @@ namespace MWLua
|
||||||
std::string_view start, std::string_view stop, float startpoint, uint32_t loops, bool loopfallback)
|
std::string_view start, std::string_view stop, float startpoint, uint32_t loops, bool loopfallback)
|
||||||
{
|
{
|
||||||
sol::table options = mLua.newTable();
|
sol::table options = mLua.newTable();
|
||||||
options["blendmask"] = blendMask;
|
options["blendMask"] = blendMask;
|
||||||
options["autodisable"] = autodisable;
|
options["autoDisable"] = autodisable;
|
||||||
options["speed"] = speedmult;
|
options["speed"] = speedmult;
|
||||||
options["startkey"] = start;
|
options["startKey"] = start;
|
||||||
options["stopkey"] = stop;
|
options["stopKey"] = stop;
|
||||||
options["startpoint"] = startpoint;
|
options["startPoint"] = startpoint;
|
||||||
options["loops"] = loops;
|
options["loops"] = loops;
|
||||||
options["forceloop"] = loopfallback;
|
options["forceLoop"] = loopfallback;
|
||||||
|
|
||||||
bool priorityAsTable = false;
|
bool priorityAsTable = false;
|
||||||
for (uint32_t i = 1; i < MWRender::sNumBlendMasks; i++)
|
for (uint32_t i = 1; i < MWRender::sNumBlendMasks; i++)
|
||||||
|
|
Loading…
Reference in a new issue