From 338701bd384720522926ae5e45d56aceb790b753 Mon Sep 17 00:00:00 2001 From: MathemanFlo Date: Thu, 10 Mar 2022 22:26:38 +0100 Subject: [PATCH 1/3] Add delete shortcuts to buttons. --- Sources/arm/ui/TabBrushes.hx | 2 +- Sources/arm/ui/TabFonts.hx | 2 +- Sources/arm/ui/TabLayers.hx | 2 +- Sources/arm/ui/TabMaterials.hx | 2 +- Sources/arm/ui/TabSwatches.hx | 2 +- Sources/arm/ui/TabTextures.hx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/arm/ui/TabBrushes.hx b/Sources/arm/ui/TabBrushes.hx index fb0e0e33..3c090990 100644 --- a/Sources/arm/ui/TabBrushes.hx +++ b/Sources/arm/ui/TabBrushes.hx @@ -102,7 +102,7 @@ class TabBrushes { iron.App.notifyOnInit(_init); } - if (Project.brushes.length > 1 && ui.button(tr("Delete"), Left)) { + if (Project.brushes.length > 1 && ui.button(tr("Delete"), Left, "delete")) { deleteBrush(Project.brushes[i]); } }, 3 + add); diff --git a/Sources/arm/ui/TabFonts.hx b/Sources/arm/ui/TabFonts.hx index a6f0cae8..59fa918e 100644 --- a/Sources/arm/ui/TabFonts.hx +++ b/Sources/arm/ui/TabFonts.hx @@ -98,7 +98,7 @@ class TabFonts { UIMenu.draw(function(ui: Zui) { ui.text(fontName, Right, ui.t.HIGHLIGHT_COL); - if (Project.fonts.length > 1 && ui.button(tr("Delete"), Left) && Project.fonts[i].file != "") { + if (Project.fonts.length > 1 && ui.button(tr("Delete"), Left, "delete") && Project.fonts[i].file != "") { deleteFont(Project.fonts[i]); } }, 1 + add); diff --git a/Sources/arm/ui/TabLayers.hx b/Sources/arm/ui/TabLayers.hx index 2cf40f02..096e1e30 100644 --- a/Sources/arm/ui/TabLayers.hx +++ b/Sources/arm/ui/TabLayers.hx @@ -543,7 +543,7 @@ class TabLayers { } ui.enabled = canDelete(l); - if (ui.button(tr("Delete"), Left)) { + if (ui.button(tr("Delete"), Left, "delete")) { deleteLayer(l); } ui.enabled = true; diff --git a/Sources/arm/ui/TabMaterials.hx b/Sources/arm/ui/TabMaterials.hx index 2dfcc60a..afe1a7d7 100644 --- a/Sources/arm/ui/TabMaterials.hx +++ b/Sources/arm/ui/TabMaterials.hx @@ -139,7 +139,7 @@ class TabMaterials { iron.App.notifyOnInit(_init); } - if (Project.materials.length > 1 && ui.button(tr("Delete"), Left)) { + if (Project.materials.length > 1 && ui.button(tr("Delete"), Left, "delete")) { deleteMaterial(m); } diff --git a/Sources/arm/ui/TabSwatches.hx b/Sources/arm/ui/TabSwatches.hx index b65dfbfc..2459c946 100644 --- a/Sources/arm/ui/TabSwatches.hx +++ b/Sources/arm/ui/TabSwatches.hx @@ -158,7 +158,7 @@ class TabSwatches { Krom.copyToClipboard(untyped val.toString(16)); } #end - else if (Project.raw.swatches.length > 1 && ui.button(tr("Delete"), Left)) { + else if (Project.raw.swatches.length > 1 && ui.button(tr("Delete"), Left, "delete")) { deleteSwatch(Project.raw.swatches[i]); } }, 2 + add); diff --git a/Sources/arm/ui/TabTextures.hx b/Sources/arm/ui/TabTextures.hx index 4ff5d7de..ae99dcda 100644 --- a/Sources/arm/ui/TabTextures.hx +++ b/Sources/arm/ui/TabTextures.hx @@ -146,7 +146,7 @@ class TabTextures { Context.ddirty = 2; } } - if (ui.button(tr("Delete"), Left)) { + if (ui.button(tr("Delete"), Left, "delete")) { deleteTexture(asset); } if (!isPacked && ui.button(tr("Open Containing Directory..."), Left)) { From b7058c3af4bd2ce8fde455e569f10f6e1f7b5cea Mon Sep 17 00:00:00 2001 From: MathemanFlo Date: Thu, 10 Mar 2022 22:27:07 +0100 Subject: [PATCH 2/3] Add tooltip for light angle and env angle --- Sources/arm/ui/UIMenu.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/arm/ui/UIMenu.hx b/Sources/arm/ui/UIMenu.hx index 184882f1..e529e62a 100644 --- a/Sources/arm/ui/UIMenu.hx +++ b/Sources/arm/ui/UIMenu.hx @@ -141,6 +141,7 @@ class UIMenu { } menuAlign(ui); Context.envmapAngle = ui.slider(envaHandle, tr("Environment Angle"), 0.0, 360.0, true, 1) / 180.0 * Math.PI; + if (ui.isHovered) ui.tooltip(tr("{shortcut} and move mouse", ["shortcut" => Config.keymap.rotate_envmap])); if (envaHandle.changed) Context.ddirty = 2; if (Scene.active.lights.length > 0) { @@ -161,6 +162,7 @@ class UIMenu { lahandle.value = Context.lightAngle / Math.PI * 180; menuAlign(ui); var newAngle = ui.slider(lahandle, tr("Light Angle"), 0.0, 360.0, true, 1) / 180 * Math.PI; + if (ui.isHovered) ui.tooltip(tr("{shortcut} and move mouse", ["shortcut" => Config.keymap.rotate_light])); var ldiff = newAngle - Context.lightAngle; if (Math.abs(ldiff) > 0.005) { if (newAngle < 0) newAngle += (Std.int(-newAngle / (2 * Math.PI)) + 1) * 2 * Math.PI; From 32007848950750d3e02808bb47cab19f91ec09c4 Mon Sep 17 00:00:00 2001 From: MathemanFlo Date: Thu, 10 Mar 2022 22:32:02 +0100 Subject: [PATCH 3/3] Add tooltips for camera controls --- Sources/arm/ui/UIMenu.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/arm/ui/UIMenu.hx b/Sources/arm/ui/UIMenu.hx index e529e62a..ff1576dd 100644 --- a/Sources/arm/ui/UIMenu.hx +++ b/Sources/arm/ui/UIMenu.hx @@ -353,7 +353,14 @@ class UIMenu { menuFill(ui); menuAlign(ui); Context.cameraControls = Ext.inlineRadio(ui, Id.handle({ position: Context.cameraControls }), [tr("Orbit"), tr("Rotate"), tr("Fly")], Left); + var orbitAndRotateTooltip = tr("Orbit and Rotate mode:\n{rotate_shortcut} or move right mouse button to rotate.\n{zoom_shortcut} or scroll to zoom.\n{pan_shortcut} or move middle mouse to pan.", + ["rotate_shortcut" => Config.keymap.action_rotate, + "zoom_shortcut" => Config.keymap.action_zoom, + "pan_shortcut" => Config.keymap.action_pan, + ]); + var flyTooltip = tr("Fly mode:\nHold the right mouse button and one of the following commands:\nmove mouse to rotate.\nw, up or scroll up to move forward.\ns, down or scroll down to move backward.\na or left to move left.\nd or right to move right.\ne to move up.\nq to move down.\nHold shift to move faster or alt to move slower."); + if (ui.isHovered) ui.tooltip(orbitAndRotateTooltip + "\n\n" + flyTooltip); menuFill(ui); menuAlign(ui); Context.cameraType = Ext.inlineRadio(ui, Context.camHandle, [tr("Perspective"), tr("Orthographic")], Left);