From 7a50205cd181bfc0622681ee8658a24895065393 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 6 Jun 2018 02:09:53 +0900 Subject: [PATCH 01/48] translations submodule: track branch use --remote in the future --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 2824128..11fbc2a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "Js/Translations"] path = Js/Translations url = https://git.poweris.moe/xdutranslations.git + branch = . From 8933ba986a1bd42c7d44dc8134159cce2a2ba9eb Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 29 Dec 2018 12:02:23 -0500 Subject: [PATCH 02/48] urlparams: add lang parameter --- Js/Main.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Js/Main.js b/Js/Main.js index 99c72b7..55c82f7 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -33,9 +33,9 @@ function onBodyLoaded() { bodyLoaded = true; document.getElementById("title-tag").innerText = version; document.addEventListener('webkitfullscreenchange', onFullScreenChange, false); - document.addEventListener('mozfullscreenchange', onFullScreenChange, false); - document.addEventListener('fullscreenchange', onFullScreenChange, false); - document.addEventListener('MSFullscreenChange', onFullScreenChange, false); + document.addEventListener('mozfullscreenchange', onFullScreenChange, false); + document.addEventListener('fullscreenchange', onFullScreenChange, false); + document.addEventListener('MSFullscreenChange', onFullScreenChange, false); } (function startLoad() { @@ -77,12 +77,15 @@ function onAllLoaded(success) { document.getElementById('parent-container').style.cssText = "opacity: 1;"; onWindowResize(); window.addEventListener("resize", onWindowResize); - checkQueryParameters(); + if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { + document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; + } }, 0); } function loadLocalStorage() { try { + urlParams = commonFunctions.readQueryParameters(); //audio volume = localStorage.getItem('volume') || 0.5; volume = Number(volume); @@ -100,7 +103,7 @@ function loadLocalStorage() { document.getElementById('mute-button').innerText = "🔊"; } //language - let lang = localStorage.getItem('language') || "eng"; + let lang = urlParams['lang'] || localStorage.getItem('language') || "eng"; if(languages.includes(lang)) { selectedLang = lang; } @@ -153,13 +156,6 @@ function buildLanguageList() { selectBox.value = selectedLang; } -function checkQueryParameters() { - urlParams = commonFunctions.readQueryParameters(); - if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { - document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; - } -} - function playFromQuery(event) { missionChanged(urlParams['mstid'], urlParams['id']); document.getElementById('play-from-query').style.cssText = "display: none;"; From 9ca49d25cc1fe0ac726dea17c9455c86d47ee2a4 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 29 Dec 2018 12:45:27 -0500 Subject: [PATCH 03/48] urlparams: rewrite --- Js/Main.js | 13 +++++++++---- Player.html | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Js/Main.js b/Js/Main.js index 55c82f7..805e612 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -54,6 +54,7 @@ function onBodyLoaded() { (function checkIsLoaded() { if(bodyLoaded) { document.getElementById('loading-font').style.cssText = "display: none;"; + loadQueryParameters(); loadLocalStorage(); } if(utageLoaded && languagesLoaded) { @@ -77,15 +78,11 @@ function onAllLoaded(success) { document.getElementById('parent-container').style.cssText = "opacity: 1;"; onWindowResize(); window.addEventListener("resize", onWindowResize); - if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { - document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; - } }, 0); } function loadLocalStorage() { try { - urlParams = commonFunctions.readQueryParameters(); //audio volume = localStorage.getItem('volume') || 0.5; volume = Number(volume); @@ -156,6 +153,14 @@ function buildLanguageList() { selectBox.value = selectedLang; } +function loadQueryParameters() { + urlParams = commonFunctions.readQueryParameters(); + if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { + document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; + } +} + + function playFromQuery(event) { missionChanged(urlParams['mstid'], urlParams['id']); document.getElementById('play-from-query').style.cssText = "display: none;"; diff --git a/Player.html b/Player.html index 32a0a3a..0e2bcb9 100644 --- a/Player.html +++ b/Player.html @@ -18,7 +18,7 @@ --> -
+

Loading Utage Data...

Loading Page Data...

@@ -78,4 +78,4 @@ test -->
- \ No newline at end of file + From 42e37585d63b16745fb3d8f3f6a4b6cd886dc863 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 29 Dec 2018 12:45:27 -0500 Subject: [PATCH 04/48] urlparams: rewrite --- Js/Main.js | 13 +++++++++---- Player.html | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Js/Main.js b/Js/Main.js index 55c82f7..805e612 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -54,6 +54,7 @@ function onBodyLoaded() { (function checkIsLoaded() { if(bodyLoaded) { document.getElementById('loading-font').style.cssText = "display: none;"; + loadQueryParameters(); loadLocalStorage(); } if(utageLoaded && languagesLoaded) { @@ -77,15 +78,11 @@ function onAllLoaded(success) { document.getElementById('parent-container').style.cssText = "opacity: 1;"; onWindowResize(); window.addEventListener("resize", onWindowResize); - if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { - document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; - } }, 0); } function loadLocalStorage() { try { - urlParams = commonFunctions.readQueryParameters(); //audio volume = localStorage.getItem('volume') || 0.5; volume = Number(volume); @@ -156,6 +153,14 @@ function buildLanguageList() { selectBox.value = selectedLang; } +function loadQueryParameters() { + urlParams = commonFunctions.readQueryParameters(); + if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { + document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; + } +} + + function playFromQuery(event) { missionChanged(urlParams['mstid'], urlParams['id']); document.getElementById('play-from-query').style.cssText = "display: none;"; diff --git a/Player.html b/Player.html index 32a0a3a..0e2bcb9 100644 --- a/Player.html +++ b/Player.html @@ -18,7 +18,7 @@ --> -
+

Loading Utage Data...

Loading Page Data...

@@ -78,4 +78,4 @@ test -->
- \ No newline at end of file + From dbf530a333a440975e230a1af37167f1e3c9a643 Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 29 Dec 2018 12:45:27 -0500 Subject: [PATCH 05/48] urlparams: rewrite --- Js/Main.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Js/Main.js b/Js/Main.js index 55c82f7..05372c4 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -77,9 +77,7 @@ function onAllLoaded(success) { document.getElementById('parent-container').style.cssText = "opacity: 1;"; onWindowResize(); window.addEventListener("resize", onWindowResize); - if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { - document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; - } + checkQueryParameters(); }, 0); } @@ -156,6 +154,13 @@ function buildLanguageList() { selectBox.value = selectedLang; } +function checkQueryParameters() { + urlParams = commonFunctions.readQueryParameters(); + if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) { + document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;"; + } +} + function playFromQuery(event) { missionChanged(urlParams['mstid'], urlParams['id']); document.getElementById('play-from-query').style.cssText = "display: none;"; From e098d279642fc8242e81ebdf867b83c04fd0a9a4 Mon Sep 17 00:00:00 2001 From: firebingo Date: Sat, 29 Dec 2018 11:44:34 -0700 Subject: [PATCH 06/48] Fix player not falling back to utage text if translation file didnt exist at all. --- Js/Player.js | 10 +++++----- Js/Translations | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Js/Player.js b/Js/Player.js index 5f24332..57236a3 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -585,13 +585,13 @@ class Player { this.lerpTargets.push({type: 'alpha', object: sprite, curTime: 0, time: 300, finalV: 1, initV: 0}); this.lerpTargets.push({type: 'alpha', object: sprite, curTime: -(this.waitTime+500), time: 300, finalV: 0, initV: 1, post: "destroy"}); } catch (error) { } - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.titleText(true, text); break; } case "divaeffect": { this.waitTime = Number(cur.Arg5) * 1000; - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.divaText(true, text); break; } @@ -1197,8 +1197,8 @@ class Player { this.audio.stopSound(this.playingVoice); } if(!cur.Command && cur.Arg1 && cur.Text) { - //If its chracter off screen text - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + //If its character off screen text + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; text = commonFunctions.convertUtageTextTags(text); if(cur.Arg2 && cur.Arg2.toLowerCase() === "") { this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1); @@ -1236,7 +1236,7 @@ class Player { this.manualNext = true; //Sometimes they don't give a Arg1 for the text. } else if(!cur.Command && cur.Arg2.toLowerCase() === "" && cur.Text) { - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.characterName(true, ""); this.text.dialogText(true, commonFunctions.convertUtageTextTags(text)); this.manualNext = true; diff --git a/Js/Translations b/Js/Translations index 533c483..dc15df9 160000 --- a/Js/Translations +++ b/Js/Translations @@ -1 +1 @@ -Subproject commit 533c48371ed01ed7265b6b5f052d1b2c3fce940f +Subproject commit dc15df970a33c34dd53654fb77ce775ee9e3f051 From f3ddb3e58fda5b18a5ab2f5d3431c49c1e5ac6ee Mon Sep 17 00:00:00 2001 From: firebingo Date: Sat, 19 Jan 2019 14:02:31 -0700 Subject: [PATCH 07/48] noise_disappearance commands should work. --- Js/Player.js | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/Js/Player.js b/Js/Player.js index 57236a3..6c78744 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -920,39 +920,21 @@ class Player { break; } case "noise_disappearance01": //103500331 - this.waitTime = Number(cur.Arg1) * 1000; + if(cur.Arg2) { + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + } break; case "noise_disappearance02": { //103500341 - this.waitTime = Number(cur.Arg1) * 1000; - //let c1 = this.currentCharacters['キャラ右']; - //if(c1) { - // this.lerpTargets.push({type: 'alpha', object: c1.sprite, curTime: 0, time: 200, finalV: 0, initV: 1, post: "destroy" }); - // this.currentCharacters['キャラ右'] = undefined; - //} - //let c2 = this.currentCharacters['キャラ左']; - //if(c2) { - // this.lerpTargets.push({type: 'alpha', object: c2.sprite, curTime: 0, time: 200, finalV: 0, initV: 1, post: "destroy" }); - // this.currentCharacters['キャラ左'] = undefined; - //} + if(cur.Arg2) { + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + } + if(cur.Arg3) { + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + } break; } case "noise_disappearance03": { //103500552 this.waitTime = Number(cur.Arg1) * 1000; - let c1 = this.currentCharacters['キャラ右'] || this.currentCharacters['キャラ右02']; - if(c1) { - this.lerpTargets.push({type: 'alpha', object: c1.sprite, curTime: (0 - (this.waitTime/2)), time: 200, finalV: 0, initV: 1, post: "destroy" }); - this.currentCharacters['キャラ右'] = undefined; - } - let c2 = this.currentCharacters['キャラ左'] || this.currentCharacters['キャラ左02']; - if(c2) { - this.lerpTargets.push({type: 'alpha', object: c2.sprite, curTime: (0 - (this.waitTime/2)), time: 200, finalV: 0, initV: 1, post: "destroy" }); - this.currentCharacters['キャラ左'] = undefined; - } - let c3 = this.currentCharacters['キャラ中央']; - if(c3) { - this.lerpTargets.push({type: 'alpha', object: c3.sprite, curTime: (0 - (this.waitTime/2)), time: 200, finalV: 0, initV: 1, post: "destroy" }); - this.currentCharacters['キャラ中央'] = undefined; - } } case "noise_disappearance11": //103500341 this.waitTime = Number(cur.Arg1) * 1000; @@ -1176,7 +1158,7 @@ class Player { } } - processTryRemoveChar(character) { + processTryRemoveChar(character, fadeTime) { let curChar = undefined; for(let c of Object.keys(this.currentCharacters)) { if(!this.currentCharacters[c]) { continue; } @@ -1187,7 +1169,10 @@ class Player { if(!curChar) { return; } - this.lerpTargets.push({type: 'alpha', object: curChar.sprite, curTime: 0, time: 500, finalV: 0, initV: 1, post: "destroy" }); + if(fadeTime == undefined) { + fadeTime = 500; + } + this.lerpTargets.push({type: 'alpha', object: curChar.sprite, curTime: 0, time: fadeTime, finalV: 0, initV: 1, post: "destroy" }); this.currentCharacters[curChar.layer.info.LayerName] = undefined; } From fb9cab573e73ebb20008ce365d3106f209cad3dc Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 19 Jan 2019 16:47:00 -0500 Subject: [PATCH 08/48] fix unbalanced parenthesis --- Js/Player.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Js/Player.js b/Js/Player.js index 6c78744..50e98f5 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -921,15 +921,15 @@ class Player { } case "noise_disappearance01": //103500331 if(cur.Arg2) { - this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); } break; case "noise_disappearance02": { //103500341 if(cur.Arg2) { - this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); } if(cur.Arg3) { - this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000); + this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); } break; } @@ -1533,4 +1533,4 @@ class Player { } }); } -} \ No newline at end of file +} From 0b3fb016709a471324dde2c1117b2d7327d6d3e9 Mon Sep 17 00:00:00 2001 From: firebingo Date: Sat, 19 Jan 2019 14:58:09 -0700 Subject: [PATCH 09/48] I didnt hit save --- Js/Player.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Js/Player.js b/Js/Player.js index 50e98f5..49d3a48 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -920,22 +920,19 @@ class Player { break; } case "noise_disappearance01": //103500331 - if(cur.Arg2) { - this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); - } - break; - case "noise_disappearance02": { //103500341 + case "noise_disappearance02": //103500341 + case "noise_disappearance03": { //103500552 if(cur.Arg2) { this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); } if(cur.Arg3) { - this.processTryRemoveChar(cur.Arg2, (Number(cur.Arg1) * 1000)); + this.processTryRemoveChar(cur.Arg3, (Number(cur.Arg1) * 1000)); + } + if(cur.Arg4) { + this.processTryRemoveChar(cur.Arg4, (Number(cur.Arg1) * 1000)); } break; } - case "noise_disappearance03": { //103500552 - this.waitTime = Number(cur.Arg1) * 1000; - } case "noise_disappearance11": //103500341 this.waitTime = Number(cur.Arg1) * 1000; break; From eec0bb137be60cae6625f5609e809072ac788b1f Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 20 Jan 2019 00:55:32 -0500 Subject: [PATCH 10/48] json: update bgmloop --- Js/BgmLoop.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Js/BgmLoop.json b/Js/BgmLoop.json index 1e0aaa2..72cc64c 100644 --- a/Js/BgmLoop.json +++ b/Js/BgmLoop.json @@ -363,6 +363,19 @@ "seconds": 20.034 } }, + "music_axia_no_kaze": { + "duration": 227.14678125, + "loop_end": { + "samples_48k": 10902963, + "samples_native": 7268642, + "seconds": 227.1450625 + }, + "loop_start": { + "samples_48k": 7334256, + "samples_native": 4889504, + "seconds": 152.797 + } + }, "music_beyond_the_blade": { "duration": 107.07978125, "loop_end": { From b9e91f49774156b19a41f8cd3b870fa3be2cb3e7 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 20 Jan 2019 00:55:51 -0500 Subject: [PATCH 11/48] version bump --- CHANGELOG.md | 13 ++++++++++++- Js/Main.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2c525c..f83aa26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,4 +14,15 @@ Added null check for pixi sprite calculateverticies because it sometimes makes a DPI is now taken into account when resizing. Added credits to mission modal. Added ability to go fullscreen. -Missions JSON moved to translations submodule so missions can be added/enabled without disturbing main project. \ No newline at end of file +Missions JSON moved to translations submodule so missions can be added/enabled without disturbing main project. + +## V1.2.1 (2018-12-29) + +Custom asset support +Russian language support +Fix translation fallback + +## V1.2.2 (2019-01-20) + +Add language url parameter +Fix noise\_disappearance commands diff --git a/Js/Main.js b/Js/Main.js index 05372c4..7f5627e 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -11,7 +11,7 @@ const textFunc = new TextFunctions(); let audio = undefined; //Cant create a audio context without user input. const player = new Player(pixiApp, utage, textFunc, audio, shaders); const languages = ["eng", "jpn", "rus"]; -const version = "YameteTomete XDUPlayer V1.2.1"; +const version = "YameteTomete XDUPlayer V1.2.2"; let bodyLoaded = false; let utageLoaded = false; let languagesLoaded = false; From e3b7233b20f8504024a3c4a3d00b7ae11fe4180b Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 11 May 2019 23:36:58 -0400 Subject: [PATCH 12/48] remove emoji strings replaced with html entities/creation from unicode code-point where applicable my editor doesn't render emoji --- .gitignore | 1 + Js/Audio.js | 3 +-- Js/Main.js | 16 +++++++++++----- Player.html | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 7d9fd68..7e1b2e5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ web.config /Dist /Css/main.min.css /Js/XduPlayer.min.js +/**/.*.swp diff --git a/Js/Audio.js b/Js/Audio.js index 8a6c748..bb1c33b 100644 --- a/Js/Audio.js +++ b/Js/Audio.js @@ -1,5 +1,4 @@ //(Math.exp(x)-1)/(Math.E-1) -//🔊 class bufferLoader { constructor(context, soundMap, callback) { @@ -182,4 +181,4 @@ class audioController { } this.sources = {}; } -} \ No newline at end of file +} diff --git a/Js/Main.js b/Js/Main.js index 805e612..bcd45b2 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -29,6 +29,12 @@ let volume = 0.5; let fullScreen = false; let prevMission = '{Select}'; +const emoji = { + LoudSound: String.fromCodePoint(0x1f50a), + Mute: String.fromCodePoint(0x1f507), + HeavyPlusSign: String.fromCodePoint(0x2795) +}; + function onBodyLoaded() { bodyLoaded = true; document.getElementById("title-tag").innerText = version; @@ -95,9 +101,9 @@ function loadLocalStorage() { audio.mute(isMuted); } if(isMuted) { - document.getElementById('mute-button').innerText = "🔇"; + document.getElementById('mute-button').innerText = emoji.Mute; } else { - document.getElementById('mute-button').innerText = "🔊"; + document.getElementById('mute-button').innerText = emoji.LoudSound; } //language let lang = urlParams['lang'] || localStorage.getItem('language') || "eng"; @@ -433,9 +439,9 @@ function toggleMute(event) { } localStorage.setItem('ismuted', isMuted); if(isMuted) { - document.getElementById('mute-button').innerText = "🔇"; + document.getElementById('mute-button').innerText = emoji.Mute; } else { - document.getElementById('mute-button').innerText = "🔊"; + document.getElementById('mute-button').innerText = emoji.LoudSound; } } @@ -474,7 +480,7 @@ function onFullScreenChange(event) { } else { document.getElementById('other-controls-container').style.cssText = ""; document.getElementById('title-container').style.cssText = ""; - document.getElementById('fullscreen-button').innerText = "➕"; + document.getElementById('fullscreen-button').innerText = emoji.HeavyPlusSign; } onWindowResize(event, 0); } diff --git a/Player.html b/Player.html index 0e2bcb9..7561fb8 100644 --- a/Player.html +++ b/Player.html @@ -26,7 +26,7 @@
Now Playing: None
- 🔊 + 🔊
@@ -37,7 +37,7 @@ The canvas then resizes as the canvas does and the text-container uses transform scale based off this resolution -->
-
+
From 1d469d4f3e848ebc42d87495dc4f6ec42118338a Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 12 May 2019 20:20:48 -0400 Subject: [PATCH 13/48] webpack, eslint javascript didn't have proper modules until es6 what the fuck bingo's code scares me so i hope i didn't break it when fixing the linting errors --- .eslintignore | 1 + .eslintrc.json | 20 + Js/Audio.js | 8 +- Js/Common.js | 6 +- Js/Main.js | 37 +- Js/Player.js | 49 +- Js/Shaders.js | 9 +- Js/TextFunctions.js | 5 +- Js/UtageParse.js | 32 +- Player.html | 34 +- README.md | 3 +- gulpfile.js | 130 - package-lock.json | 10495 ++++++++++++++++++++++++++++++++++++++---- package.json | 29 +- webpack.config.js | 117 + 15 files changed, 9790 insertions(+), 1185 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json delete mode 100644 gulpfile.js create mode 100644 webpack.config.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3c6bd60 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +Js/Pixi.min.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..840546d --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "rules": { + "no-console": "off", + "no-unused-vars": [2, { "argsIgnorePattern": "^(success|event|resource|delta|reject)$"}], + "no-empty": ["error", { "allowEmptyCatch": true }] + } +} diff --git a/Js/Audio.js b/Js/Audio.js index bb1c33b..6891a09 100644 --- a/Js/Audio.js +++ b/Js/Audio.js @@ -1,5 +1,7 @@ //(Math.exp(x)-1)/(Math.E-1) +import bgmLoopData from './BgmLoop.json'; + class bufferLoader { constructor(context, soundMap, callback) { this.context = context; @@ -94,8 +96,8 @@ class audioController { source.buffer = this.loader.bufferList[sound]; source.loop = false; if(type === "bgm") { - if(this.utage.bgmLoopData[this.utage.soundInfo[sound].origFileName]) { - let loop = this.utage.bgmLoopData[this.utage.soundInfo[sound].origFileName]; + if(bgmLoopData[this.utage.soundInfo[sound].origFileName]) { + let loop = bgmLoopData[this.utage.soundInfo[sound].origFileName]; source.loopStart = loop["loop_start"]["seconds"]; source.loopEnd = loop["loop_end"]["seconds"]; source.loop = true; @@ -182,3 +184,5 @@ class audioController { this.sources = {}; } } + +export { audioController }; diff --git a/Js/Common.js b/Js/Common.js index 4f0cb8e..9f639e4 100644 --- a/Js/Common.js +++ b/Js/Common.js @@ -334,8 +334,10 @@ class commonFunctions { if(props[i] == " ") { break; } retval.color += props[i]; } - retval.color = retval.color; + //retval.color = retval.color; } return retval; } -} \ No newline at end of file +} + +export { rootUrl, baseDimensions, screenRatio, commonFunctions }; diff --git a/Js/Main.js b/Js/Main.js index bcd45b2..05a4e86 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -1,5 +1,17 @@ 'use strict'; +/* global PIXI */ +import 'Pixi'; +import { Player } from './Player.js'; +import { audioController } from './Audio.js'; +import { baseDimensions, commonFunctions } from './Common.js'; +import { UtageInfo } from './UtageParse.js'; +import { TextFunctions } from './TextFunctions.js'; +import { Shaders } from './Shaders.js'; + +import '../Css/generic.min.css'; +import '../Css/main.css'; + const pixiApp = { app: new PIXI.Application(baseDimensions), loader: PIXI.loader @@ -215,9 +227,9 @@ function missionDropDownChanged(event) { ${chapterSelect}
`; document.getElementById("click-catcher").style.cssText = 'display: flex;'; @@ -424,7 +436,7 @@ function openHelpModal(event) { YameteTomete Discord
All Symphogear content belongs to its respective owners
`; @@ -500,3 +512,22 @@ function onWindowResize(event, delay = 400) { document.getElementById('app-container').style.cssText = `width: ${res.width}px; height: ${res.height}px;`; }, delay); } + +export { + onBodyLoaded, + onBodyKey, + toggleMute, + onVolumeChange, + missionDropDownChanged, + languageChanged, + toggleFullscreen, + onMainClick, + openHelpModal, + playFromQuery, + skipClicked, + hideUiClicked, + dialogScrollUp, + dialogScrollDown, + closeMissionModal, + missionChanged +}; diff --git a/Js/Player.js b/Js/Player.js index 5f24332..a425125 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -1,5 +1,9 @@ 'use strict'; +/* global PIXI */ +import 'Pixi'; +import { baseDimensions, commonFunctions } from './Common.js'; + class Player { constructor(pixi, utage, text, audio, shaderscript) { this.pixi = pixi; @@ -7,7 +11,7 @@ class Player { this.utage = utage; this.text = text; this.audio = audio; - this.shaders = shaders; + this.shaders = shaderscript; //consts this.resolutionScale = 1; //I created this thinking that I would need to handle changing offset when resolution changes. But lucikly I can just scale the parent container and it works without needing this. this.baseFps = 60; //I am assuming that PIXI is going to stay as keeping 60fps = delta1. @@ -51,9 +55,9 @@ class Player { return new Promise((resolve, reject) => { let toLoadBgm = {}; let toLoadSe = {}; - for(let i = 0; i < utage.currentPlayingFile.length; ++i) { + for(let i = 0; i < this.utage.currentPlayingFile.length; ++i) { try { - let c = utage.currentPlayingFile[i]; + let c = this.utage.currentPlayingFile[i]; if(c.comment) { continue; } //They use this to set the sprite set for a charater but have an alternate name displayed if(c.Arg2 && c.Arg2.toLowerCase().includes("") { - this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1); + this.text.characterName(true, this.utage.charTranslations[cur.Arg1] || cur.Arg1); this.text.dialogText(true, commonFunctions.convertUtageTextTags(text)); } else { - let charName = ""; let found = false; //Look for the character that is saying the text to get their name //future note: This might be better to just look for the character in character info if this start failing. @@ -1216,7 +1219,7 @@ class Player { if(cur.Character) { nameToUse = cur.Arg1; } - this.text.characterName(true, utage.charTranslations[nameToUse] || nameToUse); + this.text.characterName(true, this.utage.charTranslations[nameToUse] || nameToUse); this.text.dialogText(true, text); this.currentCharacters[c].sprite.tint = 0xFFFFFF; found = true; @@ -1229,14 +1232,14 @@ class Player { } //If we didnt find the character just dump the text anyways with Arg1 as the name if(!found) { - this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1); + this.text.characterName(true, this.utage.charTranslations[cur.Arg1] || cur.Arg1); this.text.dialogText(true, text); } } this.manualNext = true; //Sometimes they don't give a Arg1 for the text. } else if(!cur.Command && cur.Arg2.toLowerCase() === "" && cur.Text) { - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (this.utage.translations[cur.English] || cur.Text) : cur.Text; this.text.characterName(true, ""); this.text.dialogText(true, commonFunctions.convertUtageTextTags(text)); this.manualNext = true; @@ -1324,6 +1327,7 @@ class Player { this.lerpTargets.push({type: 'scale.y', object: curChar.sprite, curTime: 0 - (props.delay || 0), time: props.time, finalV: curChar.sprite.scale.y * props.y, initV: curChar.sprite.scale.y }); } + break; } case "colorto": { let props = commonFunctions.getPropertiesFromTweenCommand(cur.Arg3); @@ -1347,6 +1351,7 @@ class Player { curChar.sprite.tint = color.color; } } + break; } } } @@ -1485,8 +1490,8 @@ class Player { } getNextCommand() { - let command = utage.currentPlayingFile.pop(); - if(!utage.currentPlayingFile || utage.currentPlayingFile.length === 0) { + let command = this.utage.currentPlayingFile.pop(); + if(!this.utage.currentPlayingFile || this.utage.currentPlayingFile.length === 0) { this.onEndFile(); return; } @@ -1514,7 +1519,7 @@ class Player { return new Promise((resolve, reject) => { try { this.pixi.app.ticker.remove(this.onPixiTick, this); - utage.currentPlayingFile.length = 0; + this.utage.currentPlayingFile.length = 0; this.currentCharacters = {}; this.layers = {}; this.currentCommand = undefined; @@ -1548,4 +1553,6 @@ class Player { } }); } -} \ No newline at end of file +} + +export { Player }; diff --git a/Js/Shaders.js b/Js/Shaders.js index 676dd0e..95372ad 100644 --- a/Js/Shaders.js +++ b/Js/Shaders.js @@ -1,4 +1,9 @@ //http://glslsandbox.com/e#39992.0 + +/* global PIXI */ +import 'Pixi'; +import { baseDimensions } from './Common.js'; + class Shaders { constructor() { this.leftToRightFadeShader = ` @@ -199,4 +204,6 @@ class Shaders { filterManager.applyFilter(this, input, output); } } -} \ No newline at end of file +} + +export { Shaders }; diff --git a/Js/TextFunctions.js b/Js/TextFunctions.js index 853df36..4c7df82 100644 --- a/Js/TextFunctions.js +++ b/Js/TextFunctions.js @@ -84,7 +84,6 @@ class TextFunctions { function putText() { // skip over any HTML chars this.dialogToDisplay.curPos = this.typeHtmlChars(this.dialogToDisplay.text, this.dialogToDisplay.curPos); - let substr = this.dialogToDisplay.text.substr(this.dialogToDisplay.curPos); if (this.dialogToDisplay.curPos === this.dialogToDisplay.text.length) { this.showNextIndicator(true); this.scrollingText = false; @@ -191,4 +190,6 @@ class TextFunctions { this.scrollingText = false; this.lineHeight = -1; } -} \ No newline at end of file +} + +export { TextFunctions }; diff --git a/Js/UtageParse.js b/Js/UtageParse.js index 927a6d8..3a11ac9 100644 --- a/Js/UtageParse.js +++ b/Js/UtageParse.js @@ -1,6 +1,8 @@ //http://madnesslabo.net/utage/?page_id=4448&lang=en 'use strict'; +import { commonFunctions } from './Common.js'; + class UtageInfo { constructor() { this.currentPlayingFile = []; @@ -31,15 +33,15 @@ class UtageInfo { //commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Scenario.tsv`), commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Sound.tsv`), //4 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Texture.tsv`), //5 - commonFunctions.getFileJson(`${this.rootDirectory}Js/BgmLoop.json`), //6 - commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissionsCustom.json`), //7 - commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomCharacter.tsv`), //8 - commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomSound.tsv`), //9 - commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomTexture.tsv`), //10 + //commonFunctions.getFileJson(`${this.rootDirectory}Js/BgmLoop.json`), + commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissionsCustom.json`), //6 + commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomCharacter.tsv`), //7 + commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomSound.tsv`), //8 + commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomTexture.tsv`), //9 ]; Promise.all(promises) .then((success) => { - this.groupMissions(success[0], success[7]); + this.groupMissions(success[0], success[6]); this.missionsList = Object.keys(this.groupedMissions).map((k) => { return {Name: this.groupedMissions[k].Name, MstId: this.groupedMissions[k].MstId}; }); @@ -50,10 +52,10 @@ class UtageInfo { //this.parseParamInfo(success[4]); this.parseSoundInfo(success[4]); this.parseTextureInfo(success[5]); - this.bgmLoopData = success[6]; - this.parseCharacterInfo(success[8], true); - this.parseSoundInfo(success[9], true); - this.parseTextureInfo(success[10], true); + //this.bgmLoopData = success[6]; + this.parseCharacterInfo(success[7], true); + this.parseSoundInfo(success[8], true); + this.parseTextureInfo(success[9], true); resolve(); }, (failure) => { reject(failure); @@ -173,7 +175,7 @@ class UtageInfo { if(this.charTranslationsInner[this.currentTranslation]) { resolve(); } else { - commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/nametranslations_${this.currentTranslation}.json`) + commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/nametranslations_${this.currentTranslation}.json`) .then((success) => { this.charTranslationsInner[this.currentTranslation] = success; resolve(); @@ -191,8 +193,8 @@ class UtageInfo { resolve(); } else { var promises = [ - commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNames_${this.currentTranslation}.json`), - commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNamesCustom_${this.currentTranslation}.json`) + commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissionsNames_${this.currentTranslation}.json`), + commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissionsNamesCustom_${this.currentTranslation}.json`) ]; Promise.all(promises) .then((success) => { @@ -362,4 +364,6 @@ class UtageInfo { resetTranslations() { this.translationsInner = {}; } -} \ No newline at end of file +} + +export { UtageInfo }; diff --git a/Player.html b/Player.html index 7561fb8..250ae1b 100644 --- a/Player.html +++ b/Player.html @@ -5,19 +5,19 @@ - - + - + - +

Loading Utage Data...

Loading Page Data...

@@ -26,33 +26,33 @@
Now Playing: None
- 🔊 - + 🔊 +
- - - ? + + + ?
-
+
-
+
- +