diff --git a/assets b/assets index e6f463fb6..60e1909a8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit e6f463fb6422b78717c00fa2ab93bbabbe55c613 +Subproject commit 60e1909a8266d6a1c121d922e8ad296b71416b4a diff --git a/source/funkin/play/cutscene/dialogue/DialogueBox.hx b/source/funkin/play/cutscene/dialogue/DialogueBox.hx index 729639437..46318f523 100644 --- a/source/funkin/play/cutscene/dialogue/DialogueBox.hx +++ b/source/funkin/play/cutscene/dialogue/DialogueBox.hx @@ -10,7 +10,6 @@ import funkin.modding.events.ScriptEvent; import funkin.audio.FunkinSound; import funkin.modding.IScriptedClass.IDialogueScriptedClass; import flixel.util.FlxColor; -import funkin.ui.FullScreenScaleMode; import funkin.data.dialogue.DialogueBoxData; import funkin.data.dialogue.DialogueBoxRegistry; @@ -28,6 +27,11 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple */ var animationOffsets:Map> = new Map>(); + /** + * The position without offsets applied. + */ + var originalPosition:Array = [0, 0]; + /** * The current animation offset being used. */ @@ -36,13 +40,10 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple function set_animOffsets(value:Array):Array { if (animOffsets == null) animOffsets = [0, 0]; - if ((animOffsets[0] == value[0]) && (animOffsets[1] == value[1])) return value; + if (animOffsets == value) return value; - var xDiff:Float = value[0] - animOffsets[0]; - var yDiff:Float = value[1] - animOffsets[1]; - - this.x += xDiff; - this.y += yDiff; + this.x = globalOffsets[0] + originalPosition[0] + value[0]; + this.y = globalOffsets[1] + originalPosition[1] + value[1]; return animOffsets = value; } @@ -57,17 +58,13 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple if (globalOffsets == null) globalOffsets = [0, 0]; if (globalOffsets == value) return value; - var xDiff:Float = value[0] - globalOffsets[0]; - var yDiff:Float = value[1] - globalOffsets[1]; + this.screenCenter(); - this.x += xDiff; - this.y += yDiff; + originalPosition[0] = this.x; + originalPosition[1] = this.y; - if (FullScreenScaleMode.wideScale.x != 1) - { - this.x *= fullscreenScale; - this.y = this.y * fullscreenScale + (-100 * fullscreenScale); - } + this.x = value[0] + originalPosition[0] + animOffsets[0]; + this.y = value[1] + originalPosition[1] + animOffsets[1]; return globalOffsets = value; } @@ -96,16 +93,6 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple return this.speed; } - /** - * A value used for scaling object's parameters on mobile. - */ - var fullscreenScale(get, never):Float; - - function get_fullscreenScale():Float - { - return FullScreenScaleMode.wideScale.x - 0.05; - } - public function new(id:String, ?params:Dynamic) { super(); @@ -120,9 +107,9 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple public function onCreate(event:ScriptEvent):Void { - this.globalOffsets = [0, 0]; this.x = 0; this.y = 0; + this.globalOffsets = [0, 0]; this.alpha = 1; loadSpritesheet(); @@ -207,11 +194,6 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple { if (scale == null) scale = 1.0; - if (FullScreenScaleMode.wideScale.x != 1) - { - scale *= fullscreenScale; - } - this.boxSprite.scale.x = scale; this.boxSprite.scale.y = scale; this.boxSprite.updateHitbox(); @@ -241,6 +223,9 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple { super.revive(); + this.x = 0; + this.y = 0; + this.globalOffsets = [0, 0]; this.visible = true; this.alpha = 1.0; } @@ -309,13 +294,6 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple textDisplay.x += _data.text.offsets[0]; textDisplay.y += _data.text.offsets[1]; - if (FullScreenScaleMode.wideScale.x != 1) - { - textDisplay.fieldWidth *= fullscreenScale; - textDisplay.x *= fullscreenScale; - textDisplay.y *= fullscreenScale; - } - add(textDisplay); } diff --git a/source/funkin/play/cutscene/dialogue/Speaker.hx b/source/funkin/play/cutscene/dialogue/Speaker.hx index 5153bb12a..592c1d2cf 100644 --- a/source/funkin/play/cutscene/dialogue/Speaker.hx +++ b/source/funkin/play/cutscene/dialogue/Speaker.hx @@ -8,7 +8,6 @@ import funkin.util.assets.FlxAnimationUtil; import funkin.modding.IScriptedClass.IDialogueScriptedClass; import funkin.data.dialogue.SpeakerData; import funkin.data.dialogue.SpeakerRegistry; -import funkin.ui.FullScreenScaleMode; /** * The character sprite which displays during dialogue. @@ -32,6 +31,11 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe */ var animationOffsets:Map> = new Map>(); + /** + * The position without offsets applied. + */ + var originalPosition:Array = [0, 0]; + /** * The current animation offset being used. */ @@ -40,13 +44,10 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe function set_animOffsets(value:Array):Array { if (animOffsets == null) animOffsets = [0, 0]; - if ((animOffsets[0] == value[0]) && (animOffsets[1] == value[1])) return value; + if (animOffsets == value) return value; - var xDiff:Float = value[0] - animOffsets[0]; - var yDiff:Float = value[1] - animOffsets[1]; - - this.x += xDiff; - this.y += yDiff; + this.x = globalOffsets[0] + originalPosition[0] + value[0]; + this.y = globalOffsets[1] + originalPosition[1] + value[1]; return animOffsets = value; } @@ -61,31 +62,12 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe if (globalOffsets == null) globalOffsets = [0, 0]; if (globalOffsets == value) return value; - var xDiff:Float = value[0] - globalOffsets[0]; - var yDiff:Float = value[1] - globalOffsets[1]; - - this.x += xDiff; - this.y += yDiff; - - if (FullScreenScaleMode.wideScale.x != 1) - { - this.x *= fullscreenScale; - this.y = this.y * fullscreenScale + (-100 * fullscreenScale); - } + this.x = value[0] + originalPosition[0] + animOffsets[0]; + this.y = value[1] + originalPosition[1] + animOffsets[1]; return globalOffsets = value; } - /** - * A value used for scaling object's parameters on mobile. - */ - var fullscreenScale(get, never):Float; - - function get_fullscreenScale():Float - { - return FullScreenScaleMode.wideScale.x - 0.05; - } - public function new(id:String, ?params:Dynamic) { super(); @@ -105,9 +87,9 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe */ public function onCreate(event:ScriptEvent):Void { - this.globalOffsets = [0, 0]; this.x = 0; this.y = 0; + this.globalOffsets = [0, 0]; this.alpha = 1; loadSpritesheet(); @@ -127,6 +109,9 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe { super.revive(); + this.x = 0; + this.y = 0; + this.globalOffsets = [0, 0]; this.visible = true; this.alpha = 1.0; @@ -156,6 +141,11 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe this.antialiasing = true; } + this.screenCenter(); + + originalPosition[0] = this.x; + originalPosition[1] = this.y; + this.flipX = _data.flipX; this.flipY = _data.flipY; this.globalOffsets = _data.offsets; @@ -170,11 +160,6 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe { if (scale == null) scale = 1.0; - if (FullScreenScaleMode.wideScale.x != 1) - { - scale *= fullscreenScale; - } - this.scale.x = scale; this.scale.y = scale; this.updateHitbox();