diff --git a/assets/images/editors/character/edit-button.png b/assets/images/editors/character/edit-button.png index 7c257b71..47991177 100644 Binary files a/assets/images/editors/character/edit-button.png and b/assets/images/editors/character/edit-button.png differ diff --git a/source/funkin/editors/character/CharacterAnimButtons.hx b/source/funkin/editors/character/CharacterAnimButtons.hx index c80913cd..01ba60d4 100644 --- a/source/funkin/editors/character/CharacterAnimButtons.hx +++ b/source/funkin/editors/character/CharacterAnimButtons.hx @@ -44,7 +44,10 @@ class CharacterAnimButtons extends UIButton { editButton.autoAlpha = false; members.push(editButton); - editIcon = new FlxSprite(editButton.x + 8, editButton.y + 8).loadGraphic(Paths.image('editors/character/edit-button')); + editIcon = new FlxSprite(editButton.x + 8, editButton.y + 8).loadGraphic(Paths.image('editors/character/edit-button'), true, 16, 16); + editIcon.animation.add("edit", [0]); + editIcon.animation.add("advanced", [1]); + editIcon.animation.play("edit"); editIcon.antialiasing = false; members.push(editIcon); diff --git a/source/funkin/editors/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx index fa41a5a6..6bb54a80 100644 --- a/source/funkin/editors/stage/StageEditor.hx +++ b/source/funkin/editors/stage/StageEditor.hx @@ -645,6 +645,7 @@ class StageEditor extends UIState { saveToXml(spriteXML, "beatOffset", node.getAtt("beatOffset"), 0); saveToXml(spriteXML, "type", sprite.spriteAnimType, LOOP); saveToXml(spriteXML, "color", sprite.color.toWebString(), "#FFFFFF"); + // TODO: save custom parameters //saveToXml(spriteXML, "flipX", sprite.flipX, false); newNode = spriteXML; } else if(button is StageCharacterButton) { @@ -676,6 +677,7 @@ class StageEditor extends UIState { saveToXml(charXML, "flipX", charPos.flipX, defaultPos.flip); savePointToXml(charXML, "scroll", charPos.scrollFactor, defaultPos.scroll); savePointToXml(charXML, "scale", charPos.scale, 1); + // TODO: save custom parameters newNode = charXML; } else if(button is StageUnknownButton) { var button:StageUnknownButton = cast button; diff --git a/source/funkin/editors/stage/elements/StageCharacterButton.hx b/source/funkin/editors/stage/elements/StageCharacterButton.hx index 44ff1ec4..f23d6fe4 100644 --- a/source/funkin/editors/stage/elements/StageCharacterButton.hx +++ b/source/funkin/editors/stage/elements/StageCharacterButton.hx @@ -16,6 +16,8 @@ class StageCharacterButton extends StageElementButton { color = 0xff7aa8ff; + hasAdvancedEdit = true; + updateInfo(); } diff --git a/source/funkin/editors/stage/elements/StageElementButton.hx b/source/funkin/editors/stage/elements/StageElementButton.hx index ec646615..6ce04ddf 100644 --- a/source/funkin/editors/stage/elements/StageElementButton.hx +++ b/source/funkin/editors/stage/elements/StageElementButton.hx @@ -18,6 +18,7 @@ class StageElementButton extends UIButton { public var deleteIcon:FlxSprite; public var isHidden:Bool = false; + public var hasAdvancedEdit:Bool = false; public var selected:Bool = false; @@ -62,7 +63,9 @@ class StageElementButton extends UIButton { editButton.autoAlpha = false; members.push(editButton); - editIcon = new FlxSprite(editButton.x + 8, editButton.y + 8).loadGraphic(Paths.image('editors/character/edit-button')); + editIcon = new FlxSprite(editButton.x + 8, editButton.y + 8).loadGraphic(Paths.image('editors/character/edit-button'), true, 16, 16); + editIcon.animation.add("edit", [0]); + editIcon.animation.add("advanced", [1]); editIcon.antialiasing = false; members.push(editIcon); @@ -76,8 +79,21 @@ class StageElementButton extends UIButton { deleteIcon = new FlxSprite(deleteButton.x + (15/2), deleteButton.y + 8).loadGraphic(Paths.image('editors/delete-button')); deleteIcon.antialiasing = false; members.push(deleteIcon); + + setEditNormal(); } + public function setEditNormal() { + editIcon.animation.play("edit"); + editButton.color = FlxColor.YELLOW; + } + + public function setEditAdvanced() { + editIcon.animation.play("advanced"); + editButton.color = 0xFFFF5B0F; + } + + var _lastSelected:Bool = false; public override function update(elapsed:Float) { @@ -89,6 +105,14 @@ class StageElementButton extends UIButton { super.update(elapsed); field.x += 12; + if(hasAdvancedEdit) { + if(FlxG.keys.pressed.SHIFT) { + setEditAdvanced(); + } else { + setEditNormal(); + } + } + tagColor.color = color; } diff --git a/source/funkin/editors/stage/elements/StageSpriteButton.hx b/source/funkin/editors/stage/elements/StageSpriteButton.hx index bd38fd06..485eca9f 100644 --- a/source/funkin/editors/stage/elements/StageSpriteButton.hx +++ b/source/funkin/editors/stage/elements/StageSpriteButton.hx @@ -14,6 +14,8 @@ class StageSpriteButton extends StageElementButton { //color = 0xFFD9FF50; + hasAdvancedEdit = true; + updateInfo(); } diff --git a/source/funkin/editors/stage/elements/StageUnknownButton.hx b/source/funkin/editors/stage/elements/StageUnknownButton.hx index 371ba403..12c8c5d3 100644 --- a/source/funkin/editors/stage/elements/StageUnknownButton.hx +++ b/source/funkin/editors/stage/elements/StageUnknownButton.hx @@ -24,6 +24,8 @@ class StageUnknownButton extends StageElementButton { visibilityIcon.exists = false; members.remove(visibilityIcon); + setEditAdvanced(); + updateInfo(); }