Description:
Tweak sound.
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 |
|
NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -46,10 +46,12 | |||||
|
46 | private int height; |
|
46 | private int height; |
|
47 | private int width; |
|
47 | private int width; |
|
48 |
|
48 | ||
|
49 | private SoundEffect sound; |
|
49 | private SoundEffect startSound; |
|
|
50 | private SoundEffect endSound; | ||
|
50 |
|
51 | ||
|
51 | public InputEngine(int menuBarHeight, Camera camera, |
|
52 | public InputEngine(int menuBarHeight, Camera camera, |
|
52 |
GraphicsDeviceManager gdm, int height, int width, |
|
53 | GraphicsDeviceManager gdm, int height, int width, |
|
|
54 | SoundEffect startSound, SoundEffect endSound) { | ||
|
53 | //initialize to blank for now |
|
55 | //initialize to blank for now |
|
54 | this.keyboardPrev = new KeyboardState(); |
|
56 | this.keyboardPrev = new KeyboardState(); |
|
55 | this.menuBarHeight = menuBarHeight; |
|
57 | this.menuBarHeight = menuBarHeight; |
@@ -58,7 +60,8 | |||||
|
58 | this.graphicsDevice = gdm.GraphicsDevice; |
|
60 | this.graphicsDevice = gdm.GraphicsDevice; |
|
59 | this.height = height; |
|
61 | this.height = height; |
|
60 | this.width = width; |
|
62 | this.width = width; |
|
61 | this.sound = sound; |
|
63 | this.startSound = startSound; |
|
|
64 | this.endSound = endSound; | ||
|
62 | } |
|
65 | } |
|
63 |
|
66 | ||
|
64 |
|
67 | ||
@@ -308,7 +311,10 | |||||
|
308 | } |
|
311 | } |
|
309 | else if (ImGui.IsAnyItemHovered()) { |
|
312 | else if (ImGui.IsAnyItemHovered()) { |
|
310 | if (mouseCur.LeftButton == ButtonState.Pressed && mousePrev.LeftButton == ButtonState.Released) { |
|
313 | if (mouseCur.LeftButton == ButtonState.Pressed && mousePrev.LeftButton == ButtonState.Released) { |
|
311 | this.sound.Play(1.0f, 0.0f, 0.0f); |
|
314 | this.startSound.Play(1.0f, 0.0f, 0.0f); |
|
|
315 | } | ||
|
|
316 | else if (mouseCur.LeftButton == ButtonState.Released && mousePrev.LeftButton == ButtonState.Pressed) { | ||
|
|
317 | this.endSound.Play(1.0f, 0.0f, 0.0f); | ||
|
312 | } |
|
318 | } |
|
313 | } |
|
319 | } |
|
314 |
|
320 |
@@ -46,7 +46,8 | |||||
|
46 | private SpriteBatch tileBatch; |
|
46 | private SpriteBatch tileBatch; |
|
47 | // #if DEBUG |
|
47 | // #if DEBUG |
|
48 | private SoundEffect sound; |
|
48 | private SoundEffect sound; |
|
49 | private SoundEffect clickSound; |
|
49 | private SoundEffect clickStartSound; |
|
|
50 | private SoundEffect clickEndSound; | ||
|
50 | // #endif |
|
51 | // #endif |
|
51 | private SpriteFont monoFont; |
|
52 | private SpriteFont monoFont; |
|
52 | private SpriteFont largeMonoFont; |
|
53 | private SpriteFont largeMonoFont; |
@@ -196,7 +197,9 | |||||
|
196 |
|
197 | ||
|
197 | // #if DEBUG |
|
198 | // #if DEBUG |
|
198 | this.sound = Content.Load<SoundEffect>("FNASound"); |
|
199 | this.sound = Content.Load<SoundEffect>("FNASound"); |
|
199 | this.clickSound = Content.Load<SoundEffect>("Click"); |
|
200 | // this.clickSound = Content.Load<SoundEffect>("Click"); |
|
|
201 | this.clickStartSound = Content.Load<SoundEffect>("ClickPart1"); | ||
|
|
202 | this.clickEndSound = Content.Load<SoundEffect>("ClickPart2"); | ||
|
200 | // #endif |
|
203 | // #endif |
|
201 | Tile.TileSetTexture = Content.Load<Texture2D>(@"merged_tileset"); |
|
204 | Tile.TileSetTexture = Content.Load<Texture2D>(@"merged_tileset"); |
|
202 | var texture = Content.Load<Texture2D>(@"solid_tileset"); |
|
205 | var texture = Content.Load<Texture2D>(@"solid_tileset"); |
@@ -268,7 +271,8 | |||||
|
268 | Logging.Debug(this.Story.ContinueMaximally()); |
|
271 | Logging.Debug(this.Story.ContinueMaximally()); |
|
269 |
|
272 | ||
|
270 | WorldBuilder.AddEngine(new InputEngine(Menu.MENU_BAR_HEIGHT, this.camera, gdm, |
|
273 | WorldBuilder.AddEngine(new InputEngine(Menu.MENU_BAR_HEIGHT, this.camera, gdm, |
|
271 |
this.simulation.map.MapHeight, this.simulation.map.MapWidth, |
|
274 | this.simulation.map.MapHeight, this.simulation.map.MapWidth, |
|
|
275 | this.clickStartSound, this.clickEndSound)); | ||
|
272 | WorldBuilder.AddEngine(new UIEngine(this.Story)); |
|
276 | WorldBuilder.AddEngine(new UIEngine(this.Story)); |
|
273 | WorldBuilder.AddEngine(new DialogEngine(this.Story, this.grammar)); |
|
277 | WorldBuilder.AddEngine(new DialogEngine(this.Story, this.grammar)); |
|
274 |
|
278 | ||
@@ -428,7 +432,8 | |||||
|
428 | batch.Dispose(); |
|
432 | batch.Dispose(); |
|
429 | // #if DEBUG |
|
433 | // #if DEBUG |
|
430 | sound.Dispose(); |
|
434 | sound.Dispose(); |
|
431 | clickSound.Dispose(); |
|
435 | clickStartSound.Dispose(); |
|
|
436 | clickEndSound.Dispose(); | ||
|
432 | // #endif |
|
437 | // #endif |
|
433 | Tile.TileSetTexture.Dispose(); |
|
438 | Tile.TileSetTexture.Dispose(); |
|
434 | Logging.Success("Disposed of Tile texture."); |
|
439 | Logging.Success("Disposed of Tile texture."); |
@@ -92,6 +92,12 | |||||
|
92 | <None Include="Content\Click.wav"> |
|
92 | <None Include="Content\Click.wav"> |
|
93 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
93 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|
94 | </None> |
|
94 | </None> |
|
|
95 | <None Include="Content\ClickPart1.wav"> | ||
|
|
96 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
|
|
97 | </None> | ||
|
|
98 | <None Include="Content\ClickPart2.wav"> | ||
|
|
99 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
|
|
100 | </None> | ||
|
95 | <None Include="packages.config" /> |
|
101 | <None Include="packages.config" /> |
|
96 | <!-- <None Include="Content\part4_tileset.png"> --> |
|
102 | <!-- <None Include="Content\part4_tileset.png"> --> |
|
97 | <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> --> |
|
103 | <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> --> |
You need to be logged in to leave comments.
Login now