Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarActionBar.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-30 00:11:16 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-30 00:11:16 +1000
commit057f3727deb83a768a45ad3b91282166683e039d (patch)
tree2179468fd3af276cf816ff42049e4af8e6d33bab /source/frontend/StarActionBar.cpp
parent40a2fe57e038c60fc8d61df6faed01567cd4e515 (diff)
Bottom Action Bar
Diffstat (limited to 'source/frontend/StarActionBar.cpp')
-rw-r--r--source/frontend/StarActionBar.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/frontend/StarActionBar.cpp b/source/frontend/StarActionBar.cpp
index 82eb7d2..acaa3d1 100644
--- a/source/frontend/StarActionBar.cpp
+++ b/source/frontend/StarActionBar.cpp
@@ -12,6 +12,7 @@
#include "StarPlayer.hpp"
#include "StarPlayerInventory.hpp"
#include "StarAssets.hpp"
+#include "StarImageMetadataDatabase.hpp"
#include "StarItem.hpp"
#include "StarMerchantInterface.hpp"
@@ -50,7 +51,29 @@ ActionBar::ActionBar(MainInterfacePaneManager* paneManager, PlayerPtr player) {
swapCustomBar();
});
+ auto configuration = Root::singleton().configuration();
+ bool bottomBar = configuration->getPath("inventory.bottomActionBar").optBool().value(false);
+ if (bottomBar)
+ m_config = jsonMerge(m_config, assets->json("/interface/windowconfig/actionbarbottom.config"));
+
reader.construct(m_config.get("paneLayout"), this);
+ if (bottomBar) {
+ setAnchor(PaneAnchor::CenterBottom);
+ m_anchorOffset[1] *= -1;
+
+ if (!m_bgBody.empty())
+ m_bgBody += "?flipy";
+ if (!m_bgHeader.empty())
+ m_bgHeader += "?flipy";
+ if (!m_bgFooter.empty())
+ m_bgFooter += "?flipy";
+ swap(m_bgHeader, m_bgFooter);
+
+ for (auto& child : m_members) {
+ auto position = child->relativePosition();
+ child->setPosition({position[0], m_bodySize[1] - position[1] - child->size()[1] + 1});
+ }
+ }
for (uint8_t i = 0; i < m_player->inventory()->customBarIndexes(); ++i) {
auto customBarLeft = fetchChild<ItemSlotWidget>(strf("customBar{}L", i + 1));