Preview layer shortcuts

This commit is contained in:
MathemanFlo
2022-04-22 21:58:53 +02:00
parent 0ff28693de
commit 7eece065b1
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -292,6 +292,19 @@ class TabLayers {
state = ui.image(icon, 0xffffffff, iconH);
var isTyping = ui.isTyping || UIView2D.inst.ui.isTyping || UINodes.inst.ui.isTyping;
if (!isTyping) {
if (i < 9 && Operator.shortcut(Config.keymap.select_layer, ShortcutDown)) {
var number = Std.string(i + 1) ;
var width = ui.ops.font.width(ui.fontSize, number) + 10;
var height = ui.ops.font.height(ui.fontSize);
ui.g.color = ui.t.TEXT_COL;
ui.g.fillRect(uix, uiy, width, height);
ui.g.color = ui.t.ACCENT_COL;
ui.g.drawString(number, uix + 5, uiy);
}
}
if (l.fill_layer == null && l.isMask()) {
ui.g.pipeline = null;
}
+1
View File
@@ -269,6 +269,7 @@ class UISidebar {
for (i in 1...10) if (kb.started(i + "")) Context.selectMaterial(i - 1);
}
else if (Operator.shortcut(Config.keymap.select_layer, ShortcutDown)) {
UISidebar.inst.hwnd0.redraws = 2;
for (i in 1...10) if (kb.started(i + "")) Context.selectLayer(i - 1);
}
}