summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-04-13 04:25:44 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-05-04 04:38:08 -0400
commit0de9a7d8030a35415e918e9580f5926db4856ea2 (patch)
treec4308b7250141d48806e7e501c8640fe06034db9 /core/input
parent3fea1707723a211c223f73d71b1243bf2f558d09 (diff)
Rename `doubleclick` to `double_click`
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input_event.cpp22
-rw-r--r--core/input/input_event.h6
2 files changed, 14 insertions, 14 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index 99cc51b95e..46629d742e 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -545,12 +545,12 @@ bool InputEventMouseButton::is_pressed() const {
return pressed;
}
-void InputEventMouseButton::set_doubleclick(bool p_doubleclick) {
- doubleclick = p_doubleclick;
+void InputEventMouseButton::set_double_click(bool p_double_click) {
+ double_click = p_double_click;
}
-bool InputEventMouseButton::is_doubleclick() const {
- return doubleclick;
+bool InputEventMouseButton::is_double_click() const {
+ return double_click;
}
Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
@@ -569,7 +569,7 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co
mb->set_button_mask(get_button_mask());
mb->set_pressed(pressed);
- mb->set_doubleclick(doubleclick);
+ mb->set_double_click(double_click);
mb->set_factor(factor);
mb->set_button_index(button_index);
@@ -636,7 +636,7 @@ String InputEventMouseButton::as_text() const {
}
// Double Click
- if (doubleclick) {
+ if (double_click) {
full_string += " (" + RTR("Double Click") + ")";
}
@@ -645,7 +645,7 @@ String InputEventMouseButton::as_text() const {
String InputEventMouseButton::to_string() {
String p = is_pressed() ? "true" : "false";
- String d = doubleclick ? "true" : "false";
+ String d = double_click ? "true" : "false";
int idx = get_button_index();
String button_string = itos(idx);
@@ -671,7 +671,7 @@ String InputEventMouseButton::to_string() {
// Work around the fact vformat can only take 5 substitutions but 6 need to be passed.
String index_and_mods = vformat("button_index=%s mods=%s", button_index, mods);
- return vformat("InputEventMouseButton: %s pressed=%s position=(%s) button_mask=%s doubleclick=%s", index_and_mods, p, String(get_position()), itos(get_button_mask()), d);
+ return vformat("InputEventMouseButton: %s pressed=%s position=(%s) button_mask=%s double_click=%s", index_and_mods, p, String(get_position()), itos(get_button_mask()), d);
}
void InputEventMouseButton::_bind_methods() {
@@ -684,13 +684,13 @@ void InputEventMouseButton::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_pressed", "pressed"), &InputEventMouseButton::set_pressed);
// ClassDB::bind_method(D_METHOD("is_pressed"), &InputEventMouseButton::is_pressed);
- ClassDB::bind_method(D_METHOD("set_doubleclick", "doubleclick"), &InputEventMouseButton::set_doubleclick);
- ClassDB::bind_method(D_METHOD("is_doubleclick"), &InputEventMouseButton::is_doubleclick);
+ ClassDB::bind_method(D_METHOD("set_double_click", "double_click"), &InputEventMouseButton::set_double_click);
+ ClassDB::bind_method(D_METHOD("is_double_click"), &InputEventMouseButton::is_double_click);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "factor"), "set_factor", "get_factor");
ADD_PROPERTY(PropertyInfo(Variant::INT, "button_index"), "set_button_index", "get_button_index");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "doubleclick"), "set_doubleclick", "is_doubleclick");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "double_click"), "set_double_click", "is_double_click");
}
///////////////////////////////////
diff --git a/core/input/input_event.h b/core/input/input_event.h
index 94aa68db33..5a33ee7b9c 100644
--- a/core/input/input_event.h
+++ b/core/input/input_event.h
@@ -294,7 +294,7 @@ class InputEventMouseButton : public InputEventMouse {
float factor = 1;
int button_index = 0;
bool pressed = false; //otherwise released
- bool doubleclick = false; //last even less than doubleclick time
+ bool double_click = false; //last even less than double click time
protected:
static void _bind_methods();
@@ -309,8 +309,8 @@ public:
void set_pressed(bool p_pressed);
virtual bool is_pressed() const override;
- void set_doubleclick(bool p_doubleclick);
- bool is_doubleclick() const;
+ void set_double_click(bool p_double_click);
+ bool is_double_click() const;
virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const override;
virtual bool action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const override;