mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Add basic sounds
This commit is contained in:
@@ -22,7 +22,7 @@ const essentialMainMenuSounds = [
|
||||
|
||||
const essentialBareGameAtlases = atlasFiles;
|
||||
const essentialBareGameSprites = G_ALL_UI_IMAGES;
|
||||
const essentialBareGameSounds = [MUSIC.gameBg];
|
||||
const essentialBareGameSounds = [MUSIC.theme];
|
||||
|
||||
const additionalGameSprites = [];
|
||||
const additionalGameSounds = [];
|
||||
|
||||
@@ -4,6 +4,8 @@ import { Signal } from "../core/signal";
|
||||
import { fastArrayDelete, fastArrayDeleteValueIfContained } from "./utils";
|
||||
import { Vector } from "./vector";
|
||||
import { IS_MOBILE } from "./config";
|
||||
import { SOUNDS } from "../platform/sound";
|
||||
import { GLOBAL_APP } from "./globals";
|
||||
|
||||
const logger = createLogger("click_detector");
|
||||
|
||||
@@ -63,7 +65,7 @@ export class ClickDetector {
|
||||
captureTouchmove = false,
|
||||
targetOnly = false,
|
||||
maxDistance = MAX_MOVE_DISTANCE_PX,
|
||||
clickSound = null,
|
||||
clickSound = SOUNDS.uiClick,
|
||||
}
|
||||
) {
|
||||
assert(element, "No element given!");
|
||||
@@ -321,8 +323,7 @@ export class ClickDetector {
|
||||
|
||||
// If we should play any sound, do this
|
||||
if (this.clickSound) {
|
||||
throw new Error("TODO: Play sounds on click");
|
||||
// GLOBAL_APP.sound.playUiSound(this.clickSound);
|
||||
GLOBAL_APP.sound.playUiSound(this.clickSound);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -77,14 +77,14 @@ export const globalConfig = {
|
||||
showEntityBounds: false,
|
||||
showAcceptorEjectors: false,
|
||||
usePlainShapeIds: true,
|
||||
disableMusic: true,
|
||||
// disableMusic: true,
|
||||
doNotRenderStatics: false,
|
||||
disableZoomLimits: false,
|
||||
showChunkBorders: false,
|
||||
rewardsInstant: false,
|
||||
allBuildingsUnlocked: true,
|
||||
upgradesNoCost: true,
|
||||
disableUnlockDialog: true,
|
||||
disableUnlockDialog: false,
|
||||
/* dev:end */
|
||||
},
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ export class GameState {
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getThemeMusic() {
|
||||
return MUSIC.mainMenu;
|
||||
return null;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user