mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Show correct tool modifier shortcuts in the tool button tooltips
This commit is contained in:
parent
cc9ced424f
commit
4a16700b80
|
@ -69,7 +69,7 @@ var tools := {
|
||||||
"pencil",
|
"pencil",
|
||||||
preload("res://src/Tools/Pencil.tscn"),
|
preload("res://src/Tools/Pencil.tscn"),
|
||||||
"Hold %s to make a line",
|
"Hold %s to make a line",
|
||||||
["Shift"]
|
["draw_create_line"]
|
||||||
),
|
),
|
||||||
"Eraser":
|
"Eraser":
|
||||||
Tool.new(
|
Tool.new(
|
||||||
|
@ -78,7 +78,7 @@ var tools := {
|
||||||
"eraser",
|
"eraser",
|
||||||
preload("res://src/Tools/Eraser.tscn"),
|
preload("res://src/Tools/Eraser.tscn"),
|
||||||
"Hold %s to make a line",
|
"Hold %s to make a line",
|
||||||
["Shift"]
|
["draw_create_line"]
|
||||||
),
|
),
|
||||||
"Bucket": Tool.new("Bucket", "Bucket", "fill", preload("res://src/Tools/Bucket.tscn")),
|
"Bucket": Tool.new("Bucket", "Bucket", "fill", preload("res://src/Tools/Bucket.tscn")),
|
||||||
"Shading":
|
"Shading":
|
||||||
|
@ -92,7 +92,7 @@ var tools := {
|
||||||
"""Hold %s to snap the angle of the line
|
"""Hold %s to snap the angle of the line
|
||||||
Hold %s to center the shape on the click origin
|
Hold %s to center the shape on the click origin
|
||||||
Hold %s to displace the shape's origin""",
|
Hold %s to displace the shape's origin""",
|
||||||
["Shift", "Ctrl", "Alt"]
|
["shape_perfect", "shape_center", "shape_displace"]
|
||||||
),
|
),
|
||||||
"RectangleTool":
|
"RectangleTool":
|
||||||
Tool.new(
|
Tool.new(
|
||||||
|
@ -103,7 +103,7 @@ Hold %s to displace the shape's origin""",
|
||||||
"""Hold %s to create a 1:1 shape
|
"""Hold %s to create a 1:1 shape
|
||||||
Hold %s to center the shape on the click origin
|
Hold %s to center the shape on the click origin
|
||||||
Hold %s to displace the shape's origin""",
|
Hold %s to displace the shape's origin""",
|
||||||
["Shift", "Ctrl", "Alt"]
|
["shape_perfect", "shape_center", "shape_displace"]
|
||||||
),
|
),
|
||||||
"EllipseTool":
|
"EllipseTool":
|
||||||
Tool.new(
|
Tool.new(
|
||||||
|
@ -114,7 +114,7 @@ Hold %s to displace the shape's origin""",
|
||||||
"""Hold %s to create a 1:1 shape
|
"""Hold %s to create a 1:1 shape
|
||||||
Hold %s to center the shape on the click origin
|
Hold %s to center the shape on the click origin
|
||||||
Hold %s to displace the shape's origin""",
|
Hold %s to displace the shape's origin""",
|
||||||
["Shift", "Ctrl", "Alt"]
|
["shape_perfect", "shape_center", "shape_displace"]
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,15 @@ class Tool:
|
||||||
if !extra_hint.empty():
|
if !extra_hint.empty():
|
||||||
hint += "\n\n" + extra_hint
|
hint += "\n\n" + extra_hint
|
||||||
|
|
||||||
shortcuts.append_array(extra_shortcuts)
|
var extra_shortcuts_mapped := []
|
||||||
|
for event in extra_shortcuts:
|
||||||
|
var key: InputEventKey = Keychain.action_get_first_key(event)
|
||||||
|
var key_string := "None"
|
||||||
|
if key:
|
||||||
|
key_string = OS.get_scancode_string(key.get_scancode_with_modifiers())
|
||||||
|
extra_shortcuts_mapped.append(key_string)
|
||||||
|
|
||||||
|
shortcuts.append_array(extra_shortcuts_mapped)
|
||||||
|
|
||||||
if shortcuts.empty():
|
if shortcuts.empty():
|
||||||
hint = tr(hint)
|
hint = tr(hint)
|
||||||
|
|
Loading…
Reference in a new issue