mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 12:33:14 +00:00
Merge branch 'master' of https://github.com/Orama-Interactive/Pixelorama into xdg-standard
Getting ourselves up to date with upstream for easy merge! nya ^.^
This commit is contained in:
commit
516723d125
6 changed files with 93 additions and 26 deletions
|
@ -132,8 +132,16 @@ func _on_FirstFrame_pressed() -> void:
|
|||
Global.current_frame = 0
|
||||
|
||||
func _on_AnimationTimer_timeout() -> void:
|
||||
var first_frame := 0
|
||||
var last_frame := Global.canvases.size() - 1
|
||||
if Global.play_only_tags:
|
||||
for tag in Global.animation_tags:
|
||||
if Global.current_frame + 1 >= tag[2] && Global.current_frame + 1 <= tag[3]:
|
||||
first_frame = tag[2] - 1
|
||||
last_frame = min(Global.canvases.size() - 1, tag[3] - 1)
|
||||
|
||||
if animation_forward:
|
||||
if Global.current_frame < Global.canvases.size() - 1:
|
||||
if Global.current_frame < last_frame:
|
||||
Global.current_frame += 1
|
||||
else:
|
||||
match animation_loop:
|
||||
|
@ -142,13 +150,13 @@ func _on_AnimationTimer_timeout() -> void:
|
|||
Global.play_backwards.pressed = false
|
||||
Global.animation_timer.stop()
|
||||
1: # Cycle loop
|
||||
Global.current_frame = 0
|
||||
Global.current_frame = first_frame
|
||||
2: # Ping pong loop
|
||||
animation_forward = false
|
||||
_on_AnimationTimer_timeout()
|
||||
|
||||
else:
|
||||
if Global.current_frame > 0:
|
||||
if Global.current_frame > first_frame:
|
||||
Global.current_frame -= 1
|
||||
else:
|
||||
match animation_loop:
|
||||
|
@ -157,7 +165,7 @@ func _on_AnimationTimer_timeout() -> void:
|
|||
Global.play_forward.pressed = false
|
||||
Global.animation_timer.stop()
|
||||
1: # Cycle loop
|
||||
Global.current_frame = Global.canvases.size() - 1
|
||||
Global.current_frame = last_frame
|
||||
2: # Ping pong loop
|
||||
animation_forward = true
|
||||
_on_AnimationTimer_timeout()
|
||||
|
|
|
@ -245,6 +245,7 @@ func _on_Language_pressed(button : Button) -> void:
|
|||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
# Update Translations
|
||||
Global.update_hint_tooltips()
|
||||
_on_PreferencesDialog_popup_hide()
|
||||
_on_PreferencesDialog_about_to_show(true)
|
||||
|
||||
|
@ -357,6 +358,7 @@ func toggle_shortcut_buttons(enabled : bool) -> void:
|
|||
func set_action_shortcut(action : String, old_input : InputEventKey, new_input : InputEventKey) -> void:
|
||||
InputMap.action_erase_event(action, old_input)
|
||||
InputMap.action_add_event(action, new_input)
|
||||
Global.update_hint_tooltips()
|
||||
|
||||
|
||||
func _on_GridWidthValue_value_changed(value : float) -> void:
|
||||
|
|
|
@ -6,7 +6,7 @@ var layer := 0
|
|||
onready var popup_menu := $PopupMenu
|
||||
|
||||
func _ready() -> void:
|
||||
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
|
||||
hint_tooltip = "Frame: %s, Layer: %s" % [frame + 1, layer]
|
||||
if Global.canvases[frame] in Global.layers[layer][5]:
|
||||
get_node("LinkedIndicator").visible = true
|
||||
popup_menu.set_item_disabled(4, false) # Unlink cel
|
||||
|
|
|
@ -38,6 +38,7 @@ var transparent_background : ImageTexture
|
|||
var selected_pixels := []
|
||||
var image_clipboard : Image
|
||||
var animation_tags := [] setget animation_tags_changed # [Name, Color, From, To]
|
||||
var play_only_tags := true
|
||||
|
||||
# warning-ignore:unused_class_variable
|
||||
var theme_type := "Dark"
|
||||
|
@ -507,15 +508,15 @@ func canvases_changed(value : Array) -> void:
|
|||
layers[i][3].add_child(frame_button)
|
||||
|
||||
func clear_canvases() -> void:
|
||||
for child in Global.canvas_parent.get_children():
|
||||
for child in canvas_parent.get_children():
|
||||
if child is Canvas:
|
||||
child.queue_free()
|
||||
Global.canvases.clear()
|
||||
Global.animation_tags.clear()
|
||||
Global.animation_tags = Global.animation_tags # To execute animation_tags_changed()
|
||||
canvases.clear()
|
||||
animation_tags.clear()
|
||||
self.animation_tags = animation_tags # To execute animation_tags_changed()
|
||||
|
||||
Global.window_title = "(" + tr("untitled") + ") - Pixelorama"
|
||||
Global.undo_redo.clear_history(false)
|
||||
window_title = "(" + tr("untitled") + ") - Pixelorama"
|
||||
undo_redo.clear_history(false)
|
||||
|
||||
func layers_changed(value : Array) -> void:
|
||||
layers = value
|
||||
|
@ -662,6 +663,53 @@ func animation_tags_changed(value : Array) -> void:
|
|||
tag_c.get_node("Line2D").points[3] = Vector2(tag_c.rect_min_size.x, 32)
|
||||
|
||||
|
||||
func update_hint_tooltips() -> void:
|
||||
var root = get_tree().get_root()
|
||||
|
||||
var rect_select : BaseButton = find_node_by_name(root, "RectSelect")
|
||||
rect_select.hint_tooltip = tr("""Rectangular Selection
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button
|
||||
|
||||
Press %s to move the content""") % [InputMap.get_action_list("left_rectangle_select_tool")[0].as_text(), InputMap.get_action_list("right_rectangle_select_tool")[0].as_text(), "Shift"]
|
||||
|
||||
var color_picker : BaseButton = find_node_by_name(root, "ColorPicker")
|
||||
color_picker.hint_tooltip = tr("""Color Picker
|
||||
Select a color from a pixel of the sprite
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button""") % [InputMap.get_action_list("left_colorpicker_tool")[0].as_text(), InputMap.get_action_list("right_colorpicker_tool")[0].as_text()]
|
||||
|
||||
var pencil : BaseButton = find_node_by_name(root, "Pencil")
|
||||
pencil.hint_tooltip = tr("""Pencil
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button
|
||||
|
||||
Hold %s to make a line""") % [InputMap.get_action_list("left_pencil_tool")[0].as_text(), InputMap.get_action_list("right_pencil_tool")[0].as_text(), "Shift"]
|
||||
|
||||
var eraser : BaseButton = find_node_by_name(root, "Eraser")
|
||||
eraser.hint_tooltip = tr("""Eraser
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button
|
||||
|
||||
Hold %s to make a line""") % [InputMap.get_action_list("left_eraser_tool")[0].as_text(), InputMap.get_action_list("right_eraser_tool")[0].as_text(), "Shift"]
|
||||
|
||||
var bucket : BaseButton = find_node_by_name(root, "Bucket")
|
||||
bucket.hint_tooltip = tr("""Bucket
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button""") % [InputMap.get_action_list("left_fill_tool")[0].as_text(), InputMap.get_action_list("right_fill_tool")[0].as_text()]
|
||||
|
||||
var ld : BaseButton = find_node_by_name(root, "LightenDarken")
|
||||
ld.hint_tooltip = tr("""Lighten/Darken
|
||||
|
||||
%s for left mouse button
|
||||
%s for right mouse button""") % [InputMap.get_action_list("left_lightdark_tool")[0].as_text(), InputMap.get_action_list("right_lightdark_tool")[0].as_text()]
|
||||
|
||||
|
||||
func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void:
|
||||
var brush_container
|
||||
var brush_button = load("res://Prefabs/BrushButton.tscn").instance()
|
||||
|
|
|
@ -148,6 +148,8 @@ func _ready() -> void:
|
|||
for t in tools:
|
||||
t[0].connect("pressed", self, "_on_Tool_pressed", [t[0]])
|
||||
|
||||
Global.update_hint_tooltips()
|
||||
|
||||
# Checks to see if it's 3.1.x
|
||||
if Engine.get_version_info().major == 3 and Engine.get_version_info().minor < 2:
|
||||
Global.left_color_picker.get_picker().move_child(Global.left_color_picker.get_picker().get_child(0), 1)
|
||||
|
|
|
@ -212,15 +212,6 @@ msgstr ""
|
|||
msgid "Ping-Pong"
|
||||
msgstr ""
|
||||
|
||||
msgid "EXPORT_CURRENT_FRAME_LABEL"
|
||||
msgstr ""
|
||||
|
||||
msgid "EXPORT_FRAMES_AS_MULTIPLE_FILES_LABEL"
|
||||
msgstr ""
|
||||
|
||||
msgid "EXPORT_FRAMES_AS_SPRITESHEET_LABEL"
|
||||
msgstr ""
|
||||
|
||||
msgid "Columns"
|
||||
msgstr ""
|
||||
|
||||
|
@ -452,25 +443,41 @@ msgstr ""
|
|||
msgid "Utility Tools"
|
||||
msgstr ""
|
||||
|
||||
msgid "RECTSELECT_HT"
|
||||
msgid "Rectangular Selection\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button\n\n"
|
||||
"Press %s to move the content"
|
||||
msgstr ""
|
||||
|
||||
msgid "COLORPICKER_HT"
|
||||
msgid "Color Picker\n"
|
||||
"Select a color from a pixel of the sprite\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button"
|
||||
msgstr ""
|
||||
|
||||
msgid "Draw Tools"
|
||||
msgstr ""
|
||||
|
||||
msgid "PENCIL_HT"
|
||||
msgid "Pencil\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button\n\n"
|
||||
"Hold %s to make a line"
|
||||
msgstr ""
|
||||
|
||||
msgid "ERASER_HT"
|
||||
msgid "Eraser\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button\n\n"
|
||||
"Hold %s to make a line"
|
||||
msgstr ""
|
||||
|
||||
msgid "BUCKET_HT"
|
||||
msgid "Bucket\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button"
|
||||
msgstr ""
|
||||
|
||||
msgid "LD_HT"
|
||||
msgid "Lighten/Darken\n\n"
|
||||
"%s for left mouse button\n"
|
||||
"%s for right mouse button"
|
||||
msgstr ""
|
||||
|
||||
msgid "Choose a color for the left tool"
|
||||
|
|
Loading…
Add table
Reference in a new issue