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:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
|
1 | NO CONTENT: new file 100644, binary diff hidden |
@@ -161,6 +161,8 | |||
|
161 | 161 | |
|
162 | 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 | 166 | Sources for the procedural generation are documented in Sources.md. |
|
165 | 167 | |
|
166 | 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 | 28 | typeof(DialogChoiceMessage), |
|
29 | 29 | typeof(SetOptionMessage), |
|
30 | 30 | typeof(QuitGameMessage), |
|
31 |
typeof(ToggleToolMessage) |
|
|
31 | typeof(ToggleToolMessage), | |
|
32 | typeof(PlaySoundMessage))] | |
|
32 | 33 | [Reads(typeof(VisibilityComponent), |
|
33 | 34 | typeof(WindowTypeComponent), |
|
34 | 35 | typeof(TrespassingPolicyComponent), |
@@ -58,6 +59,7 | |||
|
58 | 59 | public List<GameRateMessage> gameRateMessages; |
|
59 | 60 | public List<QuitGameMessage> quitGameMessages; |
|
60 | 61 | public List<ToggleToolMessage> toggleToolMessages; |
|
62 | public List<PlaySoundMessage> playSoundMessages; | |
|
61 | 63 | |
|
62 | 64 | bool showBudget { get; } |
|
63 | 65 | bool showForest { get; } |
@@ -109,6 +111,7 | |||
|
109 | 111 | this.gameRateMessages = new List<GameRateMessage>(); |
|
110 | 112 | this.quitGameMessages = new List<QuitGameMessage>(); |
|
111 | 113 | this.toggleToolMessages = new List<ToggleToolMessage>(); |
|
114 | this.playSoundMessages = new List<PlaySoundMessage>(); | |
|
112 | 115 | |
|
113 | 116 | this.windowStatuses = new Dictionary<Window, bool>(); |
|
114 | 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 | 251 | foreach (var entity in ReadEntities<WindowTypeComponent>()) |
|
245 | 252 | { |
|
246 | 253 | var type = GetComponent<WindowTypeComponent>(entity).type; |
@@ -303,6 +310,7 | |||
|
303 | 310 | this.setOptionMessages.Clear(); |
|
304 | 311 | this.quitGameMessages.Clear(); |
|
305 | 312 | this.toggleToolMessages.Clear(); |
|
313 | this.playSoundMessages.Clear(); | |
|
306 | 314 | } |
|
307 | 315 | } |
|
308 | 316 | } |
@@ -192,14 +192,13 | |||
|
192 | 192 | this.batch = new SpriteBatch(GraphicsDevice); |
|
193 | 193 | this.tileBatch = new SpriteBatch(GraphicsDevice); |
|
194 | 194 | |
|
195 | // #if DEBUG | |
|
196 | 195 | this.sound = SoundEffectEngine.LoadSound(Content, "FNASound"); |
|
197 | 196 | SoundEffectEngine.LoadSound(Content, "Click"); |
|
198 | 197 | SoundEffectEngine.LoadSound(Content, "ClickPart1"); |
|
199 | 198 | SoundEffectEngine.LoadSound(Content, "ClickPart2"); |
|
200 | 199 | SoundEffectEngine.LoadSound(Content, "Construction"); |
|
201 | 200 | SoundEffectEngine.LoadSound(Content, "ConstructionShort"); |
|
202 | // #endif | |
|
201 | SoundEffectEngine.LoadSound(Content, "Bell"); | |
|
203 | 202 | Tile.TileSetTexture = Content.Load<Texture2D>(@"merged_tileset"); |
|
204 | 203 | var texture = Content.Load<Texture2D>(@"solid_tileset"); |
|
205 | 204 |
@@ -1,12 +1,9 | |||
|
1 | 1 | using Microsoft.Xna.Framework.Audio; |
|
2 | 2 | |
|
3 | ||
|
4 | 3 | using Encompass; |
|
5 | 4 | |
|
6 | ||
|
7 | 5 | namespace isometricparkfna.Messages |
|
8 | 6 | { |
|
9 | ||
|
10 | 7 | public struct PlaySoundMessage : IMessage |
|
11 | 8 | { |
|
12 | 9 | public string SoundName; |
@@ -20,8 +20,8 | |||
|
20 | 20 | |
|
21 | 21 | public static bool newFullscreen; |
|
22 | 22 | public static Vector2 newResolution; |
|
23 |
|
|
|
24 |
|
|
|
23 | public static float newSoundEffectVolume; | |
|
24 | public static bool newSoundEffectsMute; | |
|
25 | 25 | |
|
26 | 26 | private static string fontName = "Iosevka"; |
|
27 | 27 | private static int fontSize = 15; |
@@ -34,8 +34,10 | |||
|
34 | 34 | private static string origFontName = OptionsWindow.fontName; |
|
35 | 35 | private static int origFontSize = OptionsWindow.fontSize; |
|
36 | 36 | private static ProfanityLevel origProfanityLevel = OptionsWindow.profanityLevel; |
|
37 |
|
|
|
38 |
|
|
|
37 | private static float origSoundEffectVolume; | |
|
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 | 42 | public static void Initialize(Vector2 resolution, bool fullscreen, ProfanityLevel profanityLevel, Options startingOptions) |
|
41 | 43 | { |
@@ -44,8 +46,9 | |||
|
44 | 46 | OptionsWindow.newResolution = resolution; |
|
45 | 47 | OptionsWindow.profanityLevel = profanityLevel; |
|
46 | 48 | |
|
47 |
|
|
|
48 |
|
|
|
49 | newSoundEffectVolume = startingOptions.SoundEffectVolume; | |
|
50 | newSoundEffectsMute = startingOptions.SoundEffectMuted; | |
|
51 | prevSoundEffectVolume = startingOptions.SoundEffectVolume; | |
|
49 | 52 | } |
|
50 | 53 | |
|
51 | 54 | public static void Render(ImFontPtr font, ImFontPtr italicFont, ImGuiWindowBridgeEngine bridgeEngine, int width) |
@@ -153,10 +156,15 | |||
|
153 | 156 | |
|
154 | 157 | ImGui.SameLine(); |
|
155 | 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 | 165 | ImGui.SameLine(); |
|
157 | 166 | ImGui.Checkbox("Mute", ref newSoundEffectsMute); |
|
158 | 167 | |
|
159 | ||
|
160 | 168 | ImGui.Separator(); |
|
161 | 169 | |
|
162 | 170 | ImGui.PushFont(italicFont); |
@@ -101,6 +101,9 | |||
|
101 | 101 | <None Include="Content\Construction.wav"> |
|
102 | 102 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
103 | 103 | </None> |
|
104 | <None Include="Content\Bell.wav"> | |
|
105 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
|
106 | </None> | |
|
104 | 107 | <None Include="packages.config" /> |
|
105 | 108 | <!-- <None Include="Content\part4_tileset.png"> --> |
|
106 | 109 | <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> --> |
You need to be logged in to leave comments.
Login now