From 2c465f4f42b39f0d9cc5a2578b401c6ceea171e6 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sat, 1 Feb 2020 06:26:57 +0700 Subject: [PATCH] camera flag binds --- .../scripts/emmy/components/camera.lua | 6 +++++ .../high_binds/components/camera_binds.cpp | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/samples/bin/library/scripts/emmy/components/camera.lua b/samples/bin/library/scripts/emmy/components/camera.lua index f7c40a1a..23b6e81c 100644 --- a/samples/bin/library/scripts/emmy/components/camera.lua +++ b/samples/bin/library/scripts/emmy/components/camera.lua @@ -6,6 +6,12 @@ local camera = { ---@type boolean disabled = false, + ---@type boolean + input = false, + + ---@type boolean + gizmos = false, + ---@type integer depth = 0, diff --git a/sources/enduro2d/high/bindings/high_binds/components/camera_binds.cpp b/sources/enduro2d/high/bindings/high_binds/components/camera_binds.cpp index 96b7b65d..f0810c59 100644 --- a/sources/enduro2d/high/bindings/high_binds/components/camera_binds.cpp +++ b/sources/enduro2d/high/bindings/high_binds/components/camera_binds.cpp @@ -50,6 +50,32 @@ namespace e2d::bindings::high } ), + "input", sol::property( + [](const gcomponent& c) -> bool { + return c.owner().component().exists(); + }, + [](gcomponent& c, bool yesno){ + if ( yesno ) { + c.owner().component().ensure(); + } else { + c.owner().component().remove(); + } + } + ), + + "gizmos", sol::property( + [](const gcomponent& c) -> bool { + return c.owner().component().exists(); + }, + [](gcomponent& c, bool yesno){ + if ( yesno ) { + c.owner().component().ensure(); + } else { + c.owner().component().remove(); + } + } + ), + "depth", sol::property( [](const gcomponent& c) -> i32 { return c->depth();