aboutsummaryrefslogtreecommitdiff
path: root/views/script
diff options
context:
space:
mode:
Diffstat (limited to 'views/script')
-rw-r--r--views/script/core_music.js7
-rw-r--r--views/script/game_music.js6
2 files changed, 7 insertions, 6 deletions
diff --git a/views/script/core_music.js b/views/script/core_music.js
index 4b85ebb..a35d329 100644
--- a/views/script/core_music.js
+++ b/views/script/core_music.js
@@ -6,7 +6,10 @@ global.musicElement = new Audio();
const musicIpc = require('electron').ipcRenderer;
musicIpc.on('setmusic', (event, args) => {
- if (!musicElement.paused) {
+ musicElement.src = args;
+ musicElement.play();
+ musicElement.volume = 1;
+ /*if (!musicElement.paused) {
csi1 = setInterval(() => {
if (musicElement.volume <= 0.05) {
clearInterval(csi1);
@@ -27,7 +30,7 @@ musicIpc.on('setmusic', (event, args) => {
} else {
musicElement.src = args;
musicElement.play();
- }
+ }*/
/*try { csp1.volume = 0; } catch (e) {}
try { csp2.volume = 0; } catch (e) {}
song = args;
diff --git a/views/script/game_music.js b/views/script/game_music.js
index 29b00da..2aa7e94 100644
--- a/views/script/game_music.js
+++ b/views/script/game_music.js
@@ -1,8 +1,6 @@
startHooks.push(() => {
- if (require('@electron/remote').getCurrentWindow().music) {
- info("MusicMgr", "Playing game" + i + ".mp3");
- require('electron').ipcRenderer.send('newmusic', kresources.music['game' + i].file);
- }
+ info("MusicMgr", "Playing game" + i + ".mp3");
+ require('electron').ipcRenderer.send('newmusic', kresources.music['game' + i].file);
})
if (location.search === "?online") {