Merge pull request #122 from JenyaRostov/takeallhotkey

Hotkey to Take All action in containers
This commit is contained in:
Kae 2024-10-11 05:35:06 +11:00 committed by GitHub
commit 4b917e8c2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -3,7 +3,8 @@
"groups": { "groups": {
"camera": { "name": "Camera" }, "camera": { "name": "Camera" },
"voice": { "name": "Voice" }, "voice": { "name": "Voice" },
"building": { "name": "Building" } "building": { "name": "Building" },
"inventory": { "name": "Inventory" }
}, },
"name": "Open^#ebd74a;Starbound", "name": "Open^#ebd74a;Starbound",
"binds": { "binds": {
@ -15,6 +16,11 @@
"group": "camera", "group": "camera",
"name": "Zoom In" "name": "Zoom In"
}, },
"takeAll": {
"default": [],
"group": "inventory",
"name": "Take All From Container"
},
"zoomOut": { "zoomOut": {
"default": [{ "default": [{
"type": "key", "type": "key",

View File

@ -18,6 +18,7 @@
#include "StarStatusControllerLuaBindings.hpp" #include "StarStatusControllerLuaBindings.hpp"
#include "StarWidgetLuaBindings.hpp" #include "StarWidgetLuaBindings.hpp"
#include "StarAugmentItem.hpp" #include "StarAugmentItem.hpp"
#include "StarInput.hpp"
namespace Star { namespace Star {
@ -265,6 +266,7 @@ void ContainerPane::update(float dt) {
m_script->update(m_script->updateDt(dt)); m_script->update(m_script->updateDt(dt));
m_itemBag->clearItems(); m_itemBag->clearItems();
Input& input = Input::singleton();
if (!m_containerInteractor->containerOpen()) { if (!m_containerInteractor->containerOpen()) {
dismiss(); dismiss();
@ -296,6 +298,10 @@ void ContainerPane::update(float dt) {
fuelGauge->setPotentialFuelAmount(totalFuelAmount); fuelGauge->setPotentialFuelAmount(totalFuelAmount);
fuelGauge->setRequestedFuelAmount(0); fuelGauge->setRequestedFuelAmount(0);
} }
if (input.bindDown("opensb", "takeAll")) {
m_containerInteractor->clearContainer();
}
} }
} }
} }