mirror of
https://github.com/Relintai/sfw.git
synced 2024-11-08 07:52:09 +01:00
Cleanups.
This commit is contained in:
parent
5e8e7926f3
commit
b0dfb4ef5e
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
#include "shortcut.h"
|
#include "shortcut.h"
|
||||||
|
|
||||||
#include "core/input/input_event.h"
|
#include "core/render_core/input_event.h"
|
||||||
#include "core/os/keyboard.h"
|
|
||||||
|
|
||||||
void ShortCut::set_shortcut(const Ref<InputEvent> &p_shortcut) {
|
void ShortCut::set_shortcut(const Ref<InputEvent> &p_shortcut) {
|
||||||
shortcut = p_shortcut;
|
shortcut = p_shortcut;
|
||||||
@ -33,18 +32,6 @@ bool ShortCut::is_valid() const {
|
|||||||
return shortcut.is_valid();
|
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() {
|
ShortCut::ShortCut() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,18 +6,13 @@
|
|||||||
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "core/object/resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
class InputEvent;
|
class InputEvent;
|
||||||
|
|
||||||
class ShortCut : public Resource {
|
class ShortCut : public Resource {
|
||||||
GDCLASS(ShortCut, Resource);
|
GDCLASS(ShortCut, Resource);
|
||||||
|
|
||||||
Ref<InputEvent> shortcut;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
static void _bind_methods();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_shortcut(const Ref<InputEvent> &p_shortcut);
|
void set_shortcut(const Ref<InputEvent> &p_shortcut);
|
||||||
Ref<InputEvent> get_shortcut() const;
|
Ref<InputEvent> get_shortcut() const;
|
||||||
@ -28,6 +23,9 @@ public:
|
|||||||
|
|
||||||
ShortCut();
|
ShortCut();
|
||||||
~ShortCut();
|
~ShortCut();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ref<InputEvent> shortcut;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHORTCUT_H
|
#endif // SHORTCUT_H
|
||||||
|
Loading…
Reference in New Issue
Block a user