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

summaryrefslogtreecommitdiff
path: root/source/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend')
-rw-r--r--source/frontend/StarClientCommandProcessor.cpp6
-rw-r--r--source/frontend/StarClientCommandProcessor.hpp1
-rw-r--r--source/frontend/StarInventory.cpp7
3 files changed, 11 insertions, 3 deletions
diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp
index 7671a00..c19c68f 100644
--- a/source/frontend/StarClientCommandProcessor.cpp
+++ b/source/frontend/StarClientCommandProcessor.cpp
@@ -20,6 +20,7 @@ ClientCommandProcessor::ClientCommandProcessor(UniverseClientPtr universeClient,
m_paneManager(paneManager), m_macroCommands(std::move(macroCommands)) {
m_builtinCommands = {
{"reload", bind(&ClientCommandProcessor::reload, this)},
+ {"hotReload", bind(&ClientCommandProcessor::hotReload, this)},
{"whoami", bind(&ClientCommandProcessor::whoami, this)},
{"gravity", bind(&ClientCommandProcessor::gravity, this)},
{"debug", bind(&ClientCommandProcessor::debug, this, _1)},
@@ -128,6 +129,11 @@ String ClientCommandProcessor::reload() {
return "Client Star::Root reloaded";
}
+String ClientCommandProcessor::hotReload() {
+ Root::singleton().hotReload();
+ return "Hot-reloaded assets";
+}
+
String ClientCommandProcessor::whoami() {
return strf("Client: You are {}. You are {}an Admin.",
m_universeClient->mainPlayer()->name(), m_universeClient->mainPlayer()->isAdmin() ? "" : "not ");
diff --git a/source/frontend/StarClientCommandProcessor.hpp b/source/frontend/StarClientCommandProcessor.hpp
index c3978a4..df60b96 100644
--- a/source/frontend/StarClientCommandProcessor.hpp
+++ b/source/frontend/StarClientCommandProcessor.hpp
@@ -26,6 +26,7 @@ private:
String previewQuestPane(StringList const& arguments, function<PanePtr(QuestPtr)> createPane);
String reload();
+ String hotReload();
String whoami();
String gravity();
String debug(String const& argumentsString);
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp
index 3730c9b..1c42a0d 100644
--- a/source/frontend/StarInventory.cpp
+++ b/source/frontend/StarInventory.cpp
@@ -450,12 +450,13 @@ void InventoryPane::update(float dt) {
}
if (auto item = inventory->swapSlotItem()) {
+ float pitch = 1.f - ((float)item->count() / (float)item->maxStack()) * .2f;
if (!m_currentSwapSlotItem || !item->matches(*m_currentSwapSlotItem, true))
- context->playAudio(RandomSource().randFrom(m_pickUpSounds));
+ context->playAudio(RandomSource().randFrom(m_pickUpSounds), 0, 1.f, pitch);
else if (item->count() > m_currentSwapSlotItem->count())
- context->playAudio(RandomSource().randFrom(m_someUpSounds));
+ context->playAudio(RandomSource().randFrom(m_someUpSounds), 0, 1.f, pitch);
else if (item->count() < m_currentSwapSlotItem->count())
- context->playAudio(RandomSource().randFrom(m_someDownSounds));
+ context->playAudio(RandomSource().randFrom(m_someDownSounds), 0, 1.f, pitch);
m_currentSwapSlotItem = item->descriptor();
} else {