chore: modified the GDGAMEONLY calls in player_input.cpp to be on the signature line
parent
47a5965e31
commit
e0f6ba276b
|
@ -71,24 +71,21 @@ gd::Vector2 PlayerInput::get_last_mouse_motion() {
|
||||||
return PlayerInput::lastMouseMotion;
|
return PlayerInput::lastMouseMotion;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerInput::_enter_tree() {
|
void PlayerInput::_enter_tree() { GDGAMEONLY();
|
||||||
GDGAMEONLY();
|
|
||||||
if(!PlayerInput::primaryExists) {
|
if(!PlayerInput::primaryExists) {
|
||||||
this->isPrimary = true;
|
this->isPrimary = true;
|
||||||
PlayerInput::primaryExists = true;
|
PlayerInput::primaryExists = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerInput::_exit_tree() {
|
void PlayerInput::_exit_tree() { GDGAMEONLY();
|
||||||
GDGAMEONLY();
|
|
||||||
if(this->isPrimary) {
|
if(this->isPrimary) {
|
||||||
this->isPrimary = false;
|
this->isPrimary = false;
|
||||||
PlayerInput::primaryExists = false;
|
PlayerInput::primaryExists = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerInput::_unhandled_input(gd::Ref<gd::InputEvent> const &event) {
|
void PlayerInput::_unhandled_input(gd::Ref<gd::InputEvent> const &event) { GDGAMEONLY();
|
||||||
GDGAMEONLY();
|
|
||||||
if(this->isPrimary && event->is_class("InputEventMouseMotion"))
|
if(this->isPrimary && event->is_class("InputEventMouseMotion"))
|
||||||
PlayerInput::lastMouseMotion = gd::Object::cast_to<gd::InputEventMouseMotion>(*event)->get_relative();
|
PlayerInput::lastMouseMotion = gd::Object::cast_to<gd::InputEventMouseMotion>(*event)->get_relative();
|
||||||
for(Listener& listener: this->listeners) {
|
for(Listener& listener: this->listeners) {
|
||||||
|
|
Loading…
Reference in New Issue