scrollbar
This commit is contained in:
@@ -3,7 +3,17 @@
|
||||
## `v1.0.0` - Initial release
|
||||
|
||||
- [x] Remove Herobrine
|
||||
- [*] Chart Editor
|
||||
- [ ] Chart Editor
|
||||
- [x] Place & Delete notes
|
||||
- [x] Ctrl+Z & Ctrl+Y
|
||||
- [x] Selection box & dragging
|
||||
- [ ] Scroll bar at the right + Song info
|
||||
- [ ] Algorithm to make note placements faster & sorted out
|
||||
- [ ] Fix the strumlines bar when zooming out
|
||||
- [ ] Play here working
|
||||
- [ ] Events (including Camera Movement)
|
||||
- [ ] Custom Notes
|
||||
- [ ] Metadata Editing
|
||||
- [ ] New Switch Mod menu
|
||||
- [ ] Add note offset
|
||||
- [ ] Dialogue
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 153 B |
Binary file not shown.
|
After Width: | Height: | Size: 146 B |
Binary file not shown.
|
After Width: | Height: | Size: 880 B |
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="scrollbar-button.png">
|
||||
<!-- Created without animate lol i wrote this-->
|
||||
<SubTexture name="normal-topleft" x="0" y="0" width="4" height="4"/>
|
||||
<SubTexture name="normal-top" x="4" y="0" width="12" height="4"/>
|
||||
<SubTexture name="normal-topright" x="16" y="0" width="4" height="4"/>
|
||||
<SubTexture name="normal-middleleft" x="0" y="4" width="4" height="12"/>
|
||||
<SubTexture name="normal-middle" x="4" y="4" width="12" height="12"/>
|
||||
<SubTexture name="normal-middleright" x="16" y="4" width="4" height="12"/>
|
||||
<SubTexture name="normal-bottomleft" x="0" y="16" width="4" height="4"/>
|
||||
<SubTexture name="normal-bottom" x="4" y="16" width="12" height="4"/>
|
||||
<SubTexture name="normal-bottomright" x="16" y="16" width="4" height="4"/>
|
||||
|
||||
<SubTexture name="hover-topleft" x="20" y="0" width="4" height="4"/>
|
||||
<SubTexture name="hover-top" x="24" y="0" width="12" height="4"/>
|
||||
<SubTexture name="hover-topright" x="36" y="0" width="4" height="4"/>
|
||||
<SubTexture name="hover-middleleft" x="20" y="4" width="4" height="12"/>
|
||||
<SubTexture name="hover-middle" x="24" y="4" width="12" height="12"/>
|
||||
<SubTexture name="hover-middleright" x="36" y="4" width="4" height="12"/>
|
||||
<SubTexture name="hover-bottomleft" x="20" y="16" width="4" height="4"/>
|
||||
<SubTexture name="hover-bottom" x="24" y="16" width="12" height="4"/>
|
||||
<SubTexture name="hover-bottomright" x="36" y="16" width="4" height="4"/>
|
||||
|
||||
<SubTexture name="pressed-topleft" x="40" y="0" width="4" height="4"/>
|
||||
<SubTexture name="pressed-top" x="44" y="0" width="12" height="4"/>
|
||||
<SubTexture name="pressed-topright" x="56" y="0" width="4" height="4"/>
|
||||
<SubTexture name="pressed-middleleft" x="40" y="4" width="4" height="12"/>
|
||||
<SubTexture name="pressed-middle" x="44" y="4" width="12" height="12"/>
|
||||
<SubTexture name="pressed-middleright" x="56" y="4" width="4" height="12"/>
|
||||
<SubTexture name="pressed-bottomleft" x="40" y="16" width="4" height="4"/>
|
||||
<SubTexture name="pressed-bottom" x="44" y="16" width="12" height="4"/>
|
||||
<SubTexture name="pressed-bottomright" x="56" y="16" width="4" height="4"/>
|
||||
</TextureAtlas>
|
||||
@@ -40,6 +40,8 @@ class Charter extends UIState {
|
||||
|
||||
public var topMenu:Array<UIContextMenuOption>;
|
||||
|
||||
public var scrollBar:UIScrollBar;
|
||||
|
||||
public var topMenuSpr:UITopMenu;
|
||||
public var gridBackdrop:CharterBackdrop;
|
||||
public var beatSeparator:FlxBackdrop;
|
||||
@@ -332,10 +334,12 @@ class Charter extends UIState {
|
||||
|
||||
conductorFollowerSpr.cameras = selectionBox.cameras = notesGroup.cameras = gridBackdrop.cameras = [charterCamera];
|
||||
|
||||
|
||||
topMenuSpr = new UITopMenu(topMenu);
|
||||
topMenuSpr.cameras = uiGroup.cameras = [uiCamera];
|
||||
|
||||
scrollBar = new UIScrollBar(FlxG.width - 20, topMenuSpr.bHeight, 1000, 0, 100);
|
||||
uiGroup.add(scrollBar);
|
||||
|
||||
topLimit = new FlxSprite();
|
||||
topLimit.makeGraphic(1, 1, -1);
|
||||
topLimit.color = 0xFF888888;
|
||||
@@ -389,6 +393,13 @@ class Charter extends UIState {
|
||||
|
||||
strumLines.add(new CharterStrumline(strL));
|
||||
}
|
||||
|
||||
refreshBPMSensitive();
|
||||
}
|
||||
|
||||
public function refreshBPMSensitive() {
|
||||
// refreshes everything dependant on BPM, and BPM changes
|
||||
scrollBar.length = Conductor.getStepForTime(FlxG.sound.music.getDefault(vocals).length);
|
||||
}
|
||||
|
||||
public override function beatHit(curBeat:Int) {
|
||||
@@ -593,6 +604,9 @@ class Charter extends UIState {
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
scrollBar.size = (FlxG.height / 40 / charterCamera.zoom);
|
||||
scrollBar.start = Conductor.curStepFloat - (scrollBar.size / 2);
|
||||
|
||||
if (gridBackdrop.strumlinesAmount != (gridBackdrop.strumlinesAmount = strumLines.length))
|
||||
updateDisplaySprites();
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package funkin.editors.ui;
|
||||
|
||||
class UIScrollBar extends UISprite {
|
||||
public var length:Float;
|
||||
public var start:Float;
|
||||
public var size:Float;
|
||||
|
||||
public var thumb:UISliceSprite;
|
||||
|
||||
public var value:Float;
|
||||
|
||||
public var onChange:Float->Void;
|
||||
|
||||
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));
|
||||
updateHitbox();
|
||||
this.start = start;
|
||||
this.size = size;
|
||||
this.length = length;
|
||||
|
||||
thumb = new UISliceSprite(0, 0, w, h, 'editors/ui/scrollbar');
|
||||
members.push(thumb);
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float) {
|
||||
super.update(elapsed);
|
||||
thumb.follow(this, 0, FlxMath.remapToRange(start, -(size/2), length + size, 0, height));
|
||||
thumb.bHeight = Std.int(FlxMath.remapToRange(size, -(size/2), length + size, 0, height));
|
||||
|
||||
if (hovered) {
|
||||
if (FlxG.mouse.justReleased) {
|
||||
var mousePos = FlxG.mouse.getScreenPosition(camera);
|
||||
var yPos = FlxMath.remapToRange(mousePos.y, y, y+height, -(size/2), length + size);
|
||||
if (yPos >= 0 && yPos < length) {
|
||||
onChange(value = yPos);
|
||||
}
|
||||
}
|
||||
} else if (thumb.hovered) {
|
||||
// todo: scrolling
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user