mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 07:16:17 +08:00
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:
parent
2642e139cf
commit
78bb715885
|
@ -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(),
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
@ -40,6 +40,15 @@ const subgroup: MonkeyTypes.CommandsSubgroup = {
|
|||
SoundController.playError();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "setPlaySoundOnError3",
|
||||
display: "punch miss",
|
||||
configValue: "4",
|
||||
exec: (): void => {
|
||||
UpdateConfig.setPlaySoundOnError("4");
|
||||
SoundController.playError();
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
@ -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",
|
||||
],
|
||||
])
|
||||
) {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
6
frontend/src/ts/types/types.d.ts
vendored
6
frontend/src/ts/types/types.d.ts
vendored
|
@ -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";
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
BIN
frontend/static/sound/click14/click14_1.wav
Normal file
BIN
frontend/static/sound/click14/click14_1.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_2.wav
Normal file
BIN
frontend/static/sound/click14/click14_2.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_3.wav
Normal file
BIN
frontend/static/sound/click14/click14_3.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_4.wav
Normal file
BIN
frontend/static/sound/click14/click14_4.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_5.wav
Normal file
BIN
frontend/static/sound/click14/click14_5.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_6.wav
Normal file
BIN
frontend/static/sound/click14/click14_6.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_7.wav
Normal file
BIN
frontend/static/sound/click14/click14_7.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click14/click14_8.wav
Normal file
BIN
frontend/static/sound/click14/click14_8.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click15/click15_1.wav
Normal file
BIN
frontend/static/sound/click15/click15_1.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click15/click15_2.wav
Normal file
BIN
frontend/static/sound/click15/click15_2.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click15/click15_3.wav
Normal file
BIN
frontend/static/sound/click15/click15_3.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click15/click15_4.wav
Normal file
BIN
frontend/static/sound/click15/click15_4.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/click15/click15_5.wav
Normal file
BIN
frontend/static/sound/click15/click15_5.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/error4/error4_1.wav
Normal file
BIN
frontend/static/sound/error4/error4_1.wav
Normal file
Binary file not shown.
BIN
frontend/static/sound/error4/error4_2.wav
Normal file
BIN
frontend/static/sound/error4/error4_2.wav
Normal file
Binary file not shown.
Loading…
Reference in a new issue