Finish setting up selected condition in Condition API

This commit is contained in:
JannisX11 2022-12-21 15:36:40 +01:00
parent a31bfe4359
commit 16f8c0f2b2

View File

@ -41,14 +41,32 @@ const Condition = function(condition, context) {
if (condition.tools instanceof Array && window.Toolbox && condition.tools.includes(Toolbox.selected.id) === false) return false;
if (condition.features instanceof Array && Format && condition.features.find(feature => !Format[feature])) return false;
if (condition.selected) {
if (condition.selected.animation_controller === true && !AnimationController.selected) return false;
if (condition.selected.animation_controller === false && AnimationController.selected) return false;
if (condition.selected.animation === true && !Animation.selected) return false;
if (condition.selected.animation === false && Animation.selected) return false;
if (condition.selected.animation_controller === true && !AnimationController.selected) return false;
if (condition.selected.animation_controller === false && AnimationController.selected) return false;
if (condition.selected.animation_controller_state === true && !(AnimationController.selected?.selected_state)) return false;
if (condition.selected.animation_controller_state === false && (AnimationController.selected?.selected_state)) return false;
if (condition.selected.keyframe === true && !(Keyframe.selected.length)) return false;
if (condition.selected.keyframe === false && (Keyframe.selected.length)) return false;
if (condition.selected.group === true && !Group.selected) return false;
if (condition.selected.group === false && Group.selected) return false;
if (condition.selected.texture === true && !Texture.selected) return false;
if (condition.selected.texture === false && Texture.selected) return false;
if (condition.selected.element === true && !Outliner.selected.length) return false;
if (condition.selected.element === false && Outliner.selected.length) return false;
if (condition.selected.cube === true && !Cube.selected.length) return false;
if (condition.selected.cube === false && Cube.selected.length) return false;
if (condition.selected.mesh === true && !Mesh.selected.length) return false;
if (condition.selected.mesh === false && Mesh.selected.length) return false;
if (condition.selected.locatlr === true && !Locator.selected.length) return false;
if (condition.selected.locatlr === false && Locator.selected.length) return false;
if (condition.selected.null_object === true && !NullObject.selected.length) return false;
if (condition.selected.null_object === false && NullObject.selected.length) return false;
if (condition.selected.texture_mesh === true && !TextureMesh.selected.length) return false;
if (condition.selected.texture_mesh === false && TextureMesh.selected.length) return false;
if (condition.selected.texture_mesh === true && !TextureMesh.selected.length) return false;
if (condition.selected.texture_mesh === false && TextureMesh.selected.length) return false;
}
if (condition.project && !Project) return false;