From b0dfb4ef5ee170407e672338bd304d0549417396 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 31 Dec 2023 13:58:00 +0100 Subject: [PATCH] Cleanups. --- sfw/render_core/input/shortcut.cpp | 15 +-------------- sfw/render_core/input/shortcut.h | 10 ++++------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/sfw/render_core/input/shortcut.cpp b/sfw/render_core/input/shortcut.cpp index 29ec42c..189e0ce 100644 --- a/sfw/render_core/input/shortcut.cpp +++ b/sfw/render_core/input/shortcut.cpp @@ -5,8 +5,7 @@ #include "shortcut.h" -#include "core/input/input_event.h" -#include "core/os/keyboard.h" +#include "core/render_core/input_event.h" void ShortCut::set_shortcut(const Ref &p_shortcut) { shortcut = p_shortcut; @@ -33,18 +32,6 @@ bool ShortCut::is_valid() const { return shortcut.is_valid(); } -void ShortCut::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_shortcut", "event"), &ShortCut::set_shortcut); - ClassDB::bind_method(D_METHOD("get_shortcut"), &ShortCut::get_shortcut); - - ClassDB::bind_method(D_METHOD("is_valid"), &ShortCut::is_valid); - - ClassDB::bind_method(D_METHOD("is_shortcut", "event"), &ShortCut::is_shortcut); - ClassDB::bind_method(D_METHOD("get_as_text"), &ShortCut::get_as_text); - - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"), "set_shortcut", "get_shortcut"); -} - ShortCut::ShortCut() { } diff --git a/sfw/render_core/input/shortcut.h b/sfw/render_core/input/shortcut.h index b62b953..2cc59bc 100644 --- a/sfw/render_core/input/shortcut.h +++ b/sfw/render_core/input/shortcut.h @@ -6,18 +6,13 @@ /* From https://github.com/Relintai/pandemonium_engine (MIT) */ /*************************************************************************/ -#include "core/object/resource.h" +#include "resource.h" class InputEvent; class ShortCut : public Resource { GDCLASS(ShortCut, Resource); - Ref shortcut; - -protected: - static void _bind_methods(); - public: void set_shortcut(const Ref &p_shortcut); Ref get_shortcut() const; @@ -28,6 +23,9 @@ public: ShortCut(); ~ShortCut(); + +private: + Ref shortcut; }; #endif // SHORTCUT_H