Skip to content

Commit

Permalink
null terminate button strings
Browse files Browse the repository at this point in the history
refresh options window when toggling putt assist checkbox
  • Loading branch information
fallahn committed Jan 14, 2024
1 parent a8cb69e commit 4d88321
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions samples/golf/buildnumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
2 changes: 2 additions & 0 deletions samples/golf/src/golf/OptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<cro::AudioEmitter>().play();
m_scene.getActiveCamera().getComponent<cro::Camera>().active = true;
}
});

Expand Down Expand Up @@ -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<cro::AudioEmitter>().play();
m_scene.getActiveCamera().getComponent<cro::Camera>().active = true;
}
});

Expand Down
9 changes: 6 additions & 3 deletions samples/golf/src/golf/TextChat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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([&]()
{
Expand All @@ -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);
Expand Down

0 comments on commit 4d88321

Please sign in to comment.