Skip to content

Commit

Permalink
Fixed mute button https://trello.com/c/iRjVkIty (#29)
Browse files Browse the repository at this point in the history
* Added Basic Sound On Interactions

- Some notifications will produce a click on closing
- Opening Notifications produce a click
- When an error occurs an error sound will play
- After creating a project an confirmation sound will play

* Added sound to most window button interactions

To Do:
- Add sound to tool bar
- Search and replace needs sound
- Compact Prettier Options need sound
- Better sound implementation (define the source in one place in case a sound wants to be changed)
- Add A system in case too many sounds want to play at once (in case of many errors)

* Built Project

* Audio Manager and Mute Setting

- Added audio manager class to app
- Added settings section and toggle to mute audio manager
- Audio manager only allows 1 sound to play at a time to stop duplicate sounds.
- Audio manager also allows for a global change in volume between all sounds

* Added clicks to a few more elements

- added click to most sidebars
- added clicks to most buttons and toggles

* Updated audio settings tab icon

* Removed Commented Lines And Fixed Mute Button

* Stopped error that was caused by audio manager

I removed the audio manager instance from app.ts and all the lines that are calling an audio from app so I can fix the error in the meantime.

* My Bad I forgot about this part

* This is the last line of code that should give an error

* checkpoint

* found error source

* removed conflict

* fixed conflict again?

* Reverted changes for real

* Removed Commented Lines

* Fixed Audio Manager Mute Setting

Changed en.ts to make mute button more clear. Fixed wierd sound logic when using the mute setting.

* Possible fix for missing audio in build

* potential fix for #30

* Possibly Fixed audio manager looking in wrong directory?

* Delete click5.ogg
  • Loading branch information
outercloudstudio committed Jun 3, 2021
1 parent eb0f1c2 commit 39400f5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 29 deletions.
31 changes: 21 additions & 10 deletions public/changelog.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
<h2>Features:</h2>
<ul>
<li>JSON schemas
<ul>
<li>Updated to latest beta</li>
<li>Added subject &quot;item&quot;</li>
<li>Moved features to correct format version</li>
</ul>
</li>
<li>Added option to choose texture &amp; model for the blank entity preset</li>
<li>Added first, basic version of bridge. v2's tree editor
<ul>
<li>Focus delegation is not working correctly yet</li>
<li>Auto-completions are not available yet</li>
</ul>
</li>
</ul>
<h2>Changes:</h2>
<ul>
<li>Brought back middle click to dispose notification</li>
<li>Project target versions are now showing in reverse order</li>
<li>Removed old select project folder window</li>
<li>Updated Dutch translations (Thanks to @pascal541)</li>
<li>Updated valid MoLang locations</li>
</ul>
<h2>Fixes:</h2>
<ul>
<li>Fixed data build error</li>
<li>Fixed project config auto-completions</li>
<li>Fixed project config creation (structure now follows spec)</li>
<li>Fixed bridge. not ignoring .git folder</li>
<li>Fixed error upon activating project</li>
<li>Fixed entity presets</li>
<li><strong>InitialSetup:</strong> Fixed project creation window showing too soon</li>
<li>Fixed type loader</li>
<li>Fixed middle click to dispose notifications</li>
</ul>
Binary file modified public/data/package.zip
Binary file not shown.
35 changes: 18 additions & 17 deletions src/components/Audio/AudioManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ export class AudioManager {
masterVolume = 1

playAudio(audioName = 'click5.ogg', audioVolume = 1) {
// Disabled for now
// if (this.currentAudioPlaying) {
// if (
// this.currentAudioPlaying.currentTime /
// this.currentAudioPlaying.duration ==
// 1
// ) {
// this.currentAudioPlaying = new Audio('/audio/' + audioName)
// this.currentAudioPlaying.volume =
// audioVolume * this.masterVolume
// this.currentAudioPlaying.play()
// }
// } else {
// this.currentAudioPlaying = new Audio('/audio/' + audioName)
// this.currentAudioPlaying.volume = audioVolume
// this.currentAudioPlaying.play()
// }
var audioPath = process.env.BASE_URL + 'audio/'
console.warn(audioPath)
if (this.currentAudioPlaying) {
if (
this.currentAudioPlaying.currentTime /
this.currentAudioPlaying.duration ==
1
) {
this.currentAudioPlaying = new Audio(audioPath + audioName)
this.currentAudioPlaying.volume =
audioVolume * this.masterVolume
this.currentAudioPlaying.play()
}
} else {
this.currentAudioPlaying = new Audio(audioPath + audioName)
this.currentAudioPlaying.volume = audioVolume * this.masterVolume
this.currentAudioPlaying.play()
}
}
}
2 changes: 2 additions & 0 deletions src/components/Windows/Settings/Controls/Control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ export abstract class Control<T> {

if (typeof this.config.onChange === 'function')
await this.config.onChange(value)

App.audioManager.playAudio('click5.ogg', 1)
}
}
4 changes: 2 additions & 2 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ export default {
audio: {
name: 'Audio',
volume: {
name: 'Mute',
description: 'Mute or unmute all bridge sounds',
name: 'Audio Enabled',
description: 'Enable or disable all bridge sounds',
},
},
actions: {
Expand Down

0 comments on commit 39400f5

Please sign in to comment.