dumping a bunch of stuff (ui button list still fucking broken)
This commit is contained in:
@@ -31,7 +31,7 @@ class CharacterEditor extends UIState {
|
||||
|
||||
// WINDOWS
|
||||
public var characterPropertiresWindow:CharacterPropertiesWindow;
|
||||
public var characterAnimsWindow:UIButtonList;
|
||||
public var characterAnimsWindow:UIButtonList<CharacterAnimButtons>;
|
||||
|
||||
// camera for the character itself so that it can be unzoomed/zoomed in again
|
||||
public var charCamera:FlxCamera;
|
||||
@@ -236,10 +236,13 @@ class CharacterEditor extends UIState {
|
||||
topMenuSpr.cameras = uiGroup.cameras = [uiCamera];
|
||||
|
||||
characterPropertiresWindow = new CharacterPropertiesWindow();
|
||||
characterAnimsWindow = new UIButtonList(777, 209, 473, 488, "Character Animations", function() CharacterEditor.instance.createAnimWithUI());
|
||||
for (i=>anim in character.getNameList())
|
||||
characterAnimsWindow.insert(new CharacterAnimButtons(0,0, anim, character.getAnimOffset(anim)), 0);
|
||||
uiGroup.add(characterPropertiresWindow);
|
||||
|
||||
characterAnimsWindow = new UIButtonList<CharacterAnimButtons>(777, 209, 473, 488, "Character Animations", FlxPoint.get(429, 32), FlxPoint.get(0, 16));
|
||||
characterAnimsWindow.addButton.callback =
|
||||
function() CharacterEditor.instance.createAnimWithUI();
|
||||
for (i=>anim in character.getNameList())
|
||||
characterAnimsWindow.add(new CharacterAnimButtons(0,0, anim, character.getAnimOffset(anim)));
|
||||
uiGroup.add(characterAnimsWindow);
|
||||
|
||||
playAnimation(character.getNameList()[0]);
|
||||
@@ -263,7 +266,7 @@ class CharacterEditor extends UIState {
|
||||
}
|
||||
|
||||
if (character != null)
|
||||
characterPropertiresWindow.characterInfo.text = '(${character.getNameList().length}) Animations\nFlipped: ${character.flipX}\nSprite: ${character.sprite}\nAnim: ${character.getAnimName()}\nOffset: (${character.frameOffset.x}, ${character.frameOffset.y})';
|
||||
characterPropertiresWindow.characterInfo.text = '${character.getNameList().length} Animations\nFlipped: ${character.flipX}\nSprite: ${character.sprite}\nAnim: ${character.getAnimName()}\nOffset: (${character.frameOffset.x}, ${character.frameOffset.y})';
|
||||
|
||||
if (!(characterPropertiresWindow.hovered || characterAnimsWindow.hovered) && !characterAnimsWindow.dragging) {
|
||||
if (FlxG.mouse.wheel != 0) {
|
||||
@@ -376,10 +379,9 @@ class CharacterEditor extends UIState {
|
||||
ghosts.setOffsets(anim, offsets.clone());
|
||||
}
|
||||
|
||||
for (button in characterAnimsWindow.buttons.members) {
|
||||
var charButton:CharacterAnimButtons = cast(button, CharacterAnimButtons);
|
||||
for (charButton in characterAnimsWindow.buttons.members)
|
||||
charButton.updateInfo(charButton.anim, character.getAnimOffset(charButton.anim), ghosts.animGhosts[charButton.anim].visible);
|
||||
}
|
||||
|
||||
changeOffset(character.getAnimName(), FlxPoint.get(0, 0), false); // apply da new offsets
|
||||
}
|
||||
if (v != null)
|
||||
@@ -436,10 +438,12 @@ class CharacterEditor extends UIState {
|
||||
}));
|
||||
}
|
||||
|
||||
public function createAnim(animData:AnimData, animID:Int = 0, addtoUndo:Bool = true) {
|
||||
public function createAnim(animData:AnimData, animID:Int = -1, addtoUndo:Bool = true) {
|
||||
XMLUtil.addAnimToSprite(character, animData);
|
||||
ghosts.createGhost(animData.name);
|
||||
characterAnimsWindow.insert(new CharacterAnimButtons(0, 0, animData.name, FlxPoint.get(animData.x,animData.y)), animID);
|
||||
var newButton = new CharacterAnimButtons(0, 0, animData.name, FlxPoint.get(animData.x,animData.y));
|
||||
if (animID == -1) characterAnimsWindow.add(newButton);
|
||||
else characterAnimsWindow.insert(newButton, animID);
|
||||
|
||||
playAnimation(animData.name);
|
||||
|
||||
@@ -450,7 +454,8 @@ class CharacterEditor extends UIState {
|
||||
public function editAnim(name:String, animData:AnimData, addtoUndo:Bool = true) {
|
||||
var oldAnimData:AnimData = character.animDatas.get(name);
|
||||
var buttoner:CharacterAnimButtons = null;
|
||||
for (i in characterAnimsWindow.members) if (cast(i, CharacterAnimButtons).anim == name) buttoner = cast i;
|
||||
for (button in characterAnimsWindow.buttons.members)
|
||||
if (button.anim == name) buttoner = button;
|
||||
|
||||
ghosts.removeGhost(name);
|
||||
XMLUtil.addAnimToSprite(character, animData);
|
||||
@@ -470,6 +475,9 @@ class CharacterEditor extends UIState {
|
||||
else
|
||||
playAnimation(character.getNameList()[Std.int(Math.abs(character.getNameList().indexOf(name)-1))]);
|
||||
|
||||
for(button in characterAnimsWindow.buttons.members)
|
||||
if(button.anim == name) characterAnimsWindow.remove(button);
|
||||
|
||||
// undo shit blah blah
|
||||
var oldID:Int = character.getNameList().indexOf(name);
|
||||
var oldAnimData:AnimData = character.animDatas.get(name);
|
||||
@@ -478,13 +486,6 @@ class CharacterEditor extends UIState {
|
||||
character.removeAnimation(name);
|
||||
if (character.animOffsets.exists(name)) character.animOffsets.remove(name);
|
||||
if (character.animDatas.exists(name)) character.animDatas.remove(name);
|
||||
for(i in characterAnimsWindow.buttons.members) {
|
||||
if(i is CharacterAnimButtons) {
|
||||
var i:CharacterAnimButtons = cast i;
|
||||
if(i.anim == name)
|
||||
characterAnimsWindow.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (addtoUndo)
|
||||
addToUndo(CDeleteAnim(oldID, oldAnimData));
|
||||
@@ -513,9 +514,10 @@ class CharacterEditor extends UIState {
|
||||
var ghost:Character = ghosts.animGhosts.get(anim);
|
||||
ghost.visible = !ghost.visible;
|
||||
|
||||
var button:CharacterAnimButtons = null;
|
||||
for (i in characterAnimsWindow.members) if (cast(i, CharacterAnimButtons).anim == anim) button = cast(i ,CharacterAnimButtons);
|
||||
button.updateInfo(anim, character.getAnimOffset(anim), ghost.visible);
|
||||
var animButton:CharacterAnimButtons = null;
|
||||
for (button in characterAnimsWindow.buttons.members)
|
||||
if (button.anim == anim) animButton = button;
|
||||
animButton.updateInfo(anim, character.getAnimOffset(anim), ghost.visible);
|
||||
}
|
||||
|
||||
function _playback_play_anim(_) {
|
||||
|
||||
@@ -13,6 +13,7 @@ class CharacterInfoScreen extends UISubstateWindow {
|
||||
public var gameOverCharTextBox:UITextBox;
|
||||
public var antialiasingCheckbox:UICheckbox;
|
||||
public var flipXCheckbox:UICheckbox;
|
||||
public var iconColorWheel:UIColorwheel;
|
||||
public var positionXStepper:UINumericStepper;
|
||||
public var positionYStepper:UINumericStepper;
|
||||
public var cameraXStepper:UINumericStepper;
|
||||
@@ -36,7 +37,7 @@ class CharacterInfoScreen extends UISubstateWindow {
|
||||
public override function create() {
|
||||
winTitle = "Editing Character";
|
||||
winWidth = 714;
|
||||
winHeight = 500;
|
||||
winHeight = 600;
|
||||
|
||||
super.create();
|
||||
|
||||
@@ -69,7 +70,11 @@ class CharacterInfoScreen extends UISubstateWindow {
|
||||
add(flipXCheckbox);
|
||||
addLabelOn(flipXCheckbox, "Flipped");
|
||||
|
||||
add(title = new UIText(spriteTextBox.x, spriteTextBox.y + 10 + 46 + 64, 0, "Character Data", 28));
|
||||
iconColorWheel = new UIColorwheel(flipXCheckbox.x + 100, flipXCheckbox.y, character.iconColor);
|
||||
add(iconColorWheel);
|
||||
addLabelOn(iconColorWheel, "Icon Color");
|
||||
|
||||
add(title = new UIText(spriteTextBox.x, spriteTextBox.y + 10 + 46 + 64 + 100, 0, "Character Data", 28));
|
||||
|
||||
positionXStepper = new UINumericStepper(title.x, title.y + title.height + 36, character.globalOffset.x, 0.001, 2, null, null, 84);
|
||||
add(positionXStepper);
|
||||
|
||||
@@ -20,7 +20,7 @@ class CharacterPropertiesWindow extends UIWindow {
|
||||
}, 200);
|
||||
members.push(editButton);
|
||||
|
||||
characterInfo = new UIText(x + 450 + 20 - 42 - 400, y + 36 + 10, 400, "() Animations:\nFlipped:\nSprite:\nAnim:\nOffset: (,)");
|
||||
characterInfo = new UIText(x + 450 + 20 - 42 - 400, y + 36 + 10, 400, "0 Animations:\nFlipped:\nSprite:\nAnim:\nOffset: (,)");
|
||||
characterInfo.alignment = LEFT;
|
||||
members.push(characterInfo);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class CharterEventScreen extends UISubstateWindow {
|
||||
|
||||
public var step:Float = 0;
|
||||
public var events:Array<ChartEvent> = [];
|
||||
public var eventsList:UIButtonList = null;
|
||||
public var eventsList:UIButtonList<EventButton>;
|
||||
|
||||
public var eventName:UIText;
|
||||
|
||||
@@ -41,7 +41,11 @@ class CharterEventScreen extends UISubstateWindow {
|
||||
|
||||
FlxG.sound.music.pause(); // prevent the song from continuing
|
||||
Charter.instance.vocals.pause();
|
||||
eventsList = new UIButtonList(0,0,75, 570, "", ()-> openSubState(new CharterEventTypeSelection(function(eventName) {
|
||||
|
||||
events = chartEvent.events.copy();
|
||||
|
||||
eventsList = new UIButtonList<EventButton>(0,0,75, 570, "", FlxPoint.get(73, 40));
|
||||
eventsList.addButton.callback = () -> openSubState(new CharterEventTypeSelection(function(eventName) {
|
||||
events.push({
|
||||
time: Conductor.getTimeForStep(chartEvent.step),
|
||||
params: [],
|
||||
@@ -49,11 +53,11 @@ class CharterEventScreen extends UISubstateWindow {
|
||||
});
|
||||
eventsList.add(new EventButton(events[events.length-1], CharterEvent.generateEventIcon(events[events.length-1]), events.length-1, this, eventsList));
|
||||
changeTab(events.length-1);
|
||||
})), 1, 2);
|
||||
events = chartEvent.events.copy();
|
||||
}));
|
||||
for (k=>i in events)
|
||||
eventsList.add(new EventButton(i, CharterEvent.generateEventIcon(i), k, this, eventsList));
|
||||
add(eventsList);
|
||||
|
||||
paramsPanel = new FlxGroup();
|
||||
add(paramsPanel);
|
||||
|
||||
@@ -212,13 +216,15 @@ class CharterEventScreen extends UISubstateWindow {
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class EventButton extends UIButton {
|
||||
public var icon:FlxSprite = null;
|
||||
public var event:ChartEvent = null;
|
||||
public var deleteButton:UIButton;
|
||||
public var deleteIcon:FlxSprite;
|
||||
public function new(event:ChartEvent, icon:FlxSprite, id:Int, substate:CharterEventScreen, parent:UIButtonList) {
|
||||
super(0,0,"",function() {
|
||||
|
||||
public function new(event:ChartEvent, icon:FlxSprite, id:Int, substate:CharterEventScreen, parent:UIButtonList<EventButton>) {
|
||||
super(0,0,"" ,function() {
|
||||
substate.changeTab(id);
|
||||
for(i in parent.buttons.members) {
|
||||
if(i is EventButton) {
|
||||
@@ -244,6 +250,7 @@ class EventButton extends UIButton {
|
||||
deleteIcon.antialiasing = false;
|
||||
members.push(deleteIcon);
|
||||
}
|
||||
|
||||
override function update(elapsed) {
|
||||
super.update(elapsed);
|
||||
icon.setPosition(x + (18 - icon.width / 2),y + (20 - icon.height / 2));
|
||||
|
||||
@@ -10,7 +10,7 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
public var strumLineID:Int = -1;
|
||||
public var strumLine:ChartStrumLine;
|
||||
|
||||
public var charactersList:UIButtonList;
|
||||
public var charactersList:UIButtonList<CharacterButton>;
|
||||
public var typeDropdown:UIDropDown;
|
||||
public var stagePositionDropdown:UIDropDown;
|
||||
public var hudScaleStepper:UINumericStepper;
|
||||
@@ -56,8 +56,10 @@ class CharterStrumlineScreen extends UISubstateWindow {
|
||||
function addLabelOn(ui:UISprite, text:String)
|
||||
add(new UIText(ui.x, ui.y - 24, 0, text));
|
||||
|
||||
charactersList = new UIButtonList(15, 43, 250, 330, "", () -> charactersList.add(new CharacterButton(0,0,"New Char", charactersList)), 2, 2);
|
||||
for (i in strumLine.characters) charactersList.add(new CharacterButton(0,0,i, charactersList));
|
||||
charactersList = new UIButtonList<CharacterButton>(15, 43, 250, 330, "", FlxPoint.get(246, 75));
|
||||
charactersList.addButton.callback = () -> charactersList.add(new CharacterButton(0,0,"New Char", charactersList));
|
||||
for (i in strumLine.characters)
|
||||
charactersList.add(new CharacterButton(0,0,i, charactersList));
|
||||
charactersList.cameraSpacing = 2;
|
||||
add(charactersList);
|
||||
|
||||
@@ -157,7 +159,7 @@ class CharacterButton extends UIButton {
|
||||
public var deleteButton:UIButton;
|
||||
public var deleteIcon:FlxSprite;
|
||||
|
||||
public function new(x:Float, y:Float, char:String, parent:UIButtonList) {
|
||||
public function new(x:Float, y:Float, char:String, parent:UIButtonList<CharacterButton>) {
|
||||
charIcon = new HealthIcon(char);
|
||||
charIcon.scale.set(0.5, 0.5);
|
||||
charIcon.updateHitbox();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package funkin.editors;
|
||||
|
||||
import funkin.editors.ui.*;
|
||||
import flixel.math.FlxPoint;
|
||||
|
||||
using funkin.editors.ui.UIUtil;
|
||||
@@ -5,76 +5,88 @@ import flixel.group.FlxGroup;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.math.FlxPoint;
|
||||
import funkin.game.Character;
|
||||
import flixel.util.FlxSort;
|
||||
|
||||
class UIButtonList extends UIWindow {
|
||||
public var character:Character;
|
||||
|
||||
public var buttons:FlxTypedGroup<UIButton> = new FlxTypedGroup<UIButton>();
|
||||
class UIButtonList<T:UIButton> extends UIWindow {
|
||||
public var buttons:FlxTypedGroup<T> = new FlxTypedGroup<T>();
|
||||
public var addButton:UIButton;
|
||||
public var addIcon:FlxSprite;
|
||||
|
||||
public var buttonCameras:FlxCamera;
|
||||
public var cameraSpacing = 36;
|
||||
public var cameraSpacing = 30;
|
||||
|
||||
public var buttonSpacing:Float = 16;
|
||||
public var buttonSize:FlxPoint = FlxPoint.get();
|
||||
public var buttonOffset:FlxPoint = FlxPoint.get();
|
||||
|
||||
public var dragging:Bool = false;
|
||||
|
||||
var _buttonXOffset:Float = 16;
|
||||
var _buttonYOffset:Float = 16;
|
||||
var curMoving:T = null;
|
||||
var curMovingInterval:Float = 0;
|
||||
|
||||
public function new(x:Int, y:Int, width:Int, height:Int, windowName:String, addButtonCallback:Void->Void = null, buttonXOffset:Float = 16, buttonYOffset:Float = 16) {
|
||||
public function new(x:Int, y:Int, width:Int, height:Int, windowName:String, buttonSize:FlxPoint, ?buttonOffset:FlxPoint, ?buttonSpacing:Float) {
|
||||
if (buttonSpacing != null) this.buttonSpacing = buttonSpacing;
|
||||
this.buttonSize = buttonSize;
|
||||
if (buttonOffset != null) this.buttonOffset = buttonOffset;
|
||||
super(x, y, width, height, windowName);
|
||||
members.push(buttons);
|
||||
_buttonXOffset = buttonXOffset;
|
||||
_buttonYOffset = buttonYOffset;
|
||||
buttonCameras = new FlxCamera(x, y+cameraSpacing, width, height-cameraSpacing);
|
||||
|
||||
buttonCameras = new FlxCamera(x, y+cameraSpacing, width-2, height-cameraSpacing);
|
||||
FlxG.cameras.add(buttonCameras, false);
|
||||
buttonCameras.bgColor = 0;
|
||||
|
||||
addButton = new UIButton(25, 16, "", addButtonCallback != null ? addButtonCallback : function() return false, Math.floor(bWidth - buttonXOffset * 2));
|
||||
addButton = new UIButton(25, 16, "", null, Std.int(buttonSize.x));
|
||||
addButton.color = 0xFF00FF00;
|
||||
addButton.cameras = [buttonCameras];
|
||||
|
||||
addIcon = new FlxSprite(addButton.x + addButton.bHeight / 2, addButton.y + (32/2) - 8).loadGraphic(Paths.image('editors/charter/add-button'));
|
||||
addIcon.antialiasing = false;
|
||||
addButton.members.push(addIcon);
|
||||
add(addButton);
|
||||
members.push(addButton);
|
||||
|
||||
members.push(buttons);
|
||||
scrollY = buttonCameras.scroll.y = -this.buttonSpacing;
|
||||
}
|
||||
public function add(button:UIButton)
|
||||
insert(button, Math.floor(Math.max(buttons.members.indexOf(addButton), 0)));
|
||||
public function insert(button:UIButton, position:Int) {
|
||||
|
||||
public inline function add(button:T)
|
||||
buttons.add(button);
|
||||
|
||||
public inline function insert(button:T, position:Int) {
|
||||
buttons.insert(position, button);
|
||||
button.cameras = [buttonCameras];
|
||||
button.x = _buttonXOffset;
|
||||
if (addButton.bHeight != button.bHeight) addButton.bHeight = button.bHeight;
|
||||
scrollY += button.bHeight;
|
||||
}
|
||||
public function remove(button:UIButton) {
|
||||
buttons.remove(button, true);
|
||||
|
||||
public inline function remove(button:T) {
|
||||
buttons.members.remove(button);
|
||||
button.destroy();
|
||||
}
|
||||
var _curMoving:UIButton = null;
|
||||
var _curMovingInterval:Float = 0;
|
||||
public function updateButtonsPos(elapsed:Float) {
|
||||
|
||||
public inline function updateButtonsPos(elapsed:Float) {
|
||||
for (i => button in buttons.members) {
|
||||
if (_curMoving != button) {
|
||||
for (i in button.members)
|
||||
if (i is UIButton) {
|
||||
var i:UIButton = cast(i, UIButton);
|
||||
i.selectable = true;
|
||||
}
|
||||
button.y = CoolUtil.fpsLerp(button.y, -scrollY + ((buttons.members[i-1] != null ? buttons.members[i-1].bHeight : 0) + _buttonYOffset) * i, 0.25);
|
||||
button.shouldPress = true;
|
||||
if (button == null) continue;
|
||||
|
||||
if (curMoving != button) {
|
||||
button.setPosition(
|
||||
(bWidth/2) - (buttonSize.x/2),
|
||||
CoolUtil.fpsLerp(button.y, (buttonSize.y+buttonSpacing) * i, 0.25));
|
||||
}
|
||||
if (button != addButton && button.hovered && FlxG.mouse.justPressed) _curMoving = button;
|
||||
if (button.hovered && FlxG.mouse.justPressed) curMoving = button;
|
||||
}
|
||||
if (_curMoving != null) {
|
||||
_curMovingInterval += FlxG.mouse.deltaY;
|
||||
if (Math.abs(_curMovingInterval) > addButton.bHeight / 2) {
|
||||
_curMovingInterval = 999;
|
||||
_curMoving.shouldPress = false;
|
||||
_curMoving.y = CoolUtil.fpsLerp(_curMoving.y, FlxG.mouse.getScreenPosition(buttonCameras).y - (_curMoving.bHeight / 2), 0.3);
|
||||
buttons.sort(function(o,a,b) return flixel.util.FlxSort.byValues(o, a == addButton ? 999 : a.y + (a.bHeight / 2), b == addButton ? 999 : b.y + (a.bHeight / 2)), -1);
|
||||
|
||||
if (addButton != null)
|
||||
addButton.setPosition(
|
||||
(bWidth/2) - (buttonSize.x/2),
|
||||
CoolUtil.fpsLerp(addButton.y, (buttonSize.y+buttonSpacing) * buttons.members.length, 0.25));
|
||||
|
||||
if (curMoving != null) {
|
||||
curMovingInterval += FlxG.mouse.deltaY;
|
||||
if (Math.abs(curMovingInterval) > addButton.bHeight / 2) {
|
||||
curMovingInterval = 999;
|
||||
curMoving.y = CoolUtil.fpsLerp(curMoving.y, FlxG.mouse.getWorldPosition(buttonCameras).y - (curMoving.bHeight / 2), 0.3);
|
||||
buttons.sort(function(o, a:T, b:T) return FlxSort.byValues(o, a.y + (a.bHeight / 2), b.y + (a.bHeight / 2)), -1);
|
||||
}
|
||||
if (FlxG.mouse.justReleased) {
|
||||
_curMoving = null;
|
||||
_curMovingInterval = 0;
|
||||
curMoving = null;
|
||||
curMovingInterval = 0;
|
||||
}
|
||||
}
|
||||
addIcon.x = addButton.x + addButton.bWidth / 2 - addIcon.width / 2; addIcon.y = addButton.y + addButton.bHeight / 2 - addIcon.height / 2;
|
||||
@@ -84,28 +96,33 @@ class UIButtonList extends UIWindow {
|
||||
|
||||
public override function update(elapsed:Float) {
|
||||
updateButtonsPos(elapsed);
|
||||
dragging = curMoving != null;
|
||||
|
||||
super.update(elapsed);
|
||||
__rect.x = x; __rect.y = y+23;
|
||||
__rect.width = bWidth; __rect.height = bHeight-23;
|
||||
var nextscrollY = scrollY - ((hovered = UIState.state.isOverlapping(this, __rect)) ? FlxG.mouse.wheel : 0) * 12;
|
||||
if (_curMoving != null) {
|
||||
for (i in _curMoving.members)
|
||||
if (i is UIButton) {
|
||||
var i:UIButton = cast(i, UIButton);
|
||||
i.selectable = false;
|
||||
}
|
||||
nextscrollY -= Math.min((bHeight - 100) - FlxG.mouse.getScreenPosition(buttonCameras).y, 0) / 5;
|
||||
nextscrollY += Math.min(FlxG.mouse.getScreenPosition(buttonCameras).y - 100, 0) / 5;
|
||||
|
||||
// Camera Stuff
|
||||
var nextscrollY = scrollY - (hovered ? FlxG.mouse.wheel : 0) * 12;
|
||||
|
||||
if (curMoving != null) {
|
||||
nextscrollY -= Math.min((bHeight - 100) - FlxG.mouse.getWorldPosition(buttonCameras).y, 0) / 8;
|
||||
nextscrollY += Math.min(FlxG.mouse.getWorldPosition(buttonCameras).y - 100, 0) / 8;
|
||||
}
|
||||
scrollY = FlxMath.bound(nextscrollY, 0, -_buttonYOffset + Math.abs(Math.min(bHeight - ((addButton.bHeight + _buttonYOffset) * buttons.members.length + (cameraSpacing + _buttonYOffset)), 0)));
|
||||
for (button in buttons.members)
|
||||
if (button != null) button.selectable = (hovered && _curMoving == null);
|
||||
|
||||
if (nextscrollY >= (-buttonSpacing) && nextscrollY + buttonCameras.height <= (addButton.y + 32 + (buttonSpacing*1.5)))
|
||||
scrollY = nextscrollY;
|
||||
|
||||
buttonCameras.scroll.y = FlxMath.lerp(buttonCameras.scroll.y, nextscrollY, 1/3);
|
||||
|
||||
for (button in buttons) {
|
||||
if (button != null) button.selectable = (hovered && !dragging);
|
||||
button.cameras = [buttonCameras];
|
||||
}
|
||||
|
||||
if (__lastDrawCameras[0] != null) {
|
||||
buttonCameras.height = bHeight - cameraSpacing;
|
||||
buttonCameras.x = x - __lastDrawCameras[0].scroll.x;
|
||||
buttonCameras.y = y + cameraSpacing - __lastDrawCameras[0].scroll.y;
|
||||
buttonCameras.zoom = __lastDrawCameras[0].zoom;
|
||||
}
|
||||
dragging = _curMoving != null;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ class UIScrollBar extends UISprite {
|
||||
public function new(x:Float, y:Float, length:Float, start:Float, size:Float, w:Int = 20, ?h:Int) {
|
||||
super(x, y, Paths.image("editors/ui/scrollbar-bg"));
|
||||
scale.y = h.getDefault(Std.int(FlxG.height - y));
|
||||
alpha = 0.5;
|
||||
updateHitbox();
|
||||
this.start = start;
|
||||
this.size = size;
|
||||
|
||||
@@ -52,6 +52,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
public var playerOffsets:Bool = false;
|
||||
|
||||
public var icon:String = null;
|
||||
public var iconColor:FlxColor = -1;
|
||||
public var gameOverCharacter:String = "bf-dead";
|
||||
|
||||
public var cameraOffset:FlxPoint = new FlxPoint(0, 0);
|
||||
@@ -373,7 +374,8 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
if (xml.x.exists("camy")) cameraOffset.y = Std.parseFloat(xml.x.get("camy"));
|
||||
if (xml.x.exists("holdTime")) holdTime = CoolUtil.getDefault(Std.parseFloat(xml.x.get("holdTime")), 4);
|
||||
if (xml.x.exists("flipX")) flipX = (xml.x.get("flipX") == "true");
|
||||
if (xml.x.exists("icon")) icon = xml.x.get("icon"); // idk why this is broke it just is
|
||||
if (xml.x.exists("icon")) icon = xml.x.get("icon");
|
||||
if (xml.x.exists("color")) iconColor = FlxColor.fromString(xml.x.get("color"));
|
||||
if (xml.x.exists("scale")) {
|
||||
var scale = Std.parseFloat(xml.x.get("scale")).getDefault(1);
|
||||
this.scale.set(scale, scale);
|
||||
@@ -407,6 +409,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
xml.set("holdTime", Std.string(holdTime));
|
||||
xml.set("flipX", Std.string(flipX));
|
||||
xml.set("icon", icon);
|
||||
xml.set("color", iconColor.toHexString(false).replace("0x", "#"));
|
||||
xml.set("scale", Std.string(scale.x));
|
||||
xml.set("antialiasing", antialiasing == true ? "true" : "false");
|
||||
xml.set("sprite", sprite);
|
||||
|
||||
@@ -682,15 +682,13 @@ class PlayState extends MusicBeatState
|
||||
healthBarBG.scrollFactor.set();
|
||||
add(healthBarBG);
|
||||
|
||||
|
||||
|
||||
healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
|
||||
'health', 0, maxHealth);
|
||||
healthBar.scrollFactor.set();
|
||||
if (opponentMode)
|
||||
healthBar.createFilledBar(0xFF66FF33, 0xFFFF0000); // switch the colors
|
||||
else
|
||||
healthBar.createFilledBar(0xFFFF0000, 0xFF66FF33);
|
||||
var leftColor:Int = dad.iconColor != -1 && Options.colorHealthBar ? dad.iconColor : 0xFFFF0000;
|
||||
var rightColor:Int = boyfriend.iconColor != -1 && Options.colorHealthBar ? boyfriend.iconColor : 0xFF66FF33;
|
||||
if (opponentMode) healthBar.createFilledBar(rightColor, leftColor); // switch the colors
|
||||
else healthBar.createFilledBar(leftColor, rightColor);
|
||||
add(healthBar);
|
||||
|
||||
health = maxHealth / 2;
|
||||
|
||||
@@ -27,6 +27,7 @@ class Options
|
||||
public static var antialiasing:Bool = true;
|
||||
public static var volume:Float = 1;
|
||||
public static var week6PixelPerfect:Bool = true;
|
||||
public static var colorHealthBar:Bool = true;
|
||||
public static var lowMemoryMode:Bool = false;
|
||||
public static var betaUpdates:Bool = false;
|
||||
public static var splashesEnabled:Bool = true;
|
||||
|
||||
@@ -15,6 +15,10 @@ class AppearanceOptions extends OptionsScreen {
|
||||
"Antialiasing",
|
||||
"If unchecked, will disable antialiasing on every sprite. Can boost performances at the cost of sharper, more pixely sprites",
|
||||
"antialiasing"));
|
||||
add(new Checkbox(
|
||||
"Colored Healthbar",
|
||||
"If unchecked, the game will use the orginal red/green health bar from the week 6 fnf game.",
|
||||
"colorHealthBar"));
|
||||
add(new Checkbox(
|
||||
"Pixel Perfect Effect",
|
||||
"If checked, Week 6 will have a pixel perfect effect to it enabled, aligning every pixel on the screen.",
|
||||
|
||||
Reference in New Issue
Block a user