chore: modified the GDGAMEONLY calls in player_input.cpp to be on the signature line

main
Sara 2024-05-28 17:11:37 +02:00
parent 47a5965e31
commit e0f6ba276b
1 changed files with 3 additions and 6 deletions

View File

@ -71,24 +71,21 @@ gd::Vector2 PlayerInput::get_last_mouse_motion() {
return PlayerInput::lastMouseMotion;
}
void PlayerInput::_enter_tree() {
GDGAMEONLY();
void PlayerInput::_enter_tree() { GDGAMEONLY();
if(!PlayerInput::primaryExists) {
this->isPrimary = true;
PlayerInput::primaryExists = true;
}
}
void PlayerInput::_exit_tree() {
GDGAMEONLY();
void PlayerInput::_exit_tree() { GDGAMEONLY();
if(this->isPrimary) {
this->isPrimary = false;
PlayerInput::primaryExists = false;
}
}
void PlayerInput::_unhandled_input(gd::Ref<gd::InputEvent> const &event) {
GDGAMEONLY();
void PlayerInput::_unhandled_input(gd::Ref<gd::InputEvent> const &event) { GDGAMEONLY();
if(this->isPrimary && event->is_class("InputEventMouseMotion"))
PlayerInput::lastMouseMotion = gd::Object::cast_to<gd::InputEventMouseMotion>(*event)->get_relative();
for(Listener& listener: this->listeners) {