diff --git a/Js/Main.js b/Js/Main.js index ed6632b..1a9c59f 100644 --- a/Js/Main.js +++ b/Js/Main.js @@ -375,7 +375,6 @@ function sceneSet(questSceneMstId, cust) { } function playNext() { - if (!partPlaylist.length) { if (!scenePlaylist.length) { resetPlaylist(); @@ -389,7 +388,6 @@ function playNext() { } function partChanged(part) { - let cust = currentScene.IsCustom ? CUSTOM.custom : CUSTOM.stock; let name = currentScene.Name; let tl_key = utage.sceneTranslations[cust][currentScene.QuestSceneMstId]; diff --git a/Js/Player.js b/Js/Player.js index 2be1e92..ac16591 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -14,7 +14,9 @@ class Player { this.baseFps = 60; //I am assuming that PIXI is going to stay as keeping 60fps = delta1. this.bgLayerName = "背景"; //The label for the BG layer. this.defaultCharPattern = 'すまし'; //The mission file doesn't always give a pattern for putting a character on the screen. + this.speakCharTint = 0xFFFFFF; this.backCharTint = 0x808080; + this.backCharTintPercent = 0.5020; //0x808080 / 0xFFFFFF this.titleWaitTime = 5; this.currentCharacters = {}; @@ -920,11 +922,23 @@ class Player { fadeTime = (Number(cur.Arg6) * 1000) / 2; } this.currentCharacters[cur.Arg3] = { layer: lay, character: chr, charName: charToLoad, sprite: sprite }; - if(fadeTime > 0) { - this.lerpTargets.push({type: 'alpha', object: sprite, curTime: 0, time: fadeTime, finalV: 1, initV: 0 }); + //If we are just changing pattern keep the tint from the previous character + if(prevChar && prevChar.charName === charToLoad && prevChar.character.Pattern !== chr.Pattern && prevChar.restoreTint) { + this.currentCharacters[cur.Arg3].restoreTint = prevChar.restoreTint; + this.currentCharacters[cur.Arg3].sprite.color = prevChar.sprite.color; + if(fadeTime > 0) { + this.lerpTargets.push({type: 'alpha', object: sprite, curTime: 0, time: fadeTime, finalV: prevChar.sprite.alpha, initV: 0 }); + } else { + sprite.alpha = prevChar.sprite.alpha; + } } else { - sprite.alpha = 1; + if(fadeTime > 0) { + this.lerpTargets.push({type: 'alpha', object: sprite, curTime: 0, time: fadeTime, finalV: 1, initV: 0 }); + } else { + sprite.alpha = 1; + } } + lay.container.addChild(sprite); lay.container.visible = true; } @@ -992,7 +1006,8 @@ class Player { //future note: This might be better to just look for the character in character info if this start failing. for(const c of Object.keys(this.currentCharacters)) { if(!this.currentCharacters[c]) { continue; } - if(this.currentCharacters[c].charName === cur.Arg1 || this.currentCharacters[c].charName === cur.Character) { + const curChar = this.currentCharacters[c]; + if(curChar.charName === cur.Arg1 || curChar.charName === cur.Character) { let nameToUse = this.currentCharacters[c].character.NameText; //If cur.Character is set that means the line had a