From e668907384904f213edab35ed87971c9b9d52a12 Mon Sep 17 00:00:00 2001 From: JordanSantiagoYT Date: Thu, 19 Dec 2024 18:01:41 -0500 Subject: [PATCH] yeah keep flixel 5.6.2 please fixes camera pointer not showing, closes #812 --- setup/unix.sh | 6 +++--- setup/windows.bat | 6 +++--- source/editors/CharacterEditorState.hx | 29 +++++++++++++------------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/setup/unix.sh b/setup/unix.sh index 4d431fb3afc..be3f70a9a72 100644 --- a/setup/unix.sh +++ b/setup/unix.sh @@ -6,9 +6,9 @@ echo Installing dependencies... echo This might take a few moments depending on your internet speed. haxelib install lime haxelib install openfl -haxelib install flixel -haxelib install flixel-addons -haxelib install flixel-tools +haxelib install flixel 5.6.2 +haxelib install flixel-addons 3.2.2 +haxelib install flixel-tools 1.5.1 haxelib install flixel-ui haxelib install hscript haxelib install hxcpp-debug-server diff --git a/setup/windows.bat b/setup/windows.bat index 640fc1985a3..31aa616701d 100644 --- a/setup/windows.bat +++ b/setup/windows.bat @@ -6,9 +6,9 @@ echo This might take a few moments depending on your internet speed. @echo on haxelib install lime haxelib install openfl -haxelib install flixel -haxelib install flixel-addons -haxelib install flixel-tools +haxelib install flixel 5.6.2 +haxelib install flixel-addons 3.2.2 +haxelib install flixel-tools 1.5.1 haxelib install flixel-ui haxelib install hxCodec 2.5.1 haxelib install hscript diff --git a/source/editors/CharacterEditorState.hx b/source/editors/CharacterEditorState.hx index 4998260753f..f285c8c1291 100644 --- a/source/editors/CharacterEditorState.hx +++ b/source/editors/CharacterEditorState.hx @@ -115,11 +115,9 @@ class CharacterEditorState extends MusicBeatState ghostLayer = new FlxTypedGroup(); add(ghostLayer); - var pointer:FlxGraphic = FlxGraphic.fromClass(GraphicCursorCross); - cameraFollowPointer = new FlxSprite().loadGraphic(pointer); + cameraFollowPointer = new FlxSprite().loadGraphic(FlxGraphic.fromClass(GraphicCursorCross)); cameraFollowPointer.setGraphicSize(40, 40); cameraFollowPointer.updateHitbox(); - cameraFollowPointer.color = FlxColor.WHITE; add(cameraFollowPointer); changeBGbutton = new FlxButton(FlxG.width - 360, 25, "", function() @@ -1182,18 +1180,21 @@ class CharacterEditorState extends MusicBeatState } function updatePointerPos() { - var x:Float = char.getMidpoint().x; - var y:Float = char.getMidpoint().y; - if(!char.isPlayer) { - x += 150 + char.cameraPosition[0]; - } else { - x -= 100 + char.cameraPosition[0]; - } - y -= 100 - char.cameraPosition[1]; + if(char == null || cameraFollowPointer == null) return; - x -= cameraFollowPointer.width / 2; - y -= cameraFollowPointer.height / 2; - cameraFollowPointer.setPosition(x, y); + var offX:Float = 0; + var offY:Float = 0; + if(!char.isPlayer) + { + offX = char.getMidpoint().x + 150 + char.cameraPosition[0]; + offY = char.getMidpoint().y - 100 + char.cameraPosition[1]; + } + else + { + offX = char.getMidpoint().x - 100 - char.cameraPosition[0]; + offY = char.getMidpoint().y - 100 + char.cameraPosition[1]; + } + cameraFollowPointer.setPosition(offX, offY); } function findAnimationByName(name:String):AnimArray {