From 240b406332ce60f2a9bc67b36e7e8fa7a4643255 Mon Sep 17 00:00:00 2001 From: ChancellorIkseew Date: Sun, 3 Nov 2024 07:24:51 +1000 Subject: [PATCH] add binding for old key X --- res/config/bindings.toml | 1 + res/texts/en_US.txt | 1 + res/texts/ru_RU.txt | 1 + src/core_defs.hpp | 2 ++ src/logic/PlayerController.cpp | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/res/config/bindings.toml b/res/config/bindings.toml index 2d373cb9..a0ab278f 100644 --- a/res/config/bindings.toml +++ b/res/config/bindings.toml @@ -16,4 +16,5 @@ player.attack="mouse:left" player.build="mouse:right" player.pick="mouse:middle" player.drop="key:q" +player.fast_interaction="key:x" hud.inventory="key:tab" diff --git a/res/texts/en_US.txt b/res/texts/en_US.txt index 3f6d1c74..40c684a4 100644 --- a/res/texts/en_US.txt +++ b/res/texts/en_US.txt @@ -31,6 +31,7 @@ hud.inventory=Inventory player.pick=Pick Block player.attack=Attack / Break player.build=Place Block +player.fast_interaction=Accelerated interaction player.flight=Flight player.noclip=No-clip player.drop=Drop Item diff --git a/res/texts/ru_RU.txt b/res/texts/ru_RU.txt index df8f945e..53368e92 100644 --- a/res/texts/ru_RU.txt +++ b/res/texts/ru_RU.txt @@ -92,6 +92,7 @@ hud.inventory=Инвентарь player.pick=Подобрать Блок player.attack=Атаковать / Сломать player.build=Поставить Блок +player.fast_interaction=Ускоренное взаимодействие player.flight=Полёт player.drop=Выбросить Предмет camera.zoom=Приближение diff --git a/src/core_defs.hpp b/src/core_defs.hpp index 0f25de3a..c2b5dd39 100644 --- a/src/core_defs.hpp +++ b/src/core_defs.hpp @@ -27,6 +27,8 @@ inline const std::string BIND_PLAYER_FLIGHT = "player.flight"; inline const std::string BIND_PLAYER_ATTACK = "player.attack"; inline const std::string BIND_PLAYER_BUILD = "player.build"; inline const std::string BIND_PLAYER_PICK = "player.pick"; +inline const std::string BIND_PLAYER_FAST_INTERACTOIN = + "player.fast_interaction"; inline const std::string BIND_HUD_INVENTORY = "hud.inventory"; class EnginePaths; diff --git a/src/logic/PlayerController.cpp b/src/logic/PlayerController.cpp index 04a39f61..dedcc49d 100644 --- a/src/logic/PlayerController.cpp +++ b/src/logic/PlayerController.cpp @@ -489,7 +489,7 @@ void PlayerController::updateInteraction() { if (interactionTimer > 0.0f) { interactionTimer -= static_cast(engine->getDelta()); } - bool xkey = Events::pressed(keycode::X); + bool xkey = Events::active(BIND_PLAYER_FAST_INTERACTOIN); float maxDistance = xkey ? 200.0f : 10.0f; bool longInteraction = interactionTimer <= 0 || xkey; bool lclick = Events::jactive(BIND_PLAYER_ATTACK) ||