From 4d88321a17cbe041db5027b6afb8a3027da64d07 Mon Sep 17 00:00:00 2001 From: fallahn Date: Sun, 14 Jan 2024 11:07:46 +0000 Subject: [PATCH] null terminate button strings refresh options window when toggling putt assist checkbox --- samples/golf/buildnumber.h | 4 ++-- samples/golf/src/golf/OptionsState.cpp | 2 ++ samples/golf/src/golf/TextChat.cpp | 9 ++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/samples/golf/buildnumber.h b/samples/golf/buildnumber.h index 3e85b99eb..999a99741 100644 --- a/samples/golf/buildnumber.h +++ b/samples/golf/buildnumber.h @@ -3,7 +3,7 @@ #ifndef BUILD_NUMBER_H_ #define BUILD_NUMBER_H_ -#define BUILDNUMBER 3730 -#define BUILDNUMBER_STR "3730" +#define BUILDNUMBER 3733 +#define BUILDNUMBER_STR "3733" #endif /* BUILD_NUMBER_H_ */ diff --git a/samples/golf/src/golf/OptionsState.cpp b/samples/golf/src/golf/OptionsState.cpp index b353495db..6b6aa7fa7 100644 --- a/samples/golf/src/golf/OptionsState.cpp +++ b/samples/golf/src/golf/OptionsState.cpp @@ -1935,6 +1935,7 @@ void OptionsState::buildAVMenu(cro::Entity parent, const cro::SpriteSheet& sprit { m_sharedData.showBeacon = !m_sharedData.showBeacon; m_audioEnts[AudioID::Accept].getComponent().play(); + m_scene.getActiveCamera().getComponent().active = true; } }); @@ -2125,6 +2126,7 @@ void OptionsState::buildAVMenu(cro::Entity parent, const cro::SpriteSheet& sprit { m_sharedData.showPuttingPower = !m_sharedData.showPuttingPower; m_audioEnts[AudioID::Accept].getComponent().play(); + m_scene.getActiveCamera().getComponent().active = true; } }); diff --git a/samples/golf/src/golf/TextChat.cpp b/samples/golf/src/golf/TextChat.cpp index 2620c68d5..809bc6358 100644 --- a/samples/golf/src/golf/TextChat.cpp +++ b/samples/golf/src/golf/TextChat.cpp @@ -152,25 +152,28 @@ TextChat::TextChat(cro::Scene& s, SharedStateData& sd) m_buttonStrings.applaud.resize(utf.size()); std::memcpy(m_buttonStrings.applaud.data(), utf.data(), utf.size()); + m_buttonStrings.applaud.push_back(0); str.clear(); str = std::uint32_t(0x1F600); utf = str.toUtf8(); m_buttonStrings.happy.resize(utf.size()); std::memcpy(m_buttonStrings.happy.data(), utf.data(), utf.size()); + m_buttonStrings.happy.push_back(0); str.clear(); str = std::uint32_t(0x1F923); utf = str.toUtf8(); m_buttonStrings.laughing.resize(utf.size()); std::memcpy(m_buttonStrings.laughing.data(), utf.data(), utf.size()); + m_buttonStrings.laughing.push_back(0); str.clear(); str = std::uint32_t(0x1F624); utf = str.toUtf8(); m_buttonStrings.angry.resize(utf.size()); std::memcpy(m_buttonStrings.angry.data(), utf.data(), utf.size()); - + m_buttonStrings.angry.push_back(0); registerWindow([&]() { @@ -184,8 +187,8 @@ TextChat::TextChat(cro::Scene& s, SharedStateData& sd) { if (m_showShortcuts) { - ImGui::Text("Quick Emotes"); - ImGui::Separator(); + ImGui::Text("Quick Emotes: "); + ImGui::SameLine(); if (ImGui::Button(m_buttonStrings.applaud.data())) { quickEmote(TextChat::Applaud);