mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-12 22:35:18 +00:00
Merge branch 'master' of https://github.com/Orama-Interactive/Pixelorama into xdg-standard
This commit is contained in:
commit
8712870a03
5 changed files with 24 additions and 15 deletions
|
@ -5,6 +5,7 @@
|
|||
[ext_resource path="res://Assets/Fonts/CJK/NotoSansCJKtc-Regular.tres" type="DynamicFont" id=3]
|
||||
|
||||
[node name="PreferencesDialog" type="AcceptDialog"]
|
||||
visible = true
|
||||
margin_right = 430.0
|
||||
margin_bottom = 1347.0
|
||||
rect_min_size = Vector2( 430, 0 )
|
||||
|
@ -110,9 +111,9 @@ text = "Show right tool icon"
|
|||
|
||||
[node name="PressureSentivity" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/General"]
|
||||
visible = false
|
||||
margin_top = 46.0
|
||||
margin_top = 116.0
|
||||
margin_right = 334.0
|
||||
margin_bottom = 66.0
|
||||
margin_bottom = 136.0
|
||||
|
||||
[node name="PressureSensitivityLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/General/PressureSentivity"]
|
||||
margin_top = 3.0
|
||||
|
|
|
@ -307,6 +307,7 @@ func _on_MergeDownLayer_pressed() -> void:
|
|||
Global.undo_redo.add_do_method(Global, "redo", Global.canvases)
|
||||
Global.undo_redo.commit_action()
|
||||
|
||||
|
||||
func _on_OpacitySlider_value_changed(value) -> void:
|
||||
Global.canvas.layers[Global.current_layer][2] = value / 100
|
||||
Global.layer_opacity_slider.value = value
|
||||
|
|
|
@ -8,7 +8,7 @@ onready var fill_color_node = $VBoxContainer/OptionsContainer/FillColor
|
|||
|
||||
onready var size_value = Vector2()
|
||||
|
||||
#Template Id identifier
|
||||
# Template Id identifier
|
||||
enum Templates {
|
||||
TDefault = 0,
|
||||
T16 = 1,
|
||||
|
@ -22,13 +22,13 @@ enum Templates {
|
|||
SNES_NTSC = 9,
|
||||
SNES_PAL = 10
|
||||
}
|
||||
#Template actual value, without Default because we get it from Global
|
||||
# Template actual value, without Default because we get it from Global
|
||||
var TResolutions = {
|
||||
Templates.T16: Vector2(16,16),
|
||||
Templates.T32: Vector2(32,32),
|
||||
Templates.T64: Vector2(64,64),
|
||||
Templates.T128: Vector2(128,128),
|
||||
|
||||
|
||||
Templates.GB: Vector2(160,144),
|
||||
Templates.GBA: Vector2(240,160),
|
||||
Templates.NES_NTSC: Vector2(256,224),
|
||||
|
@ -42,7 +42,7 @@ var TStrings ={
|
|||
Templates.T32: "",
|
||||
Templates.T64: "",
|
||||
Templates.T128: "",
|
||||
|
||||
|
||||
Templates.GB: "GB",
|
||||
Templates.GBA: "GBA",
|
||||
Templates.NES_NTSC: "NES (NTSC)",
|
||||
|
@ -54,7 +54,7 @@ var TStrings ={
|
|||
func _ready() -> void:
|
||||
ratio_box.connect("pressed", self, "_on_RatioCheckBox_toggled", [ratio_box.pressed])
|
||||
templates_options.connect("item_selected", self, "_on_TemplatesOptions_item_selected")
|
||||
|
||||
|
||||
_CreateOptionList()
|
||||
|
||||
func _CreateOptionList():
|
||||
|
@ -74,12 +74,12 @@ func _on_CreateNewImage_confirmed() -> void:
|
|||
# Store [Layer name (0), Layer visibility boolean (1), Layer lock boolean (2), Frame container (3),
|
||||
# will new frames be linked boolean (4), Array of linked frames (5)]
|
||||
Global.layers.append([tr("Layer") + " 0", true, false, HBoxContainer.new(), false, []])
|
||||
Global.current_layer = 0
|
||||
Global.canvas = load("res://Prefabs/Canvas.tscn").instance()
|
||||
Global.canvas.size = Vector2(width, height).floor()
|
||||
|
||||
Global.canvases.append(Global.canvas)
|
||||
Global.canvas_parent.add_child(Global.canvas)
|
||||
Global.current_layer = 0
|
||||
Global.canvases = Global.canvases # To trigger Global.canvases_changed()
|
||||
Global.current_frame = 0
|
||||
Global.layers = Global.layers # To trigger Global.layers_changed()
|
||||
|
@ -122,6 +122,6 @@ func _on_TemplatesOptions_item_selected(id: int) -> void:
|
|||
else:
|
||||
width_value.value = Global.default_image_width
|
||||
height_value.value = Global.default_image_height
|
||||
|
||||
|
||||
width_value.value = size_value.x
|
||||
height_value.value = size_value.y
|
||||
|
|
|
@ -11,6 +11,8 @@ onready var shortcuts = $HSplitContainer/ScrollContainer/VBoxContainer/Shortcuts
|
|||
|
||||
onready var smooth_zoom_button = $"HSplitContainer/ScrollContainer/VBoxContainer/General/SmoothZoom"
|
||||
onready var sensitivity_option = $"HSplitContainer/ScrollContainer/VBoxContainer/General/PressureSentivity/PressureSensitivityOptionButton"
|
||||
onready var left_tool_icon = $HSplitContainer/ScrollContainer/VBoxContainer/General/GridContainer/LeftToolIconCheckbox
|
||||
onready var right_tool_icon = $HSplitContainer/ScrollContainer/VBoxContainer/General/GridContainer/RightToolIconCheckbox
|
||||
|
||||
onready var default_width_value = $HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions/ImageDefaultWidth
|
||||
onready var default_height_value = $HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions/ImageDefaultHeight
|
||||
|
@ -59,6 +61,13 @@ func _ready() -> void:
|
|||
Global.pressure_sensitivity_mode = Global.config_cache.get_value("preferences", "pressure_sensitivity")
|
||||
sensitivity_option.selected = Global.pressure_sensitivity_mode
|
||||
|
||||
if Global.config_cache.has_section_key("preferences", "show_left_tool_icon"):
|
||||
Global.show_left_tool_icon = Global.config_cache.get_value("preferences", "show_left_tool_icon")
|
||||
left_tool_icon.pressed = Global.show_left_tool_icon
|
||||
if Global.config_cache.has_section_key("preferences", "show_right_tool_icon"):
|
||||
Global.show_right_tool_icon = Global.config_cache.get_value("preferences", "show_right_tool_icon")
|
||||
right_tool_icon.pressed = Global.show_right_tool_icon
|
||||
|
||||
# Set default values for Grid & Guide options
|
||||
if Global.config_cache.has_section_key("preferences", "grid_size"):
|
||||
var grid_size = Global.config_cache.get_value("preferences", "grid_size")
|
||||
|
@ -409,10 +418,14 @@ func _on_RightIndicatorCheckbox_toggled(button_pressed : bool) -> void:
|
|||
|
||||
func _on_LeftToolIconCheckbox_toggled(button_pressed : bool) -> void:
|
||||
Global.show_left_tool_icon = button_pressed
|
||||
Global.config_cache.set_value("preferences", "show_left_tool_icon", Global.show_left_tool_icon)
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
|
||||
func _on_RightToolIconCheckbox_toggled(button_pressed : bool) -> void:
|
||||
Global.show_right_tool_icon = button_pressed
|
||||
Global.config_cache.set_value("preferences", "show_right_tool_icon", Global.show_right_tool_icon)
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
|
||||
func _on_Shortcut_button_pressed(button : Button) -> void:
|
||||
|
|
|
@ -628,12 +628,6 @@ func _on_RightHorizontalMirroring_toggled(button_pressed) -> void:
|
|||
func _on_RightVerticalMirroring_toggled(button_pressed) -> void:
|
||||
Global.right_vertical_mirror = button_pressed
|
||||
|
||||
func _on_OpacitySlider_value_changed(value) -> void:
|
||||
Global.canvas.layers[Global.current_layer][4] = value / 100
|
||||
Global.layer_opacity_slider.value = value
|
||||
Global.layer_opacity_spinbox.value = value
|
||||
Global.canvas.update()
|
||||
|
||||
func show_quit_dialog() -> void:
|
||||
if !$QuitDialog.visible:
|
||||
if Global.saved:
|
||||
|
|
Loading…
Add table
Reference in a new issue