1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-15 10:13:07 +00:00

Compare commits

..

No commits in common. "2cb29ab2746c2c85780ce7d02f70ccbe8484105e" and "4dc55e538e86a25a73d2b041d45f56165c2d070d" have entirely different histories.

12 changed files with 23 additions and 133 deletions

View file

@ -220,10 +220,6 @@ msgstr ""
msgid "Preferences"
msgstr ""
#. An option in the View menu. When selected, the canvas is being placed on the center of the screen.
msgid "Center Canvas"
msgstr ""
msgid "Tile Mode"
msgstr ""
@ -906,11 +902,6 @@ msgstr ""
msgid "Share options between the left and the right tools"
msgstr ""
#. Found in the preferences, under the Tools category. Tooltip of the "Share options between the left and the right tools" preference.
msgid "If this is enabled, options will be synced between the left and the right tool.\n"
"For example, both tools will share the same brush size, and changing it on one tool will instantly change on the other."
msgstr ""
msgid "Left tool color:"
msgstr ""

View file

@ -24,7 +24,7 @@ boot_splash/use_filter=false
config/icon="res://assets/graphics/icons/icon.png"
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
config/ExtensionsAPI_Version=5
config/ExtensionsAPI_Version=4
config/Pxo_Version=3
[audio]
@ -903,7 +903,7 @@ previous_project={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
center_canvas={
centre_canvas={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":67,"physical_keycode":0,"key_label":0,"unicode":67,"location":0,"echo":false,"script":null)
]

View file

@ -409,29 +409,6 @@ class ThemeAPI:
Themes.remove_theme(theme)
ExtensionsApi.remove_action("ThemeAPI", "add_theme")
## Adds a new font.
func add_font(font: Font) -> void:
Global.loaded_fonts.append(font)
Global.font_loaded.emit()
## Removes a loaded font.
## If that font is the current one of the interface, set it back to Roboto.
func remove_font(font: Font) -> void:
var font_index := Global.loaded_fonts.find(font)
if font_index == -1:
return
if Global.theme_font_index == font_index:
Global.theme_font_index = 1
Global.loaded_fonts.remove_at(font_index)
Global.font_loaded.emit()
## Sets a font as the current one for the interface. The font must have been
## added beforehand by [method add_font].
func set_font(font: Font) -> void:
var font_index := Global.loaded_fonts.find(font)
if font_index > -1:
Global.theme_font_index = font_index
## Gives ability to add/remove tools.
class ToolAPI:

View file

@ -12,7 +12,6 @@ signal project_about_to_switch ## Emitted before a project is about to be switc
signal project_switched ## Emitted whenever you switch to some other project tab.
signal cel_switched ## Emitted whenever you select a different cel.
signal project_data_changed(project: Project) ## Emitted when project data is modified.
signal font_loaded ## Emitted when a new font has been loaded, or an old one gets unloaded.
enum LayerTypes { PIXEL, GROUP, THREE_D }
enum GridTypes { CARTESIAN, ISOMETRIC, ALL }
@ -28,7 +27,7 @@ enum FileMenu { NEW, OPEN, OPEN_LAST_PROJECT, RECENT, SAVE, SAVE_AS, EXPORT, EXP
enum EditMenu { UNDO, REDO, COPY, CUT, PASTE, PASTE_IN_PLACE, DELETE, NEW_BRUSH, PREFERENCES }
## Enumeration of items present in the View Menu.
enum ViewMenu {
CENTER_CANVAS,
CENTRE_CANVAS,
TILE_MODE,
TILE_MODE_OFFSETS,
GREYSCALE_VIEW,
@ -211,24 +210,6 @@ var integer_zoom := false:
## Found in Preferences. The scale of the interface.
var shrink := 1.0
var theme_font := loaded_fonts[theme_font_index]:
set(value):
theme_font = value
if is_instance_valid(control) and is_instance_valid(control.theme):
control.theme.default_font = theme_font
## Found in Preferences. The index of the font used by the interface.
var theme_font_index := 1:
set(value):
theme_font_index = value
if theme_font_index < loaded_fonts.size():
theme_font = loaded_fonts[theme_font_index]
else:
var available_font_names := get_available_font_names()
if theme_font_index < available_font_names.size():
var font_name := available_font_names[theme_font_index]
theme_font = find_font_from_name(font_name)
else:
theme_font = loaded_fonts[1] # Fall back to Roboto if out of bounds
## Found in Preferences. The font size used by the interface.
var font_size := 16
## Found in Preferences. If [code]true[/code], the interface dims on popups.
@ -296,7 +277,6 @@ var tool_button_size := ButtonSize.SMALL:
return
tool_button_size = value
Tools.set_button_size(tool_button_size)
## Found in Preferences.
var share_options_between_tools := false:
set(value):
share_options_between_tools = value
@ -771,7 +751,7 @@ func _initialize_keychain() -> void:
&"palettize": Keychain.InputAction.new("", "Effects menu", true),
&"pixelize": Keychain.InputAction.new("", "Effects menu", true),
&"posterize": Keychain.InputAction.new("", "Effects menu", true),
&"center_canvas": Keychain.InputAction.new("", "View menu", true),
&"centre_canvas": Keychain.InputAction.new("", "View menu", true),
&"mirror_view": Keychain.InputAction.new("", "View menu", true),
&"show_grid": Keychain.InputAction.new("", "View menu", true),
&"show_pixel_grid": Keychain.InputAction.new("", "View menu", true),

View file

@ -43,8 +43,6 @@ func remove_theme(theme: Theme) -> void:
func change_theme(id: int) -> void:
theme_index = id
var theme := themes[id]
if theme.default_font != Global.theme_font:
theme.default_font = Global.theme_font
theme.default_font_size = Global.font_size
theme.set_font_size("font_size", "HeaderSmall", Global.font_size + 2)
var icon_color := theme.get_color("modulate_color", "Icons")

View file

@ -159,12 +159,6 @@ func _load_extension(extension_file_or_folder_name: StringName, internal := fals
var supported_api_versions = extension_json["supported_api_versions"]
if typeof(supported_api_versions) == TYPE_ARRAY:
supported_api_versions = PackedInt32Array(supported_api_versions)
# Extensions that support API version 4 are backwards compatible with version 5.
# Version 5 only adds new methods and does not break compatibility.
# TODO: Find a better way to determine which API versions
# have backwards compatibility with each other.
if 4 in supported_api_versions and not 5 in supported_api_versions:
supported_api_versions.append(5)
if not ExtensionsApi.get_api_version() in supported_api_versions:
var err_text := (
"The extension %s will not work on this version of Pixelorama \n"

View file

@ -9,7 +9,6 @@ var preferences: Array[Preference] = [
),
Preference.new("ffmpeg_path", "Startup/StartupContainer/FFMPEGPath", "text", ""),
Preference.new("shrink", "%ShrinkSlider", "value", 1.0),
Preference.new("theme_font_index", "%FontOptionButton", "selected", 1),
Preference.new("font_size", "%FontSizeSlider", "value", 16),
Preference.new(
"dim_on_popup", "Interface/InterfaceOptions/DimCheckBox", "button_pressed", true
@ -241,7 +240,6 @@ class Preference:
func _ready() -> void:
Global.font_loaded.connect(_add_fonts)
# Replace OK since preference changes are being applied immediately, not after OK confirmation
get_ok_button().text = "Close"
get_ok_button().size_flags_horizontal = Control.SIZE_EXPAND_FILL
@ -294,8 +292,6 @@ func _ready() -> void:
language.add_child(button)
button.pressed.connect(_on_language_pressed.bind(button.get_index()))
_add_fonts()
for pref in preferences:
if not right_side.has_node(pref.node_path):
continue
@ -362,14 +358,6 @@ func _on_Preference_value_changed(value, pref: Preference, button: RestoreDefaul
disable_restore_default_button(button, disable)
## Add fonts to the font option button.
func _add_fonts() -> void:
%FontOptionButton.clear()
for font_name in Global.get_available_font_names():
%FontOptionButton.add_item(font_name)
%FontOptionButton.select(Global.theme_font_index)
func preference_update(require_restart := false) -> void:
if require_restart:
must_restart.visible = true

View file

@ -205,15 +205,6 @@ layout_mode = 2
mouse_default_cursor_shape = 2
text = "Apply"
[node name="FontLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions"]
layout_mode = 2
size_flags_horizontal = 3
text = "Font:"
[node name="FontOptionButton" type="OptionButton" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions"]
unique_name_in_owner = true
layout_mode = 2
[node name="DimLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions"]
layout_mode = 2
size_flags_horizontal = 3
@ -875,16 +866,11 @@ columns = 3
[node name="ShareOptionsLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Tools/ToolOptions"]
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "If this is enabled, options will be synced between the left and the right tool.
For example, both tools will share the same brush size, and changing it on one tool will instantly change on the other."
mouse_filter = 1
text = "Share options between the left and the right tools"
[node name="ShareOptionsCheckBox" type="CheckBox" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Tools/ToolOptions"]
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "If this is enabled, options will be synced between the left and the right tool.
For example, both tools will share the same brush size, and changing it on one tool will instantly change on the other."
mouse_default_cursor_shape = 2
text = "On"

View file

@ -4,21 +4,21 @@
[ext_resource type="Script" path="res://src/Tools/DesignTools/Shading.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="3"]
[sub_resource type="ButtonGroup" id="ButtonGroup_lvcwb"]
[sub_resource type="ButtonGroup" id="ButtonGroup_se02m"]
resource_name = "rotate"
allow_unpress = true
[node name="ToolOptions" instance=ExtResource("1")]
script = ExtResource("2")
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
button_group = SubResource("ButtonGroup_lvcwb")
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
button_group = SubResource("ButtonGroup_se02m")
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
button_group = SubResource("ButtonGroup_lvcwb")
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
button_group = SubResource("ButtonGroup_se02m")
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
button_group = SubResource("ButtonGroup_lvcwb")
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
button_group = SubResource("ButtonGroup_se02m")
[node name="LightenDarken" type="OptionButton" parent="." index="5"]
custom_minimum_size = Vector2(92, 0)
@ -83,7 +83,7 @@ layout_mode = 2
layout_mode = 2
max_value = 10.0
allow_greater = true
prefix = "Colors right"
prefix = "Colors Right"
[node name="HBoxContainer" type="HBoxContainer" parent="ColorReplaceOptions/Settings" index="1"]
layout_mode = 2
@ -107,7 +107,7 @@ layout_mode = 2
[node name="Label" type="Label" parent="ColorReplaceOptions" index="1"]
custom_minimum_size = Vector2(0, 75)
layout_mode = 2
text = "Please select a color from the palette."
text = "Please Select a color from the palette."
horizontal_alignment = 1
autowrap_mode = 3

View file

@ -1,22 +1,18 @@
extends AcceptDialog
var main_canvas := Global.control.find_child("Main Canvas", true, false)
@onready var slider := $VBoxContainer/ValueSlider as ValueSlider
@onready var fullscreen_warning := $VBoxContainer/FullscreenWarning as Label
@onready var main_canvas := Global.control.find_child("Main Canvas") as Control
func _ready() -> void:
if main_canvas is FloatingWindow: ## If it's shifted to a window then get the content
main_canvas = main_canvas.window_content
await get_tree().process_frame
Global.control.main_ui.sort_children.connect(_recalculate_opacity)
func _on_WindowOpacityDialog_about_to_show() -> void:
var canvas_window = main_canvas.get_window()
canvas_window.transparent = true
canvas_window.transparent_bg = true
get_tree().root.transparent = true
get_tree().root.transparent_bg = true
slider.editable = not is_fullscreen()
fullscreen_warning.visible = not slider.editable
@ -35,11 +31,7 @@ func set_window_opacity(value: float) -> void:
if container is TabContainer:
var center := container.get_rect().get_center()
if main_canvas.get_rect().has_point(center):
if main_canvas.get_window() != get_tree().root:
## In case we converted to window while trransparency was active
container.self_modulate.a = 1.0
else:
container.self_modulate.a = value
container.self_modulate.a = value
Global.transparent_checker.update_transparency(value)

View file

@ -206,7 +206,7 @@ func _setup_edit_menu() -> void:
func _setup_view_menu() -> void:
# Order as in Global.ViewMenu enum
var view_menu_items := {
"Center Canvas": "center_canvas",
"Centre Canvas": "centre_canvas",
"Tile Mode": "",
"Tile Mode Offsets": "",
"Grayscale View": "",
@ -227,7 +227,7 @@ func _setup_view_menu() -> void:
_setup_snap_to_submenu(item)
elif item == "Tile Mode Offsets":
view_menu.add_item(item, i)
elif item == "Center Canvas":
elif item == "Centre Canvas":
_set_menu_shortcut(view_menu_items[item], view_menu, i, item)
else:
_set_menu_shortcut(view_menu_items[item], view_menu, i, item, true)
@ -602,7 +602,7 @@ func edit_menu_id_pressed(id: int) -> void:
func view_menu_id_pressed(id: int) -> void:
match id:
Global.ViewMenu.CENTER_CANVAS:
Global.ViewMenu.CENTRE_CANVAS:
Global.camera.offset = Global.current_project.size / 2
Global.ViewMenu.TILE_MODE_OFFSETS:
_popup_dialog(get_tree().current_scene.tile_mode_offsets_dialog)

View file

@ -1,28 +1,12 @@
extends Panel
var shader_disabled := false
var transparency_material: ShaderMaterial
@onready var main_canvas_container := find_child("Main Canvas") as Container
func _ready() -> void:
transparency_material = material
main_canvas_container.property_list_changed.connect(_re_configure_shader)
update_transparent_shader()
func _re_configure_shader():
await get_tree().process_frame
if get_window() != main_canvas_container.get_window():
material = null
shader_disabled = true
else:
if shader_disabled:
material = transparency_material
shader_disabled = false
func _on_main_canvas_item_rect_changed() -> void:
update_transparent_shader()
@ -36,6 +20,6 @@ func update_transparent_shader() -> void:
return
# Works independently of the transparency feature
var canvas_size: Vector2 = (main_canvas_container.size - Vector2.DOWN * 2) * Global.shrink
transparency_material.set_shader_parameter("screen_resolution", get_viewport().size)
transparency_material.set_shader_parameter("position", main_canvas_container.global_position * Global.shrink)
transparency_material.set_shader_parameter("size", canvas_size)
material.set_shader_parameter("screen_resolution", get_viewport().size)
material.set_shader_parameter("position", main_canvas_container.global_position * Global.shrink)
material.set_shader_parameter("size", canvas_size)