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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/opensb/interface.config.patch3
-rw-r--r--source/frontend/StarInventory.cpp16
-rw-r--r--source/frontend/StarTeamBar.cpp13
-rw-r--r--source/frontend/StarTeamBar.hpp3
4 files changed, 23 insertions, 12 deletions
diff --git a/assets/opensb/interface.config.patch b/assets/opensb/interface.config.patch
index b725639..8031217 100644
--- a/assets/opensb/interface.config.patch
+++ b/assets/opensb/interface.config.patch
@@ -23,5 +23,6 @@
"buttonHoverSound" : [ "/sfx/interface/button/hover.wav" ],
"buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ],
- "debugSpatialClearTime" : 0.0
+ "debugSpatialClearTime" : 0.0,
+ "debugOffset" : [32, 100]
} \ No newline at end of file
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp
index e54f288..a5a17e1 100644
--- a/source/frontend/StarInventory.cpp
+++ b/source/frontend/StarInventory.cpp
@@ -286,10 +286,12 @@ void InventoryPane::update() {
}
if (ItemPtr swapSlot = inventory->swapSlotItem()) {
- for (auto pair : m_itemGrids) {
- if (pair.first != m_selectedTab && PlayerInventory::itemAllowedInBag(swapSlot, pair.first)) {
- selectTab(pair.first);
- break;
+ if (!PlayerInventory::itemAllowedInBag(swapSlot, m_selectedTab)) {
+ for (auto& pair : m_itemGrids) {
+ if (pair.first != m_selectedTab && PlayerInventory::itemAllowedInBag(swapSlot, pair.first)) {
+ selectTab(pair.first);
+ break;
+ }
}
}
}
@@ -304,14 +306,14 @@ void InventoryPane::update() {
m_itemGrids[m_selectedTab]->clearChangedSlots();
- for (auto pair : m_newItemMarkers) {
+ for (auto& pair : m_newItemMarkers) {
if (m_itemGrids[pair.first]->slotsChanged())
pair.second->show();
else
pair.second->hide();
}
- for (auto techOverlay : m_disabledTechOverlays)
+ for (auto& techOverlay : m_disabledTechOverlays)
techOverlay->setVisibility(m_player->techOverridden());
auto healthLabel = fetchChild<LabelWidget>("healthtext");
@@ -408,6 +410,8 @@ void InventoryPane::update() {
context->playAudio(RandomSource().randFrom(m_putDownSounds));
m_currentSwapSlotItem = {};
}
+
+ m_title = m_player->name();
}
void InventoryPane::selectTab(String const& selected) {
diff --git a/source/frontend/StarTeamBar.cpp b/source/frontend/StarTeamBar.cpp
index 6091d9c..8bdd3b3 100644
--- a/source/frontend/StarTeamBar.cpp
+++ b/source/frontend/StarTeamBar.cpp
@@ -40,7 +40,7 @@ TeamBar::TeamBar(MainInterface* mainInterface, UniverseClientPtr client) {
return;
auto position = jsonToVec2I(Root::singleton().assets()->json("/interface/windowconfig/teambar.config:selfMenuOffset"));
position[1] += windowHeight() / m_guiContext->interfaceScale();
- showMemberMenu(m_client->mainPlayer()->uuid(), position);
+ showMemberMenu(m_client->mainPlayer()->clientContext()->serverUuid(), position);
});
reader.construct(assets->json("/interface/windowconfig/teambar.config:paneLayout"), this);
@@ -48,6 +48,7 @@ TeamBar::TeamBar(MainInterface* mainInterface, UniverseClientPtr client) {
m_healthBar = fetchChild<ProgressWidget>("healthBar");
m_energyBar = fetchChild<ProgressWidget>("energyBar");
m_foodBar = fetchChild<ProgressWidget>("foodBar");
+ m_nameLabel = fetchChild<LabelWidget>("name");
m_energyBarColor = jsonToColor(assets->json("/interface/windowconfig/teambar.config:energyBarColor"));
m_energyBarRegenMixColor = jsonToColor(assets->json("/interface/windowconfig/teambar.config:energyBarRegenMixColor"));
@@ -58,8 +59,7 @@ TeamBar::TeamBar(MainInterface* mainInterface, UniverseClientPtr client) {
auto playerPortrait = fetchChild<PortraitWidget>("portrait");
playerPortrait->setEntity(as<PortraitEntity>(m_client->mainPlayer()));
- fetchChild<LabelWidget>("name")->setText(m_client->mainPlayer()->name());
-
+ updatePlayerResources();
disableScissoring();
}
@@ -131,6 +131,8 @@ void TeamBar::updatePlayerResources() {
} else {
m_energyBar->setColor(m_energyBarColor.mix(m_energyBarRegenMixColor, player->energyRegenBlockPercent()));
}
+
+ m_nameLabel->setText(m_client->mainPlayer()->name());
}
void TeamBar::inviteButton() {
@@ -153,8 +155,9 @@ void TeamBar::buildTeamBar() {
int memberSize = assets->json("/interface/windowconfig/teambar.config:memberSize").toInt();
int memberSpacing = assets->json("/interface/windowconfig/teambar.config:memberSpacing").toInt();
+ Uuid myUuid = player->clientContext()->serverUuid();
for (auto member : teamClient->members()) {
- if (member.uuid == player->uuid()) {
+ if (member.uuid == myUuid) {
memberIndex++;
continue;
}
@@ -357,7 +360,7 @@ void TeamMemberMenu::update() {
void TeamMemberMenu::updateWidgets() {
bool isLeader = m_owner->m_client->teamClient()->isTeamLeader();
- bool isSelf = m_owner->m_client->mainPlayer()->uuid() == m_memberUuid;
+ bool isSelf = m_owner->m_client->mainPlayer()->clientContext()->serverUuid() == m_memberUuid;
fetchChild<ButtonWidget>("beamToShip")->setEnabled(m_canBeam);
fetchChild<ButtonWidget>("makeLeader")->setEnabled(isLeader && !isSelf);
diff --git a/source/frontend/StarTeamBar.hpp b/source/frontend/StarTeamBar.hpp
index d781547..8273ab6 100644
--- a/source/frontend/StarTeamBar.hpp
+++ b/source/frontend/StarTeamBar.hpp
@@ -5,6 +5,7 @@
#include "StarUuid.hpp"
#include "StarMainInterfaceTypes.hpp"
#include "StarProgressWidget.hpp"
+#include "StarLabelWidget.hpp"
namespace Star {
@@ -103,6 +104,8 @@ private:
ProgressWidgetPtr m_energyBar;
ProgressWidgetPtr m_foodBar;
+ LabelWidgetPtr m_nameLabel;
+
Color m_energyBarColor;
Color m_energyBarRegenMixColor;
Color m_energyBarUnusableColor;