From c07d281948952790a968c8f07a322938e6be50d3 Mon Sep 17 00:00:00 2001 From: firebingo Date: Mon, 4 Jun 2018 09:07:53 -0700 Subject: [PATCH] Custom mission support. Some fixes. Different Scene Titles are slightly easier to support. Started adding new effects for bridal gears. --- Css/main.css | 4 +-- Js/Main.js | 2 +- Js/Player.js | 66 ++++++++++++++++++++++++--------------- Js/Translations | 2 +- Js/UtageParse.js | 30 +++++++++++++++--- Js/XduMissionsCustom.json | 11 +++++++ gulpfile.js | 3 +- 7 files changed, 84 insertions(+), 34 deletions(-) create mode 100644 Js/XduMissionsCustom.json diff --git a/Css/main.css b/Css/main.css index c0c3655..bdef791 100644 --- a/Css/main.css +++ b/Css/main.css @@ -64,7 +64,7 @@ body { margin: 0; } #parent-container { display: flex; flex-direction: column; align-items: center; } -#text-container { position: absolute; margin: auto; height: 750px; width: 1334px; font-family: 'FOT-RodinNTLGPro'; } +#text-container { color: white; position: absolute; margin: auto; height: 750px; width: 1334px; font-family: 'FOT-RodinNTLGPro'; } #text-container #title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 20px; transition: opacity 0.3s; cursor: default; user-select: none; } @@ -74,7 +74,7 @@ body { margin: 0; } #text-container #main-ui-img { width: 100%; height:100%; transition: opacity 0.1s; } -#dialog-box { color: white; font-weight: bold; text-shadow: 1px 1px 6px black; transition: opacity 0.1s; } +#dialog-box { font-weight: bold; text-shadow: 1px 1px 6px black; transition: opacity 0.1s; } #dialog-box #character { position: absolute; left: 70px; font-size: 30px; cursor: default; user-select: none; } diff --git a/Js/Main.js b/Js/Main.js index 5ba8800..1e5a817 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -26,7 +26,7 @@ let screenSizeTimeout = undefined; let isMuted = false; let volume = 0.5; let prevMission = '{Select}'; -const availableMstIds = [202070, 202013]; +const availableMstIds = [202070, 202013, 338003]; function onBodyLoaded() { bodyLoaded = true; diff --git a/Js/Player.js b/Js/Player.js index 3b48e2a..7e83848 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -159,31 +159,42 @@ class Player { } break; } + case "somethingnew_appearance01": + case "unhappyseed_appearance01": + case "unhappyseed_appearance02": case "arcanoise_appearance02": case "arcanoise_appearance03": { - let Pat = this.defaultCharPattern; + let pat = this.defaultCharPattern; if(c.Arg1) { - if(this.utage.characterInfo[c.Arg1] && this.utage.characterInfo[c.Arg1][Pat]) { - if(!this.loader.resources[`char|${c.Arg1}|${Pat}`]) { - this.loader.add(`char|${c.Arg1}|${Pat}`, this.utage.characterInfo[c.Arg1][Pat].FileName); + if(this.utage.characterInfo[c.Arg1] && this.utage.characterInfo[c.Arg1][pat]) { + if(!this.loader.resources[`char|${c.Arg1}|${pat}`]) { + this.loader.add(`char|${c.Arg1}|${pat}`, this.utage.characterInfo[c.Arg1][pat].FileName); } } } if(c.Arg2) { - if(this.utage.characterInfo[c.Arg2] && this.utage.characterInfo[c.Arg2][Pat]) { - if(!this.loader.resources[`char|${c.Arg2}|${Pat}`]) { - this.loader.add(`char|${c.Arg2}|${Pat}`, this.utage.characterInfo[c.Arg2][Pat].FileName); + if(this.utage.characterInfo[c.Arg2] && this.utage.characterInfo[c.Arg2][pat]) { + if(!this.loader.resources[`char|${c.Arg2}|${pat}`]) { + this.loader.add(`char|${c.Arg2}|${pat}`, this.utage.characterInfo[c.Arg2][pat].FileName); } } } if(c.Arg3) { - if(this.utage.characterInfo[c.Arg3] && this.utage.characterInfo[c.Arg3][Pat]) { - if(!this.loader.resources[`char|${c.Arg3}|${Pat}`]) { - this.loader.add(`char|${c.Arg3}|${Pat}`, this.utage.characterInfo[c.Arg3][Pat].FileName); + if(this.utage.characterInfo[c.Arg3] && this.utage.characterInfo[c.Arg3][pat]) { + if(!this.loader.resources[`char|${c.Arg3}|${pat}`]) { + this.loader.add(`char|${c.Arg3}|${pat}`, this.utage.characterInfo[c.Arg3][pat].FileName); } } } + break; } + case "scenetitle01": + //this isint in the texture file. + this.loader.add('bg|titlecard', `${this.utage.rootDirectory}XDUData/Sample/Texture/BG/bg_title.jpg`); + break; + case "scenetitle13": + this.loader.add('bg|titlecard', `${this.utage.rootDirectory}XDUData/Sample/Texture/BG/event0010.png`); + break; } } catch (error) { console.log(error); @@ -202,8 +213,6 @@ class Player { }); //Manually load white bg for fading. Can be tinted to change color. this.loader.add('bg|whiteFade', `${this.utage.rootDirectory}Images/white.png`); - //this isint in the texture file. - this.loader.add('bg|titlecard', `${this.utage.rootDirectory}XDUData/Sample/Texture/BG/bg_title.jpg`) this.loader .on("progress", (loader, resource) => { this.onPixiProgress(loader, resource); @@ -430,8 +439,11 @@ class Player { if(cur.Arg2 === '<Off>') { cur.Arg2 = ''; } + if ((cur.Command || "").toLowerCase().includes('scenetitle')) { + cur.Command = 'scenetitle'; + } switch((cur.Command || "").toLowerCase()) { - case "scenetitle01": { + case "scenetitle": { this.waitTime = this.titleWaitTime * 1000; try { let container = this.layers[this.bgLayerName].container; @@ -447,9 +459,6 @@ class Player { let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; this.text.titleText(true, text); break; - } - case "scenetitle13": { - } case "divaeffect": { this.waitTime = Number(cur.Arg5) * 1000; @@ -610,8 +619,12 @@ class Player { break; } case "characteroff": { - this.text.dialogText(false, ""); - this.text.characterName(false, ""); + if(cur.Text) { + checkPutText(cur); + } else { + this.text.dialogText(false, ""); + this.text.characterName(false, ""); + } for(let c of Object.keys(this.currentCharacters)) { if(!this.currentCharacters[c]) { continue; } let curChar = this.currentCharacters[c]; @@ -623,6 +636,7 @@ class Player { break; } } + break; } case "tween": this.processTween(delta, cur); @@ -683,6 +697,12 @@ class Player { break; case "skillmovie": //103500341 break; + case "unhappyseed_appearance01": { //312000112 + let customCommand = { Command: "", Arg1: cur.Arg1, Arg2: this.defaultCharPattern, Arg3: 'キャラ中央', Arg6: .5 }; + this.checkPutCharacterScreen(customCommand, false); + break; + } + case "unhappyseed_appearance02": //312000111 case "arcanoise_appearance02": { //103500341 if(cur.Arg1 && cur.Arg2) { this.waitTime = 1000; @@ -754,10 +774,6 @@ class Player { break; case "somethingnew_appearance01": //312000111 break; - case "unhappyseed_appearance01"://312000112 - break; - case "unhappyseed_appearance02": //312000111 - break; case "continue01": break; } @@ -1188,11 +1204,11 @@ class Player { processEndCommand(delta) { let cur = this.currentCommand; - switch(cur.Command) { - case "SceneTitle01": + switch((cur.Command || "").toLowerCase()) { + case "scenetitle": this.text.titleText(false, ''); break; - case "DivaEffect": + case "divaeffect": this.text.divaText(false, ''); break; } diff --git a/Js/Translations b/Js/Translations index 1f88521..5687378 160000 --- a/Js/Translations +++ b/Js/Translations @@ -1 +1 @@ -Subproject commit 1f88521db3728137541cde68c0389562cb390fc6 +Subproject commit 5687378f81f332e32668763f04335f3883f35e4e diff --git a/Js/UtageParse.js b/Js/UtageParse.js index b110041..fae5c62 100644 --- a/Js/UtageParse.js +++ b/Js/UtageParse.js @@ -32,10 +32,11 @@ class UtageInfo { commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Sound.tsv`), commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Texture.tsv`), commonFunctions.getFileJson(`${this.rootDirectory}Js/BgmLoop.json`), + commonFunctions.getFileJson(`${this.rootDirectory}Js/XduMissionsCustom.json`), ]; Promise.all(promises) .then((success) => { - this.groupMissions(success[0]); + this.groupMissions(success[0], success[8]); this.missionsList = Object.keys(this.groupedMissions).map((k) => { return {Name: this.groupedMissions[k].Name, MstId: this.groupedMissions[k].MstId}; }); @@ -81,7 +82,7 @@ class UtageInfo { } - groupMissions(missions) { + groupMissions(missions, customMissions) { for(let key of Object.keys(missions)) { let mis = missions[key]; if(!this.groupedMissions[mis.MstId]) { @@ -96,6 +97,20 @@ class UtageInfo { this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path }; } } + for(let key of Object.keys(customMissions)) { + let mis = customMissions[key]; + if(!this.groupedMissions[mis.MstId]) { + this.groupedMissions[mis.MstId] = { + Name: mis.Name, + SummaryText: mis.SummaryText, + MstId: mis.MstId, + Missions: {} + } + this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path }; + } else { + this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path }; + } + } } get translations() { @@ -167,9 +182,16 @@ class UtageInfo { if(this.missionTranslationsInner[this.currentTranslation]) { resolve(); } else { - commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNames_${this.currentTranslation}.json`) + var promises = [ + commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNamesCustom_${this.currentTranslation}.json`), + commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNamesCustom_${this.currentTranslation}.json`) + ]; + Promise.all(promises) .then((success) => { - this.missionTranslationsInner[this.currentTranslation] = success; + for(let m of Object.keys(success[1])) { + success[0][m] = success[1][m]; + } + this.missionTranslationsInner[this.currentTranslation] = success[0]; resolve(); }, (failure) => { console.log(failure); diff --git a/Js/XduMissionsCustom.json b/Js/XduMissionsCustom.json new file mode 100644 index 0000000..3a0c024 --- /dev/null +++ b/Js/XduMissionsCustom.json @@ -0,0 +1,11 @@ +{ + "312000111": { + "Path": "Asset/Utage/event011/Scenario/312000111.tsv.utage", + "MstId": 338003, + "Id": "312000111", + "LastUpdateTime": 636340306980000000, + "Type": 1, + "Name": "EV11-1:BG", + "SummaryText": "" + } +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 621672d..b3fb723 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,7 +28,8 @@ const cssToCopy = [ ]; const jsonFiles = [ "Js/BgmLoop.json", -"Js/XduMissions.json" +"Js/XduMissions.json", +"Js/XduMissionsCustom.json" ]; const translations = [ "Js/Translations/**"