feat(sounds): add fist fight and rubber keys (Absalon43) (#4984)

* Add files via upload

* feat: add support for fist fight and plastic toy sounds

* feat: add support for fist fight and plastic toy sounds

* chore: remove extra semicolon

* feat: less busy punch sound

* feat: add punch misses as error sound

* fix: update punch sounds and make them less aggresive

* fix: Change name of plastic toy to rubber keys

---------

Co-authored-by: arthur-d42 <64164367+arthur-d42@users.noreply.github.com>
Co-authored-by: arthur-d42 <arthurdiness@gmail.com>
This commit is contained in:
Absalon43 2024-02-08 12:01:18 +01:00 committed by GitHub
parent 2642e139cf
commit 78bb715885
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 179 additions and 5 deletions

View file

@ -88,10 +88,10 @@ const CONFIG_SCHEMA = joi.object({
alwaysShowWordsHistory: joi.boolean(),
singleListCommandLine: joi.string().valid("manual", "on"),
capsLockWarning: joi.boolean(),
playSoundOnError: joi.string().valid("off", ..._.range(1, 4).map(_.toString)),
playSoundOnError: joi.string().valid("off", ..._.range(1, 5).map(_.toString)),
playSoundOnClick: joi.alternatives().try(
joi.boolean(), //todo remove soon
joi.string().valid("off", ..._.range(1, 14).map(_.toString))
joi.string().valid("off", ..._.range(1, 16).map(_.toString))
),
soundVolume: joi.string().valid("0.1", "0.5", "1.0"),
startGraphsAtZero: joi.boolean(),

View file

@ -169,6 +169,30 @@ const subgroup: MonkeyTypes.CommandsSubgroup = {
SoundController.scaleConfigurations["13"].preview();
},
},
{
id: "setSoundOnClick14",
display: "fist fight",
configValue: "14",
hover: (): void => {
SoundController.previewClick("14");
},
exec: (): void => {
UpdateConfig.setPlaySoundOnClick("14");
SoundController.playClick();
},
},
{
id: "setSoundOnClick15",
display: "rubber keys",
configValue: "15",
hover: (): void => {
SoundController.previewClick("15");
},
exec: (): void => {
UpdateConfig.setPlaySoundOnClick("15");
SoundController.playClick();
},
},
],
};

View file

@ -40,6 +40,15 @@ const subgroup: MonkeyTypes.CommandsSubgroup = {
SoundController.playError();
},
},
{
id: "setPlaySoundOnError3",
display: "punch miss",
configValue: "4",
exec: (): void => {
UpdateConfig.setPlaySoundOnError("4");
SoundController.playError();
},
},
],
};

View file

@ -140,7 +140,9 @@ export function setPlaySoundOnError(
nosave?: boolean
): boolean {
if (
!isConfigValueValid("play sound on error", val, [["off", "1", "2", "3"]])
!isConfigValueValid("play sound on error", val, [
["off", "1", "2", "3", "4"],
])
) {
return false;
}
@ -173,6 +175,8 @@ export function setPlaySoundOnClick(
"11",
"12",
"13",
"14",
"15",
],
])
) {

View file

@ -57,6 +57,22 @@ function initErrorSound(): void {
counter: 0,
},
],
4: [
{
sounds: [
new Howl({ src: "../sound/error4/error4_1.wav" }),
new Howl({ src: "../sound/error4/error4_1.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/error4/error4_2.wav" }),
new Howl({ src: "../sound/error4/error4_2.wav" }),
],
counter: 0,
},
],
};
}
@ -266,6 +282,101 @@ function init(): void {
counter: 0,
},
],
14: [
{
sounds: [
new Howl({ src: "../sound/click14/click14_1.wav" }),
new Howl({ src: "../sound/click14/click14_1.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_2.wav" }),
new Howl({ src: "../sound/click14/click14_2.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_3.wav" }),
new Howl({ src: "../sound/click14/click14_3.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_4.wav" }),
new Howl({ src: "../sound/click14/click14_4.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_5.wav" }),
new Howl({ src: "../sound/click14/click14_5.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_6.wav" }),
new Howl({ src: "../sound/click14/click14_6.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_7.wav" }),
new Howl({ src: "../sound/click14/click14_7.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click14/click14_8.wav" }),
new Howl({ src: "../sound/click14/click14_8.wav" }),
],
counter: 0,
},
],
15: [
{
sounds: [
new Howl({ src: "../sound/click15/click15_1.wav" }),
new Howl({ src: "../sound/click15/click15_1.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click15/click15_2.wav" }),
new Howl({ src: "../sound/click15/click15_2.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click15/click15_3.wav" }),
new Howl({ src: "../sound/click15/click15_3.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click15/click15_4.wav" }),
new Howl({ src: "../sound/click15/click15_4.wav" }),
],
counter: 0,
},
{
sounds: [
new Howl({ src: "../sound/click15/click15_5.wav" }),
new Howl({ src: "../sound/click15/click15_5.wav" }),
],
counter: 0,
},
],
};
}

View file

@ -124,9 +124,11 @@ declare namespace MonkeyTypes {
| "10"
| "11"
| "12"
| "13";
| "13"
| "14"
| "15";
type PlaySoundOnError = "off" | "1" | "2" | "3";
type PlaySoundOnError = "off" | "1" | "2" | "3" | "4";
type SoundVolume = "0.1" | "0.5" | "1.0";

View file

@ -1016,6 +1016,22 @@
>
wholetone
</div>
<div
class="button"
playSoundOnClick="14"
tabindex="0"
onclick="this.blur();"
>
fist fight
</div>
<div
class="button"
playSoundOnClick="15"
tabindex="0"
onclick="this.blur();"
>
rubber keys
</div>
</div>
</div>
<div class="section playSoundOnError fullWidth">
@ -1060,6 +1076,14 @@
>
square
</div>
<div
class="button"
playSoundOnError="4"
tabindex="0"
onclick="this.blur();"
>
missed punch
</div>
</div>
</div>
<div class="sectionSpacer"></div>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.