Skip to content

Commit

Permalink
here
Browse files Browse the repository at this point in the history
  • Loading branch information
lunarcleint committed Aug 20, 2023
1 parent 8e536ee commit 9918b83
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 20 deletions.
4 changes: 4 additions & 0 deletions source/funkin/editors/character/CharacterAnimButtons.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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'));
Expand All @@ -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'));
Expand Down
17 changes: 8 additions & 9 deletions source/funkin/editors/charter/CharterEventScreen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<EventButton>) {
this.icon = icon;
this.event = event;
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;
}
}
for(i in parent.buttons.members)
i.alpha = i == this ? 1 : 0.25;
},73,40);
autoAlpha = false;

members.push(icon);
this.icon = icon;
this.event = event;
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);
}
Expand Down
2 changes: 2 additions & 0 deletions source/funkin/editors/charter/CharterStrumlineScreen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class CharacterButton extends UIButton {

public function new(x:Float, y:Float, char:String, parent:UIButtonList<CharacterButton>) {
super(x, y, "", null, 250, 54);
autoAlpha = false;

charIcon = new HealthIcon(Character.getIconFromCharName(char));
charIcon.scale.set(0.3, 0.3);
Expand All @@ -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'));
Expand Down
4 changes: 2 additions & 2 deletions source/funkin/editors/ui/UIButton.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions source/funkin/editors/ui/UIButtonList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class UIButtonList<T:UIButton> 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];

Expand Down
1 change: 1 addition & 0 deletions source/funkin/editors/ui/UISprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 6 additions & 5 deletions source/funkin/editors/ui/UITextBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions source/funkin/options/Options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9918b83

Please sign in to comment.