feat: replace 'fallback weapon' with 'starting weapon'

This commit is contained in:
Sara 2025-07-18 00:45:55 +02:00
parent a93e79cd1c
commit 01b69df872
12 changed files with 233 additions and 57 deletions

View file

@ -4,6 +4,7 @@ String PlayerInput::sig_movement_input{ "movement_input" };
String PlayerInput::sig_look_input{ "look_input" };
String PlayerInput::sig_primary_fire{ "primary_fire" };
String PlayerInput::sig_alt_mode{ "alt_mode" };
String PlayerInput::sig_switch_weapon{ "switch_weapon" };
String PlayerInput::sig_run{ "run" };
String PlayerInput::sig_jump{ "jump" };
String PlayerInput::sig_crouch{ "crouch" };
@ -13,6 +14,7 @@ void PlayerInput::_bind_methods() {
ADD_SIGNAL(MethodInfo(sig_look_input, PropertyInfo(Variant::VECTOR2, "axes")));
ADD_SIGNAL(MethodInfo(sig_primary_fire, PropertyInfo(Variant::BOOL, "is_pressed")));
ADD_SIGNAL(MethodInfo(sig_alt_mode, PropertyInfo(Variant::BOOL, "is_active")));
ADD_SIGNAL(MethodInfo(sig_switch_weapon));
ADD_SIGNAL(MethodInfo(sig_run, PropertyInfo(Variant::BOOL, "is_running")));
ADD_SIGNAL(MethodInfo(sig_jump));
ADD_SIGNAL(MethodInfo(sig_crouch, PropertyInfo(Variant::BOOL, "is_crouching")));
@ -57,4 +59,7 @@ void PlayerInput::unhandled_input(Ref<InputEvent> const &event) {
if (event->is_pressed() && event->is_action("jump") && input->is_action_just_pressed("jump")) {
emit_signal(sig_jump);
}
if (event->is_action("switch_weapon") && event->is_pressed()) {
emit_signal(sig_switch_weapon);
}
}