Keybind text

This commit is contained in:
NeeEoo
2023-08-05 22:38:35 +02:00
parent 641328e701
commit 4c98b8b6cd
2 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
- [ ] Reorderable Strumlines
- [ ] Step based zooming
- [ ] Add Undo to more actions
- [ ] New Button
- [ ] New Chart Button
- [ ] Bug fixes
- [ ] Zooming in causing notes to disappear
- [ ] Holds disappear too early
@@ -31,7 +31,7 @@
- [x] Character Saving
- [x] Add Undos to Actions
- [ ] Change Stage
- [ ] New Button
- [ ] New Character Button
- [ ] Port Videos to a more stable video lib
- [ ] Optimization to Editors
- [ ] Fix Ratings Lag
+11 -6
View File
@@ -114,6 +114,7 @@ typedef UIContextMenuOption = {
var label:String;
var ?keybind:Array<FlxKey>;
var ?keybinds:Array<Array<FlxKey>>;
var ?keybindText:String;
var ?icon:Int;
var ?onSelect:UIContextMenuOption->Void;
var ?childs:Array<UIContextMenuOption>;
@@ -144,14 +145,18 @@ class UIContextMenuOptionSpr extends UISliceSprite {
}
}
if (option.keybinds != null) {
var textKeys:Array<String> = [];
for (o in option.keybinds[0]) {
if (Std.int(o) > 0) {
textKeys.push(o.toUIString());
if (option.keybinds != null || option.keybindText != null) {
var text = if(option.keybindText == null) {
var textKeys:Array<String> = [];
for (o in option.keybinds[0]) {
if (Std.int(o) > 0) {
textKeys.push(o.toUIString());
}
}
textKeys.join("+");
} else {
option.keybindText;
}
var text = textKeys.join("+");
labelKeybind = new UIText(label.x + label.frameWidth + 10, 2, 0, text);
labelKeybind.alpha = 0.75;
}