Description:
Play a sound after setting the audio so the user knows what the level's at. Using a counter bell noise for now.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r653:1798373917e7 -

1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -161,6 +161,8
161
161
162 Fonts: Droid Sans, [Iosevka,](https://typeof.net/Iosevka/), [Typicons by Stephen Hutchings](https://www.s-ings.com/typicons/), [OCRA}() designed by American Type Founders and converted by Matthew Skala
162 Fonts: Droid Sans, [Iosevka,](https://typeof.net/Iosevka/), [Typicons by Stephen Hutchings](https://www.s-ings.com/typicons/), [OCRA}() designed by American Type Founders and converted by Matthew Skala
163
163
164 Sounds: Bell by InspectorJ.
165
164 Sources for the procedural generation are documented in Sources.md.
166 Sources for the procedural generation are documented in Sources.md.
165
167
166 Watching ThinMatrix's [video devlogs](https://www.youtube.com/watch?v=90CZ7Q17sls&list=PLRIWtICgwaX1gcSZ8qj8Q473tz7PsNmpR) for Equilinox and his subsequent games inspired me to press on. :) Despite some similarities, the design of this game wasn't really inspired by Equilinox. (I've also enjoyed Thoughtquake's [video devlogs](https://www.youtube.com/user/Thoughtquake/videos) and Cliff Harris' Democracy 4 [video devlogs](https://www.youtube.com/user/cliffski2/videos)).
168 Watching ThinMatrix's [video devlogs](https://www.youtube.com/watch?v=90CZ7Q17sls&list=PLRIWtICgwaX1gcSZ8qj8Q473tz7PsNmpR) for Equilinox and his subsequent games inspired me to press on. :) Despite some similarities, the design of this game wasn't really inspired by Equilinox. (I've also enjoyed Thoughtquake's [video devlogs](https://www.youtube.com/user/Thoughtquake/videos) and Cliff Harris' Democracy 4 [video devlogs](https://www.youtube.com/user/cliffski2/videos)).
@@ -28,7 +28,8
28 typeof(DialogChoiceMessage),
28 typeof(DialogChoiceMessage),
29 typeof(SetOptionMessage),
29 typeof(SetOptionMessage),
30 typeof(QuitGameMessage),
30 typeof(QuitGameMessage),
31 typeof(ToggleToolMessage))]
31 typeof(ToggleToolMessage),
32 typeof(PlaySoundMessage))]
32 [Reads(typeof(VisibilityComponent),
33 [Reads(typeof(VisibilityComponent),
33 typeof(WindowTypeComponent),
34 typeof(WindowTypeComponent),
34 typeof(TrespassingPolicyComponent),
35 typeof(TrespassingPolicyComponent),
@@ -58,6 +59,7
58 public List<GameRateMessage> gameRateMessages;
59 public List<GameRateMessage> gameRateMessages;
59 public List<QuitGameMessage> quitGameMessages;
60 public List<QuitGameMessage> quitGameMessages;
60 public List<ToggleToolMessage> toggleToolMessages;
61 public List<ToggleToolMessage> toggleToolMessages;
62 public List<PlaySoundMessage> playSoundMessages;
61
63
62 bool showBudget { get; }
64 bool showBudget { get; }
63 bool showForest { get; }
65 bool showForest { get; }
@@ -109,6 +111,7
109 this.gameRateMessages = new List<GameRateMessage>();
111 this.gameRateMessages = new List<GameRateMessage>();
110 this.quitGameMessages = new List<QuitGameMessage>();
112 this.quitGameMessages = new List<QuitGameMessage>();
111 this.toggleToolMessages = new List<ToggleToolMessage>();
113 this.toggleToolMessages = new List<ToggleToolMessage>();
114 this.playSoundMessages = new List<PlaySoundMessage>();
112
115
113 this.windowStatuses = new Dictionary<Window, bool>();
116 this.windowStatuses = new Dictionary<Window, bool>();
114 this.toolStatuses = new Dictionary<Tool, bool>();
117 this.toolStatuses = new Dictionary<Tool, bool>();
@@ -241,6 +244,10
241
244
242 }
245 }
243
246
247 foreach (var message in this.playSoundMessages) {
248 SendMessage(message);
249 }
250
244 foreach (var entity in ReadEntities<WindowTypeComponent>())
251 foreach (var entity in ReadEntities<WindowTypeComponent>())
245 {
252 {
246 var type = GetComponent<WindowTypeComponent>(entity).type;
253 var type = GetComponent<WindowTypeComponent>(entity).type;
@@ -303,6 +310,7
303 this.setOptionMessages.Clear();
310 this.setOptionMessages.Clear();
304 this.quitGameMessages.Clear();
311 this.quitGameMessages.Clear();
305 this.toggleToolMessages.Clear();
312 this.toggleToolMessages.Clear();
313 this.playSoundMessages.Clear();
306 }
314 }
307 }
315 }
308 }
316 }
@@ -192,14 +192,13
192 this.batch = new SpriteBatch(GraphicsDevice);
192 this.batch = new SpriteBatch(GraphicsDevice);
193 this.tileBatch = new SpriteBatch(GraphicsDevice);
193 this.tileBatch = new SpriteBatch(GraphicsDevice);
194
194
195 // #if DEBUG
196 this.sound = SoundEffectEngine.LoadSound(Content, "FNASound");
195 this.sound = SoundEffectEngine.LoadSound(Content, "FNASound");
197 SoundEffectEngine.LoadSound(Content, "Click");
196 SoundEffectEngine.LoadSound(Content, "Click");
198 SoundEffectEngine.LoadSound(Content, "ClickPart1");
197 SoundEffectEngine.LoadSound(Content, "ClickPart1");
199 SoundEffectEngine.LoadSound(Content, "ClickPart2");
198 SoundEffectEngine.LoadSound(Content, "ClickPart2");
200 SoundEffectEngine.LoadSound(Content, "Construction");
199 SoundEffectEngine.LoadSound(Content, "Construction");
201 SoundEffectEngine.LoadSound(Content, "ConstructionShort");
200 SoundEffectEngine.LoadSound(Content, "ConstructionShort");
202 // #endif
201 SoundEffectEngine.LoadSound(Content, "Bell");
203 Tile.TileSetTexture = Content.Load<Texture2D>(@"merged_tileset");
202 Tile.TileSetTexture = Content.Load<Texture2D>(@"merged_tileset");
204 var texture = Content.Load<Texture2D>(@"solid_tileset");
203 var texture = Content.Load<Texture2D>(@"solid_tileset");
205
204
@@ -1,12 +1,9
1 using Microsoft.Xna.Framework.Audio;
1 using Microsoft.Xna.Framework.Audio;
2
2
3
4 using Encompass;
3 using Encompass;
5
4
6
7 namespace isometricparkfna.Messages
5 namespace isometricparkfna.Messages
8 {
6 {
9
10 public struct PlaySoundMessage : IMessage
7 public struct PlaySoundMessage : IMessage
11 {
8 {
12 public string SoundName;
9 public string SoundName;
@@ -20,8 +20,8
20
20
21 public static bool newFullscreen;
21 public static bool newFullscreen;
22 public static Vector2 newResolution;
22 public static Vector2 newResolution;
23 public static float newSoundEffectVolume;
23 public static float newSoundEffectVolume;
24 public static bool newSoundEffectsMute;
24 public static bool newSoundEffectsMute;
25
25
26 private static string fontName = "Iosevka";
26 private static string fontName = "Iosevka";
27 private static int fontSize = 15;
27 private static int fontSize = 15;
@@ -34,8 +34,10
34 private static string origFontName = OptionsWindow.fontName;
34 private static string origFontName = OptionsWindow.fontName;
35 private static int origFontSize = OptionsWindow.fontSize;
35 private static int origFontSize = OptionsWindow.fontSize;
36 private static ProfanityLevel origProfanityLevel = OptionsWindow.profanityLevel;
36 private static ProfanityLevel origProfanityLevel = OptionsWindow.profanityLevel;
37 private static float origSoundEffectVolume;
37 private static float origSoundEffectVolume;
38 private static bool origSoundEffectsMute;
38 private static bool origSoundEffectsMute;
39
40 private static float prevSoundEffectVolume; //Tracks the previously set. (As opposed to origSoundEffectVolume, which is the previously *applied* volume.
39
41
40 public static void Initialize(Vector2 resolution, bool fullscreen, ProfanityLevel profanityLevel, Options startingOptions)
42 public static void Initialize(Vector2 resolution, bool fullscreen, ProfanityLevel profanityLevel, Options startingOptions)
41 {
43 {
@@ -44,8 +46,9
44 OptionsWindow.newResolution = resolution;
46 OptionsWindow.newResolution = resolution;
45 OptionsWindow.profanityLevel = profanityLevel;
47 OptionsWindow.profanityLevel = profanityLevel;
46
48
47 newSoundEffectVolume = startingOptions.SoundEffectVolume;
49 newSoundEffectVolume = startingOptions.SoundEffectVolume;
48 newSoundEffectsMute = startingOptions.SoundEffectMuted;
50 newSoundEffectsMute = startingOptions.SoundEffectMuted;
51 prevSoundEffectVolume = startingOptions.SoundEffectVolume;
49 }
52 }
50
53
51 public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine bridgeEngine, int width)
54 public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine bridgeEngine, int width)
@@ -153,10 +156,15
153
156
154 ImGui.SameLine();
157 ImGui.SameLine();
155 ImGui.DragFloat("##Sfx", ref newSoundEffectVolume, 0.005f, 0.0f, 1.0f, "%.2f");
158 ImGui.DragFloat("##Sfx", ref newSoundEffectVolume, 0.005f, 0.0f, 1.0f, "%.2f");
159
160 if ((newSoundEffectVolume != prevSoundEffectVolume) && ImGui.IsItemDeactivatedAfterEdit()) {
161 bridgeEngine.playSoundMessages.Add(new PlaySoundMessage { SoundName = "Bell" });
162 prevSoundEffectVolume = newSoundEffectVolume;
163 }
164
156 ImGui.SameLine();
165 ImGui.SameLine();
157 ImGui.Checkbox("Mute", ref newSoundEffectsMute);
166 ImGui.Checkbox("Mute", ref newSoundEffectsMute);
158
167
159
160 ImGui.Separator();
168 ImGui.Separator();
161
169
162 ImGui.PushFont(italicFont);
170 ImGui.PushFont(italicFont);
@@ -101,6 +101,9
101 <None Include="Content\Construction.wav">
101 <None Include="Content\Construction.wav">
102 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
102 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
103 </None>
103 </None>
104 <None Include="Content\Bell.wav">
105 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
106 </None>
104 <None Include="packages.config" />
107 <None Include="packages.config" />
105 <!-- <None Include="Content\part4_tileset.png"> -->
108 <!-- <None Include="Content\part4_tileset.png"> -->
106 <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -->
109 <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -->
You need to be logged in to leave comments. Login now