diff --git a/source/funkin/editors/character/CharacterAnimButtons.hx b/source/funkin/editors/character/CharacterAnimButtons.hx index d4b9c858..e0ebd3b9 100644 --- a/source/funkin/editors/character/CharacterAnimButtons.hx +++ b/source/funkin/editors/character/CharacterAnimButtons.hx @@ -20,10 +20,12 @@ class CharacterAnimButtons extends UIButton { super(x,y, '$anim (${offset.x}, ${offset.y})', function () { CharacterEditor.instance.playAnimation(this.anim); }, 282); + autoAlpha = false; ghostButton = new UIButton(x+282+17, y, "", function () { CharacterEditor.instance.ghostAnim(this.anim); }, 32); + ghostButton.autoAlpha = false; members.push(ghostButton); ghostIcon = new FlxSprite(ghostButton.x + 8, ghostButton.y + 8).loadGraphic(Paths.image('editors/character/ghost-button'), true, 16, 16); @@ -38,6 +40,7 @@ class CharacterAnimButtons extends UIButton { CharacterEditor.instance.editAnimWithUI(this.anim); }, 32); editButton.color = FlxColor.YELLOW; + editButton.autoAlpha = false; members.push(editButton); editIcon = new FlxSprite(editButton.x + 8, editButton.y + 8).loadGraphic(Paths.image('editors/character/edit-button')); @@ -48,6 +51,7 @@ class CharacterAnimButtons extends UIButton { CharacterEditor.instance.deleteAnim(this.anim); }, 32); deleteButton.color = FlxColor.RED; + deleteButton.autoAlpha = false; members.push(deleteButton); deleteIcon = new FlxSprite(deleteButton.x + (15/2), deleteButton.y + 8).loadGraphic(Paths.image('editors/character/delete-button')); diff --git a/source/funkin/editors/charter/CharterEventScreen.hx b/source/funkin/editors/charter/CharterEventScreen.hx index e1e4eb25..f7d40c06 100644 --- a/source/funkin/editors/charter/CharterEventScreen.hx +++ b/source/funkin/editors/charter/CharterEventScreen.hx @@ -219,29 +219,28 @@ class EventButton extends UIButton { public var deleteIcon:FlxSprite; public function new(event:ChartEvent, icon:FlxSprite, id:Int, substate:CharterEventScreen, parent:UIButtonList) { - super(0,0,"" ,function() { - substate.changeTab(id); - for(i in parent.buttons.members) { - if(i is EventButton) { - var i:EventButton = cast i; - i.alpha = i == this ? 1 : 0.25; - } - } - },73,40); - members.push(icon); this.icon = icon; this.event = event; + super(0,0,"" ,function() { + substate.changeTab(id); + for(i in parent.buttons.members) + i.alpha = i == this ? 1 : 0.25; + },73,40); + autoAlpha = false; + + members.push(icon); icon.setPosition(18 - icon.width / 2, 20 - icon.height / 2); + deleteButton = new UIButton(bWidth - 30, y + (bHeight - 26) / 2, "", function () { substate.events.splice(id, 1); substate.changeTab(id, false); parent.remove(this); }, 26, 26); deleteButton.color = FlxColor.RED; + deleteButton.autoAlpha = false; members.push(deleteButton); deleteIcon = new FlxSprite(deleteButton.x + (15/2), deleteButton.y + 4).loadGraphic(Paths.image('editors/character/delete-button')); - deleteIcon.antialiasing = false; members.push(deleteIcon); } diff --git a/source/funkin/editors/charter/CharterStrumlineScreen.hx b/source/funkin/editors/charter/CharterStrumlineScreen.hx index 9bbf339f..0f2341a9 100644 --- a/source/funkin/editors/charter/CharterStrumlineScreen.hx +++ b/source/funkin/editors/charter/CharterStrumlineScreen.hx @@ -164,6 +164,7 @@ class CharacterButton extends UIButton { public function new(x:Float, y:Float, char:String, parent:UIButtonList) { super(x, y, "", null, 250, 54); + autoAlpha = false; charIcon = new HealthIcon(Character.getIconFromCharName(char)); charIcon.scale.set(0.3, 0.3); @@ -188,6 +189,7 @@ class CharacterButton extends UIButton { parent.remove(this); }, 32); deleteButton.color = 0xFFFF0000; + deleteButton.autoAlpha = false; members.push(deleteButton); deleteIcon = new FlxSprite(deleteButton.x + (15/2), deleteButton.y + 8).loadGraphic(Paths.image('editors/character/delete-button')); diff --git a/source/funkin/editors/ui/UIButton.hx b/source/funkin/editors/ui/UIButton.hx index f39730f9..c5a7fe80 100644 --- a/source/funkin/editors/ui/UIButton.hx +++ b/source/funkin/editors/ui/UIButton.hx @@ -23,8 +23,7 @@ class UIButton extends UISliceSprite { public override function resize(w:Int, h:Int) { super.resize(w, h); - if (field != null) - field.fieldWidth = w; + if (field != null) field.fieldWidth = w; } public override function onHovered() { @@ -39,6 +38,7 @@ class UIButton extends UISliceSprite { public override function update(elapsed:Float) { field.follow(this, 0, (bHeight - field.height) / 2); if (!hovered && hasBeenPressed && FlxG.mouse.justReleased) hasBeenPressed = false; + if (autoAlpha) alpha = field.alpha = selectable ? 1 : 0.4; super.update(elapsed); } diff --git a/source/funkin/editors/ui/UIButtonList.hx b/source/funkin/editors/ui/UIButtonList.hx index d40ac1b5..411539ae 100644 --- a/source/funkin/editors/ui/UIButtonList.hx +++ b/source/funkin/editors/ui/UIButtonList.hx @@ -36,6 +36,7 @@ class UIButtonList extends UIWindow { buttonCameras.bgColor = 0; addButton = new UIButton(25, 16, "", null, Std.int(this.buttonSize.x)); + addButton.autoAlpha = false; addButton.color = 0xFF00FF00; addButton.cameras = [buttonCameras]; diff --git a/source/funkin/editors/ui/UISprite.hx b/source/funkin/editors/ui/UISprite.hx index 371d7953..5a41cec3 100644 --- a/source/funkin/editors/ui/UISprite.hx +++ b/source/funkin/editors/ui/UISprite.hx @@ -25,6 +25,7 @@ class UISprite extends FlxSprite { public var focused(get, set):Bool; public var selectable:Bool = true; + public var autoAlpha:Bool = true; private inline function get_focused():Bool return UIState.state.currentFocus == cast this; diff --git a/source/funkin/editors/ui/UITextBox.hx b/source/funkin/editors/ui/UITextBox.hx index 443fd890..17f7222e 100644 --- a/source/funkin/editors/ui/UITextBox.hx +++ b/source/funkin/editors/ui/UITextBox.hx @@ -59,11 +59,12 @@ class UITextBox extends UISliceSprite implements IUIFocusable { super.update(elapsed); var selected = selectable && focused; - - if(selectable) { - alpha = label.alpha = 1; - } else { - alpha = label.alpha = 0.4; + if (autoAlpha) { + if(selectable) { + alpha = label.alpha = 1; + } else { + alpha = label.alpha = 0.4; + } } var off = multiline ? 4 : ((bHeight - label.height) / 2); diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 1309b144..988aac6a 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -34,10 +34,7 @@ class Options public static var hitWindow:Float = 250; public static var songOffset:Float = 0; public static var framerate:Int = 120; - public static var gpuOnlyBitmaps:Bool = - #if mac false - #elseif !web false - #else true #end; // causes issues on mac + public static var gpuOnlyBitmaps:Bool = #if (mac || web) false #else true #end; // causes issues on mac and web public static var lastLoadedMod:String = null;