Skip to content

Commit

Permalink
update chat sound effects
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Aug 25, 2023
1 parent 9751b8b commit ad103cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 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 1408
#define BUILDNUMBER_STR "1408"
#define BUILDNUMBER 1412
#define BUILDNUMBER_STR "1412"

#endif /* BUILD_NUMBER_H_ */
5 changes: 5 additions & 0 deletions samples/golf/src/golf/GolfSoundDirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ GolfSoundDirector::GolfSoundDirector(cro::AudioResource& ar)
"assets/golf/sound/ambience/foot04.wav",

"assets/golf/sound/bad.wav",
"assets/golf/sound/tutorial_appear.wav",

"assets/golf/sound/ambience/crowd_clear_throat.wav",
"assets/golf/sound/ambience/crowd_cough.wav",
Expand Down Expand Up @@ -577,6 +578,10 @@ void GolfSoundDirector::handleMessage(const cro::Message& msg)
playSound(AudioID::BadSport, glm::vec3(0.f), 0.8f).getComponent<cro::AudioEmitter>().setMixerChannel(MixerChannel::Effects);
playSoundDelayed(AudioID::NearMiss, glm::vec3(0.f), 1.f, 1.f, MixerChannel::Effects);
}
else if (data.type == SceneEvent::ChatMessage)
{
playSound(AudioID::Chat, glm::vec3(0.f), 0.3f).getComponent<cro::AudioEmitter>().setMixerChannel(MixerChannel::Menu);
}
}
break;
}
Expand Down
1 change: 1 addition & 0 deletions samples/golf/src/golf/GolfSoundDirector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class GolfSoundDirector final : public SoundEffectsDirector
Foot03,
Foot04,
BadSport,
Chat,

CrowdClearThroat,
CrowdCough,
Expand Down
3 changes: 3 additions & 0 deletions samples/golf/src/golf/GolfState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5492,6 +5492,9 @@ void GolfState::handleNetEvent(const net::NetEvent& evt)
default: break;
case PacketID::ChatMessage:
m_textChat.handlePacket(evt.packet);
{
postMessage<SceneEvent>(MessageID::SceneMessage)->type = SceneEvent::ChatMessage;
}
break;
case PacketID::FlagHit:
{
Expand Down
3 changes: 2 additions & 1 deletion samples/golf/src/golf/MessageIDs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ struct SceneEvent
PlayerIdle,
PlayerRotate,
PlayerBad,
MinimapUpdated
MinimapUpdated,
ChatMessage
}type = TransitionComplete;

//union
Expand Down

0 comments on commit ad103cf

Please sign in to comment.