Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[gd_scene load_steps=7 format=2]
2019-12-18 18:12:44 +02:00
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
[ext_resource path="res://src/Preferences/PreferencesDialog.gd" type="Script" id=1]
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[ext_resource path="res://src/Preferences/HandleExtensions.gd" type="Script" id=2]
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
2022-05-16 15:07:51 +03:00
[ext_resource path="res://addons/keychain/ShortcutEdit.tscn" type="PackedScene" id=3]
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
[ext_resource path="res://src/Preferences/HandleLanguages.gd" type="Script" id=4]
[ext_resource path="res://src/Preferences/HandleThemes.gd" type="Script" id=5]
[sub_resource type="ButtonGroup" id=1]
2019-12-18 18:12:44 +02:00
[node name="PreferencesDialog" type="AcceptDialog"]
2020-04-15 19:44:34 +02:00
margin_left = -3.0
2020-04-15 20:52:20 +02:00
margin_top = 9.0
2021-12-11 20:02:51 +02:00
margin_right = 617.0
margin_bottom = 459.0
2020-05-05 16:03:32 +03:00
rect_min_size = Vector2( 620, 450 )
2019-12-18 18:12:44 +02:00
window_title = "Preferences"
resizable = true
script = ExtResource( 1 )
2020-02-11 18:42:23 +02:00
__meta__ = {
"_edit_horizontal_guides_": [ ],
2020-04-08 00:56:05 +02:00
"_edit_use_anchors_": false,
2020-02-11 18:42:23 +02:00
"_edit_vertical_guides_": [ ]
}
2019-12-18 18:12:44 +02:00
2019-12-27 01:02:36 +02:00
[node name="HSplitContainer" type="HSplitContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
2019-12-18 18:12:44 +02:00
margin_top = 8.0
2019-12-27 01:02:36 +02:00
margin_right = -8.0
margin_bottom = -36.0
size_flags_horizontal = 3
2019-12-27 02:12:26 +02:00
custom_constants/autohide = 0
2020-07-29 01:54:15 +03:00
custom_constants/separation = 20
2020-04-15 19:44:34 +02:00
split_offset = 1
2020-04-08 00:56:05 +02:00
__meta__ = {
"_edit_use_anchors_": false
}
2019-12-27 01:02:36 +02:00
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
[node name="List" type="ItemList" parent="HSplitContainer"]
2020-04-15 19:44:34 +02:00
margin_right = 86.0
2021-12-11 20:02:51 +02:00
margin_bottom = 406.0
2020-04-15 19:44:34 +02:00
rect_min_size = Vector2( 85, 0 )
2019-12-27 01:02:36 +02:00
[node name="ScrollContainer" type="ScrollContainer" parent="HSplitContainer"]
2020-07-29 01:54:15 +03:00
margin_left = 106.0
2020-05-06 16:16:39 +03:00
margin_right = 604.0
2021-12-11 20:02:51 +02:00
margin_bottom = 406.0
2019-12-27 01:02:36 +02:00
rect_min_size = Vector2( 100, 0 )
size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
2020-07-29 01:54:15 +03:00
margin_right = 498.0
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
2022-05-16 15:07:51 +03:00
margin_bottom = 406.0
2020-07-29 01:54:15 +03:00
size_flags_horizontal = 3
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
2022-05-16 15:07:51 +03:00
size_flags_vertical = 3
2020-03-27 03:40:23 +02:00
2020-07-29 01:54:15 +03:00
[node name="Startup" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
margin_right = 498.0
2022-01-05 02:34:45 +02:00
margin_bottom = 52.0
2020-03-27 03:40:23 +02:00
2022-01-05 02:34:45 +02:00
[node name="StartupContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup"]
2020-07-29 01:54:15 +03:00
margin_right = 498.0
2022-01-05 02:34:45 +02:00
margin_bottom = 52.0
columns = 3
2020-03-27 03:40:23 +02:00
2022-01-05 02:34:45 +02:00
[node name="OpenLastProjectLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
2020-07-29 01:54:15 +03:00
margin_top = 5.0
margin_right = 180.0
margin_bottom = 19.0
text = "Open last project on startup"
2020-03-27 03:40:23 +02:00
2020-07-29 01:54:15 +03:00
[node name="OpenLastProject" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_left = 184.0
margin_right = 231.0
margin_bottom = 24.0
hint_tooltip = "Opens last opened project on startup"
2020-03-27 03:40:23 +02:00
mouse_default_cursor_shape = 2
2020-07-29 01:54:15 +03:00
text = "On"
2020-04-30 19:33:24 +02:00
2022-01-05 02:34:45 +02:00
[node name="QuitConfirmationLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_left = 235.0
margin_top = 5.0
margin_right = 348.0
margin_bottom = 19.0
text = "Quit confirmation"
[node name="QuitConfirmation" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_top = 28.0
margin_right = 180.0
margin_bottom = 52.0
mouse_default_cursor_shape = 2
text = "On"
2020-07-29 01:54:15 +03:00
[node name="PressureSentivity" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup"]
2020-02-14 18:26:03 +02:00
visible = false
2020-11-07 02:57:35 +01:00
margin_top = 28.0
margin_right = 498.0
margin_bottom = 48.0
2020-02-08 00:10:33 +02:00
2020-07-29 01:54:15 +03:00
[node name="PressureSensitivityLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/PressureSentivity"]
2020-02-08 00:10:33 +02:00
margin_top = 3.0
margin_right = 173.0
margin_bottom = 17.0
text = "Tablet pressure sensitivity:"
2020-07-29 01:54:15 +03:00
[node name="PressureSensitivityOptionButton" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/PressureSentivity"]
2020-02-08 00:10:33 +02:00
margin_left = 177.0
margin_right = 334.0
margin_bottom = 20.0
text = "Affect Brush's Alpha"
items = [ "None", null, false, 0, null, "Affect Brush's Alpha", null, false, 1, null ]
selected = 1
2022-02-18 01:03:08 +02:00
[node name="Language" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
2020-11-09 01:52:53 +02:00
visible = false
margin_top = 184.0
margin_right = 506.0
margin_bottom = 632.0
script = ExtResource( 4 )
2022-02-18 01:03:08 +02:00
[node name="System Language" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Language"]
2020-11-09 01:52:53 +02:00
margin_right = 506.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
pressed = true
group = SubResource( 1 )
text = "System Language"
[node name="Interface" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
2022-07-08 03:25:17 +03:00
margin_top = 56.0
2020-11-07 02:57:35 +01:00
margin_right = 498.0
2022-07-08 03:25:17 +03:00
margin_bottom = 250.0
2020-11-09 01:52:53 +02:00
[node name="ShrinkContainer" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_right = 498.0
margin_bottom = 20.0
2020-11-07 02:57:35 +01:00
2020-11-09 01:52:53 +02:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer"]
2020-11-07 02:57:35 +01:00
margin_top = 3.0
2021-03-17 19:28:01 +02:00
margin_right = 84.0
2020-11-07 02:57:35 +01:00
margin_bottom = 17.0
2020-11-09 14:15:42 +02:00
text = "Display Scale"
2020-11-07 02:57:35 +01:00
2020-11-09 01:52:53 +02:00
[node name="ShrinkLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer"]
2021-03-17 19:28:01 +02:00
margin_left = 88.0
2020-11-07 02:57:35 +01:00
margin_top = 3.0
2021-03-17 19:28:01 +02:00
margin_right = 138.0
2020-11-07 02:57:35 +01:00
margin_bottom = 17.0
rect_min_size = Vector2( 50, 0 )
text = "1"
align = 2
2020-11-09 01:52:53 +02:00
[node name="ShrinkHSlider" type="HSlider" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer"]
2022-09-18 01:17:35 +03:00
unique_name_in_owner = true
2021-03-17 19:28:01 +02:00
margin_left = 142.0
2020-11-07 02:57:35 +01:00
margin_right = 446.0
margin_bottom = 16.0
2020-11-09 01:52:53 +02:00
mouse_default_cursor_shape = 2
2020-11-07 02:57:35 +01:00
size_flags_horizontal = 3
2022-09-17 03:01:11 +03:00
min_value = 0.5
2020-11-07 02:57:35 +01:00
max_value = 4.0
2021-11-01 18:23:09 +02:00
step = 0.25
2020-11-07 02:57:35 +01:00
value = 1.0
2022-09-17 03:01:11 +03:00
tick_count = 8
2020-11-07 02:57:35 +01:00
ticks_on_borders = true
2020-11-09 01:52:53 +02:00
[node name="ShrinkApplyButton" type="Button" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer"]
2020-11-07 02:57:35 +01:00
margin_left = 450.0
margin_right = 498.0
margin_bottom = 20.0
2020-11-09 01:52:53 +02:00
mouse_default_cursor_shape = 2
2020-11-07 02:57:35 +01:00
text = "Apply"
2021-03-17 19:28:01 +02:00
[node name="DimPopup" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 24.0
margin_right = 498.0
margin_bottom = 48.0
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/DimPopup"]
margin_top = 5.0
2021-06-04 21:44:05 +03:00
margin_right = 193.0
2021-03-17 19:28:01 +02:00
margin_bottom = 19.0
text = "Dim interface on dialog popup"
[node name="CheckBox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/DimPopup"]
2021-06-04 21:44:05 +03:00
margin_left = 197.0
margin_right = 244.0
2021-03-17 19:28:01 +02:00
margin_bottom = 24.0
mouse_default_cursor_shape = 2
pressed = true
text = "On"
2020-11-09 01:52:53 +02:00
[node name="HSeparator" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2021-03-17 19:28:01 +02:00
margin_top = 52.0
margin_right = 498.0
margin_bottom = 56.0
2019-12-27 01:02:36 +02:00
2020-11-09 01:52:53 +02:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2021-03-17 19:28:01 +02:00
margin_top = 60.0
2020-11-09 01:52:53 +02:00
margin_right = 498.0
2021-03-17 19:28:01 +02:00
margin_bottom = 74.0
2020-11-09 01:52:53 +02:00
text = "Themes"
2019-12-19 01:18:57 +02:00
2020-11-09 01:52:53 +02:00
[node name="Themes" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2021-03-17 19:28:01 +02:00
margin_top = 78.0
2020-07-29 04:40:27 +03:00
margin_right = 498.0
2021-03-17 19:28:01 +02:00
margin_bottom = 82.0
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
script = ExtResource( 5 )
2019-12-27 02:12:26 +02:00
2020-11-09 01:52:53 +02:00
[node name="ThemeButtons" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/Themes"]
margin_bottom = 4.0
2020-09-29 18:00:43 +03:00
2020-11-09 01:52:53 +02:00
[node name="ThemeColorsSpacer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/Themes"]
2020-09-29 18:00:43 +03:00
margin_left = 4.0
margin_right = 4.0
2020-11-09 01:52:53 +02:00
margin_bottom = 4.0
[node name="Control" type="Control" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/Themes/ThemeColorsSpacer"]
[node name="ThemeColors" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/Themes/ThemeColorsSpacer"]
margin_top = 4.0
margin_bottom = 4.0
2020-09-29 18:00:43 +03:00
custom_constants/separation = 12
2020-07-29 04:40:27 +03:00
2021-06-04 21:44:05 +03:00
[node name="HSeparator2" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2021-06-14 02:14:31 +03:00
margin_top = 86.0
2021-06-04 21:44:05 +03:00
margin_right = 498.0
2021-06-14 02:14:31 +03:00
margin_bottom = 90.0
2021-06-04 21:44:05 +03:00
[node name="IconColorFrom" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2021-06-14 02:14:31 +03:00
margin_top = 94.0
2021-06-04 21:44:05 +03:00
margin_right = 498.0
2022-07-08 03:25:17 +03:00
margin_bottom = 162.0
2021-06-04 21:44:05 +03:00
columns = 3
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_top = 3.0
margin_right = 102.0
margin_bottom = 17.0
text = "Icon color from:"
[node name="IconColorOptionButton" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
2022-07-08 03:25:17 +03:00
margin_right = 199.0
2021-06-04 21:44:05 +03:00
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Theme"
items = [ "Theme", null, false, 0, null, "Custom", null, false, 1, null ]
selected = 0
[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
2022-07-08 03:25:17 +03:00
margin_left = 203.0
2021-06-14 02:14:31 +03:00
margin_top = 3.0
2022-07-08 03:25:17 +03:00
margin_right = 271.0
2021-06-14 02:14:31 +03:00
margin_bottom = 17.0
2021-06-04 21:44:05 +03:00
text = "Icon color:"
[node name="IconColorButton" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_top = 24.0
margin_right = 64.0
margin_bottom = 44.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0.75, 0.75, 0.75, 1 )
2022-07-08 03:25:17 +03:00
[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
margin_top = 27.0
margin_right = 199.0
margin_bottom = 41.0
text = "Left tool color:"
[node name="LeftToolColorButton" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 203.0
margin_top = 24.0
margin_right = 267.0
margin_bottom = 44.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0, 0.52549, 0.811765, 1 )
[node name="Label4" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_top = 51.0
margin_right = 102.0
margin_bottom = 65.0
text = "Right tool color:"
[node name="RightToolColorButton" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
margin_top = 48.0
margin_right = 170.0
margin_bottom = 68.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0.992157, 0.427451, 0.0784314, 1 )
2021-06-14 02:14:31 +03:00
[node name="HSeparator3" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2022-07-08 03:25:17 +03:00
margin_top = 166.0
2021-06-14 02:14:31 +03:00
margin_right = 498.0
2022-07-08 03:25:17 +03:00
margin_bottom = 170.0
2021-06-14 02:14:31 +03:00
[node name="ToolButtonSize" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
2022-07-08 03:25:17 +03:00
margin_top = 174.0
2021-06-14 02:14:31 +03:00
margin_right = 498.0
2022-07-08 03:25:17 +03:00
margin_bottom = 194.0
2021-06-14 02:14:31 +03:00
columns = 3
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ToolButtonSize"]
margin_top = 3.0
margin_right = 107.0
margin_bottom = 17.0
text = "Tool button size:"
[node name="ToolButtonSizeOptionButton" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ToolButtonSize"]
margin_left = 111.0
margin_right = 175.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Small"
items = [ "Small", null, false, 0, null, "Big", null, false, 1, null ]
selected = 0
2020-04-18 15:03:18 +08:00
[node name="Canvas" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
visible = false
2022-09-10 02:58:13 +03:00
margin_top = 56.0
margin_right = 529.0
margin_bottom = 606.0
2020-07-29 01:54:15 +03:00
[node name="ZoomLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 14.0
text = "Zoom"
2020-07-29 03:16:02 +03:00
[node name="ZoomOptions" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2020-07-29 01:54:15 +03:00
margin_top = 18.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 42.0
2020-07-29 03:16:02 +03:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/ZoomOptions"]
margin_top = 5.0
2020-07-29 04:40:27 +03:00
margin_right = 110.0
2020-07-29 03:16:02 +03:00
margin_bottom = 19.0
2020-07-29 04:40:27 +03:00
rect_min_size = Vector2( 110, 0 )
2020-07-29 03:16:02 +03:00
text = "Smooth Zoom"
[node name="SmoothZoom" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/ZoomOptions"]
2020-07-29 04:40:27 +03:00
margin_left = 114.0
margin_right = 161.0
2020-07-29 03:16:02 +03:00
margin_bottom = 24.0
2020-07-29 01:54:15 +03:00
hint_tooltip = "Adds a smoother transition when zooming in or out"
mouse_default_cursor_shape = 2
pressed = true
2020-07-29 03:16:02 +03:00
text = "On"
2020-07-29 01:54:15 +03:00
[node name="HSeparator" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 46.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 50.0
[node name="GuideLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 54.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 68.0
text = "Guides"
2020-04-15 19:44:34 +02:00
2020-04-18 15:03:18 +08:00
[node name="GuideOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2020-07-29 01:54:15 +03:00
margin_top = 72.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 92.0
2020-04-15 19:44:34 +02:00
custom_constants/vseparation = 4
custom_constants/hseparation = 4
2020-07-29 03:16:02 +03:00
columns = 3
2019-12-27 01:02:36 +02:00
2020-04-18 15:03:18 +08:00
[node name="GuideColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GuideOptions"]
2020-04-15 19:44:34 +02:00
margin_top = 3.0
margin_right = 110.0
margin_bottom = 17.0
rect_min_size = Vector2( 110, 0 )
hint_tooltip = "A color of ruler guides displayed on the canvas"
mouse_filter = 0
text = "Guides color:"
2020-04-18 15:03:18 +08:00
[node name="GuideColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GuideOptions"]
2020-04-15 19:44:34 +02:00
margin_left = 114.0
2020-07-29 01:54:15 +03:00
margin_right = 178.0
2020-04-15 19:44:34 +02:00
margin_bottom = 20.0
rect_min_size = Vector2( 64, 20 )
hint_tooltip = "A color of ruler guides displayed on the canvas"
mouse_default_cursor_shape = 2
color = Color( 0.63, 0.13, 0.94, 1 )
2020-07-29 01:54:15 +03:00
[node name="HSeparator2" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 96.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 100.0
[node name="GridLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 104.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-07-29 01:54:15 +03:00
margin_bottom = 118.0
text = "Grid"
2019-12-18 18:12:44 +02:00
2020-04-18 15:03:18 +08:00
[node name="GridOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2020-07-29 01:54:15 +03:00
margin_top = 122.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
margin_bottom = 282.0
2019-12-27 02:12:26 +02:00
custom_constants/vseparation = 4
custom_constants/hseparation = 4
2020-07-29 03:16:02 +03:00
columns = 3
2019-12-18 18:12:44 +02:00
2021-01-20 01:17:33 +01:00
[node name="GridTypeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2020-10-26 00:10:14 +01:00
margin_top = 3.0
2022-09-10 02:58:13 +03:00
margin_right = 183.0
2020-10-26 00:10:14 +01:00
margin_bottom = 17.0
2020-08-20 00:12:07 +03:00
hint_tooltip = "Sets the type of the grid between rectangular, isometric or both"
mouse_filter = 0
text = "Grid type:"
__meta__ = {
"_editor_description_": ""
}
[node name="GridType" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
margin_right = 337.0
2020-08-20 00:12:07 +03:00
margin_bottom = 20.0
hint_tooltip = "Sets the type of the grid between rectangular, isometric or both"
mouse_default_cursor_shape = 2
text = "Rectangular"
items = [ "Rectangular", null, false, 0, null, "Isometric", null, false, 1, null, "All", null, false, 2, null ]
selected = 0
2021-01-20 01:17:33 +01:00
[node name="GridWidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
2020-10-26 00:10:14 +01:00
margin_top = 3.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-10-26 00:10:14 +01:00
margin_bottom = 17.0
2020-04-15 19:44:34 +02:00
rect_min_size = Vector2( 110, 0 )
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets how far apart are vertical lines of the rectangular grid"
2020-04-15 19:44:34 +02:00
mouse_filter = 0
2021-01-20 01:17:33 +01:00
text = "Rectangular grid width:"
2019-12-18 18:12:44 +02:00
2020-04-18 15:03:18 +08:00
[node name="GridWidthValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2020-10-26 00:10:14 +01:00
margin_top = 24.0
2022-09-10 02:58:13 +03:00
margin_right = 183.0
2020-10-26 00:10:14 +01:00
margin_bottom = 48.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets how far apart are vertical lines of the rectangular grid"
2020-02-07 03:27:11 +02:00
mouse_default_cursor_shape = 2
2019-12-18 18:12:44 +02:00
min_value = 1.0
max_value = 16384.0
2021-01-20 01:17:33 +01:00
value = 2.0
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
rounded = true
2020-04-15 19:44:34 +02:00
align = 2
2019-12-18 18:12:44 +02:00
suffix = "px"
2021-01-20 01:17:33 +01:00
[node name="GridHeightLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
2020-10-26 00:10:14 +01:00
margin_top = 29.0
2022-09-10 02:58:13 +03:00
margin_right = 337.0
2020-10-26 00:10:14 +01:00
margin_bottom = 43.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets how far apart are horizontal lines of the rectangular grid"
2020-04-15 19:44:34 +02:00
mouse_filter = 0
2021-01-20 01:17:33 +01:00
text = "Rectangular grid height:"
2019-12-18 18:12:44 +02:00
2020-04-18 15:03:18 +08:00
[node name="GridHeightValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
2020-10-26 00:10:14 +01:00
margin_top = 24.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2020-10-26 00:10:14 +01:00
margin_bottom = 48.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets how far apart are horizontal lines of the rectangular grid"
2020-02-07 03:27:11 +02:00
mouse_default_cursor_shape = 2
2019-12-18 18:12:44 +02:00
min_value = 1.0
max_value = 16384.0
2021-01-20 01:17:33 +01:00
value = 2.0
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
rounded = true
2020-04-15 19:44:34 +02:00
align = 2
2019-12-18 18:12:44 +02:00
suffix = "px"
2021-01-18 21:59:26 +01:00
[node name="IsometricCellBoundsWidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2020-10-26 00:10:14 +01:00
margin_top = 57.0
2022-09-10 02:58:13 +03:00
margin_right = 183.0
2020-10-26 00:10:14 +01:00
margin_bottom = 71.0
2021-01-18 21:59:26 +01:00
hint_tooltip = "Sets the width of the isometric cell's axis aligned bounding box"
2020-08-20 00:12:07 +03:00
mouse_filter = 0
2021-01-18 21:59:26 +01:00
text = "Isometric cell bounds width:"
2020-08-20 00:12:07 +03:00
2021-01-18 21:59:26 +01:00
[node name="IsometricCellBoundsWidthValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
2020-10-26 00:10:14 +01:00
margin_top = 52.0
2022-09-10 02:58:13 +03:00
margin_right = 337.0
2020-10-26 00:10:14 +01:00
margin_bottom = 76.0
2021-01-18 21:59:26 +01:00
hint_tooltip = "Sets the width of the isometric cell's axis aligned bounding box"
2020-08-20 00:12:07 +03:00
mouse_default_cursor_shape = 2
min_value = 2.0
max_value = 16384.0
2021-01-18 21:59:26 +01:00
value = 16.0
rounded = true
align = 2
suffix = "px"
[node name="IsometricCellBoundsHeightLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
2021-01-18 21:59:26 +01:00
margin_top = 57.0
2022-09-10 02:58:13 +03:00
margin_right = 529.0
2021-01-18 21:59:26 +01:00
margin_bottom = 71.0
hint_tooltip = "Sets the height of the isometric cell's axis aligned bounding box"
mouse_filter = 0
text = "Isometric cell bounds height:"
[node name="IsometricCellBoundsHeightValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_top = 80.0
margin_right = 183.0
margin_bottom = 104.0
2021-01-18 21:59:26 +01:00
hint_tooltip = "Sets the height of the isometric cell's axis aligned bounding box"
mouse_default_cursor_shape = 2
min_value = 2.0
max_value = 16384.0
value = 8.0
rounded = true
align = 2
suffix = "px"
2021-01-20 01:17:33 +01:00
[node name="GridOffsetXLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
margin_top = 85.0
margin_right = 337.0
margin_bottom = 99.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets grid's x offset from the canvas origin (top left corner of the image)"
2021-01-18 21:59:26 +01:00
mouse_filter = 0
2021-01-20 01:17:33 +01:00
text = "Grid offset x:"
2021-01-18 21:59:26 +01:00
2021-01-20 01:17:33 +01:00
[node name="GridOffsetXValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
margin_top = 80.0
margin_right = 529.0
margin_bottom = 104.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets grid's x offset from the canvas origin (top left corner of the image)"
2021-01-18 21:59:26 +01:00
mouse_default_cursor_shape = 2
min_value = -16384.0
max_value = 16384.0
rounded = true
align = 2
suffix = "px"
2021-01-20 01:17:33 +01:00
[node name="GridOffsetYLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_top = 113.0
margin_right = 183.0
margin_bottom = 127.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets grid's y offset from the canvas origin (top left corner of the image)"
2021-01-18 21:59:26 +01:00
mouse_filter = 0
2021-01-20 01:17:33 +01:00
text = "Grid offset y:"
2021-01-18 21:59:26 +01:00
2021-01-20 01:17:33 +01:00
[node name="GridOffsetYValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
margin_top = 108.0
margin_right = 337.0
margin_bottom = 132.0
2021-01-20 01:17:33 +01:00
hint_tooltip = "Sets grid's y offset from the canvas origin (top left corner of the image)"
2021-01-18 21:59:26 +01:00
mouse_default_cursor_shape = 2
min_value = -16384.0
max_value = 16384.0
2020-08-20 00:12:07 +03:00
rounded = true
align = 2
suffix = "px"
2021-01-20 01:17:33 +01:00
[node name="GridDrawOverTileModeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
margin_top = 113.0
margin_right = 529.0
margin_bottom = 127.0
2021-01-20 01:17:33 +01:00
rect_min_size = Vector2( 110, 0 )
2021-02-01 17:48:28 +02:00
hint_tooltip = "If disabled, the grid will be drawn only over the original image"
2021-01-20 01:17:33 +01:00
mouse_filter = 0
text = "Draw over Tile Mode:"
[node name="GridDrawOverTileMode" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_top = 136.0
margin_right = 183.0
margin_bottom = 160.0
2021-02-01 17:48:28 +02:00
hint_tooltip = "If disabled, the grid will be drawn only over the original image"
2021-01-20 01:17:33 +01:00
mouse_default_cursor_shape = 2
text = "On"
2020-04-18 15:03:18 +08:00
[node name="GridColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 187.0
margin_top = 141.0
margin_right = 337.0
margin_bottom = 155.0
2020-04-15 19:44:34 +02:00
hint_tooltip = "A color of the grid"
mouse_filter = 0
text = "Grid color:"
2019-12-18 18:12:44 +02:00
2020-04-18 15:03:18 +08:00
[node name="GridColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 341.0
margin_top = 136.0
margin_right = 529.0
margin_bottom = 160.0
2019-12-18 18:12:44 +02:00
rect_min_size = Vector2( 64, 20 )
2020-04-15 19:44:34 +02:00
hint_tooltip = "A color of the grid"
2020-02-07 03:27:11 +02:00
mouse_default_cursor_shape = 2
2019-12-27 02:28:36 +02:00
2020-07-29 01:54:15 +03:00
[node name="HSeparator3" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 286.0
margin_right = 529.0
margin_bottom = 290.0
2021-01-16 19:24:46 +01:00
[node name="PixelGridLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 294.0
margin_right = 529.0
margin_bottom = 308.0
2021-01-16 19:24:46 +01:00
text = "Pixel Grid"
[node name="PixelGridOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 312.0
margin_right = 529.0
margin_bottom = 360.0
2021-01-16 19:24:46 +01:00
custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 3
[node name="ShowAtZoomLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/PixelGridOptions"]
2022-09-10 02:58:13 +03:00
margin_top = 5.0
margin_right = 110.0
margin_bottom = 19.0
2021-01-16 19:24:46 +01:00
rect_min_size = Vector2( 110, 0 )
hint_tooltip = "Sets the minimal zoom at which pixel grid will be shown"
mouse_filter = 0
text = "Show at zoom:"
[node name="ShowAtZoom" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/PixelGridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 114.0
margin_right = 194.0
margin_bottom = 24.0
2021-01-16 19:24:46 +01:00
rect_min_size = Vector2( 80, 0 )
hint_tooltip = "Sets the minimal zoom at which pixel grid will be shown"
mouse_default_cursor_shape = 2
min_value = 500.0
max_value = 16384.0
step = 100.0
value = 1500.0
rounded = true
align = 2
suffix = "%"
[node name="GridColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/PixelGridOptions"]
2022-09-10 02:58:13 +03:00
margin_left = 198.0
margin_top = 5.0
margin_right = 297.0
margin_bottom = 19.0
2021-01-16 19:24:46 +01:00
hint_tooltip = "A color of the pixel grid"
mouse_filter = 0
text = "Pixel grid color:"
[node name="GridColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/PixelGridOptions"]
2022-09-10 02:58:13 +03:00
margin_top = 28.0
margin_right = 110.0
margin_bottom = 48.0
2021-01-16 19:24:46 +01:00
rect_min_size = Vector2( 64, 20 )
hint_tooltip = "A color of the pixel grid"
mouse_default_cursor_shape = 2
[node name="HSeparator4" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 364.0
margin_right = 529.0
margin_bottom = 368.0
2020-07-29 01:54:15 +03:00
[node name="TransparencyLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 372.0
margin_right = 529.0
margin_bottom = 386.0
2020-07-29 01:54:15 +03:00
text = "Transparency"
2020-04-18 15:03:18 +08:00
[node name="CheckerOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
2022-09-10 02:58:13 +03:00
margin_top = 390.0
margin_right = 529.0
margin_bottom = 494.0
2020-04-18 15:03:18 +08:00
custom_constants/vseparation = 4
custom_constants/hseparation = 4
2020-07-29 03:16:02 +03:00
columns = 3
2020-04-18 15:03:18 +08:00
[node name="SizeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
margin_top = 5.0
2020-10-26 00:10:14 +01:00
margin_right = 162.0
2020-04-18 15:03:18 +08:00
margin_bottom = 19.0
rect_min_size = Vector2( 110, 0 )
2020-04-18 18:36:29 +03:00
hint_tooltip = "Size of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_filter = 0
text = "Checker size:"
[node name="CheckerSizeValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 166.0
margin_right = 284.0
2020-04-18 15:03:18 +08:00
margin_bottom = 24.0
2020-04-18 18:36:29 +03:00
hint_tooltip = "Size of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
value = 10.0
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
rounded = true
2020-04-18 15:03:18 +08:00
align = 2
suffix = "px"
[node name="CheckerColor1Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 288.0
2020-07-29 03:16:02 +03:00
margin_top = 5.0
2020-10-26 00:10:14 +01:00
margin_right = 456.0
2020-07-29 03:16:02 +03:00
margin_bottom = 19.0
2020-04-18 18:36:29 +03:00
hint_tooltip = "First color of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_filter = 0
text = "Checker color 1:"
[node name="CheckerColor1" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
margin_top = 28.0
2020-10-26 00:10:14 +01:00
margin_right = 162.0
2020-04-18 15:03:18 +08:00
margin_bottom = 48.0
rect_min_size = Vector2( 64, 20 )
2020-04-18 18:36:29 +03:00
hint_tooltip = "First color of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_default_cursor_shape = 2
2020-05-03 03:42:44 +03:00
color = Color( 0.470588, 0.470588, 0.470588, 1 )
2020-04-18 15:03:18 +08:00
[node name="CheckerColor2Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 166.0
2020-07-29 03:16:02 +03:00
margin_top = 31.0
2020-10-26 00:10:14 +01:00
margin_right = 284.0
2020-07-29 03:16:02 +03:00
margin_bottom = 45.0
2020-04-18 18:36:29 +03:00
hint_tooltip = "Second color of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_filter = 0
text = "Checker color 2:"
[node name="CheckerColor2" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 288.0
2020-07-29 03:16:02 +03:00
margin_top = 28.0
2020-10-26 00:10:14 +01:00
margin_right = 456.0
2020-07-29 03:16:02 +03:00
margin_bottom = 48.0
2020-04-18 15:03:18 +08:00
rect_min_size = Vector2( 64, 20 )
2020-04-18 18:36:29 +03:00
hint_tooltip = "Second color of the transparent checker background"
2020-04-18 15:03:18 +08:00
mouse_default_cursor_shape = 2
2020-05-03 03:42:44 +03:00
color = Color( 0.341176, 0.34902, 0.341176, 1 )
2020-04-18 15:03:18 +08:00
2020-08-18 03:30:58 +08:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_top = 57.0
margin_right = 162.0
margin_bottom = 71.0
2020-08-18 03:30:58 +08:00
rect_min_size = Vector2( 110, 0 )
text = "Follow Canvas Movement"
[node name="CheckerFollowMovement" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 166.0
margin_top = 52.0
margin_right = 284.0
margin_bottom = 76.0
2020-08-18 00:01:45 +03:00
hint_tooltip = "The transparent checker follow the movement of canvas"
2020-08-18 03:30:58 +08:00
mouse_default_cursor_shape = 2
text = "On"
[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_left = 288.0
margin_top = 57.0
margin_right = 456.0
margin_bottom = 71.0
2020-08-18 03:30:58 +08:00
rect_min_size = Vector2( 110, 0 )
text = "Follow Canvas Zoom Level"
[node name="CheckerFollowScale" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
2020-10-26 00:10:14 +01:00
margin_top = 80.0
margin_right = 162.0
margin_bottom = 104.0
2020-08-18 00:01:45 +03:00
hint_tooltip = "The transparent checker follow the zoom level of canvas"
2020-08-18 03:30:58 +08:00
mouse_default_cursor_shape = 2
text = "On"
2020-10-26 00:10:14 +01:00
[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
margin_left = 166.0
margin_top = 85.0
margin_right = 284.0
margin_bottom = 99.0
rect_min_size = Vector2( 110, 0 )
mouse_filter = 0
text = "Tile mode opacity:"
[node name="TileModeOpacity" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/CheckerOptions"]
margin_left = 288.0
margin_top = 80.0
margin_right = 456.0
margin_bottom = 104.0
mouse_default_cursor_shape = 2
max_value = 1.0
step = 0.1
value = 1.0
align = 2
2022-09-10 02:58:13 +03:00
[node name="HSeparator5" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 498.0
margin_right = 529.0
margin_bottom = 502.0
[node name="BackgroundOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas"]
margin_top = 506.0
margin_right = 529.0
margin_bottom = 550.0
custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 3
[node name="ColorFromLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/BackgroundOptions"]
margin_top = 3.0
margin_right = 148.0
margin_bottom = 17.0
rect_min_size = Vector2( 110, 0 )
mouse_filter = 0
text = "Background color from:"
[node name="ColorOptionButton" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/BackgroundOptions"]
margin_left = 152.0
margin_right = 225.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Theme"
items = [ "Theme", null, false, 0, null, "Custom", null, false, 1, null ]
selected = 0
[node name="ColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/BackgroundOptions"]
margin_left = 229.0
margin_top = 3.0
margin_right = 343.0
margin_bottom = 17.0
mouse_filter = 0
text = "Background color:"
[node name="BackgroundColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/BackgroundOptions"]
margin_top = 24.0
margin_right = 148.0
margin_bottom = 44.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
color = Color( 0.470588, 0.470588, 0.470588, 1 )
2021-05-28 03:46:16 +03:00
[node name="Selection" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 28.0
margin_right = 498.0
margin_bottom = 76.0
[node name="SelectionOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection"]
margin_right = 498.0
margin_bottom = 48.0
custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 3
[node name="AnimateLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_top = 5.0
margin_right = 176.0
margin_bottom = 19.0
rect_min_size = Vector2( 110, 0 )
mouse_filter = 0
text = "Animated selection borders"
[node name="Animate" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_left = 180.0
margin_right = 275.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
pressed = true
text = "On"
[node name="BorderColor1Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_left = 279.0
margin_top = 5.0
margin_right = 374.0
margin_bottom = 19.0
mouse_filter = 0
text = "Border color 1:"
[node name="BorderColor1" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_top = 28.0
margin_right = 176.0
margin_bottom = 48.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
color = Color( 1, 1, 1, 1 )
[node name="BorderColor2Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_left = 180.0
margin_top = 31.0
margin_right = 275.0
margin_bottom = 45.0
mouse_filter = 0
text = "Border color 2:"
[node name="BorderColor2" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Selection/SelectionOptions"]
margin_left = 279.0
margin_top = 28.0
margin_right = 374.0
margin_bottom = 48.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
2022-05-16 15:07:51 +03:00
[node name="Shortcuts" parent="HSplitContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 3 )]
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
visible = false
2022-04-27 13:03:39 +01:00
margin_top = 56.0
Implement the Keychain Plugin (#700)
* Start implementing the godot_better_input plugin
* Update ShortcutEdit.gd
* Load & save preset option
* Add some groups and fix action events not being deleted on load
* Add MenuInputAction class for multiple menu accelerators
* Create a proper plugin and a BetterInput autoload
* Update menu accelerators
* Move settings to BetterInput
* Move menu enums to Global, make more MenuInputActions
* Add more menu events
* Add new groups
* Optimize BetterInput _input() method
* Remove a lot of lines of code
* Change some previous events, add ignore actions and a View menu group
* Change update_item_accelerator to update_ui
* Move MenuInputAction initialization to BetterInput.gd
* Update hint tooltips when a shortcut changes
Temporarily comment out some code regarding the configurable modifiers
* Some MenuInputAction variable name changes
* Add handle_input() to InputAction
* Update the shortcuts of buttons
* Fix shortcut selector menu position
* Change plugin name into Keychain
* Fix keyboard input dialog exiting when Enter or Space is being pressed
* Add two more groups
* Make groups folded by default
* Temporarily make tool modifier shortcuts not configurable
A temporary change, they will be made configurable again, with different actions that are currently mapped to the same events, local/independent from each other.
* Add license for Keychain
* Fix issue where a key event would be added in other input types
* Fix bug where the assigned state was not updated when the dialog appeared again
* Update Main.tscn
* Add a disabled line edit in keyboard shortcut selector to grab focus
* Load presets in the Keychain autoload
This way, the input actions get updated from the start, instead of only at the ShortcutEdit scene.
WARNING, this currently causes crashes if the menu items have no shortcut binded to them.
* Move custom settings away from Keychain.gd
To keep it the same as the upstream plugin
* Change menu enum names
* Made action_get_first_key() more general
* Use arrays for menu items instead of dictionaries, fixes crash
* Move moveable panels to Window menu
* Format
* Optimize hint tooltip updating
* Add support for translations in Keychain
* Translation changes
* Made tool modifiers configurable
Needs more testing.
* Made camera arrow key movement configurable & joypad axis support
This commit removes the ability to press Shift and Control+Shift to adjust the camera arrow key movement speed. Instead, the speed depends on the zoom level.
The right joypad analog stick is configured to move the camera by default.
* Rename presets into shortcut profiles, use Resources and let users create their own
* [skip ci] Update addons README
* Update Global.gd
2022-05-16 15:07:51 +03:00
margin_right = 498.0
margin_bottom = 56.0
2020-04-15 20:52:20 +02:00
2020-07-29 01:54:15 +03:00
[node name="Backup" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 184.0
margin_right = 498.0
margin_bottom = 254.0
[node name="AutosaveContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Backup"]
margin_top = 18.0
margin_right = 498.0
margin_bottom = 70.0
2020-07-29 03:16:02 +03:00
columns = 3
2020-07-29 01:54:15 +03:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Backup/AutosaveContainer"]
margin_top = 5.0
margin_right = 115.0
margin_bottom = 19.0
text = "Enable autosave"
[node name="EnableAutosave" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Backup/AutosaveContainer"]
margin_left = 119.0
margin_right = 214.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
pressed = true
text = "On"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AutosaveIntervalLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Backup/AutosaveContainer"]
margin_top = 33.0
margin_right = 115.0
margin_bottom = 47.0
size_flags_horizontal = 0
text = "Autosave interval:"
[node name="AutosaveInterval" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Backup/AutosaveContainer"]
margin_left = 119.0
margin_top = 28.0
margin_right = 214.0
margin_bottom = 52.0
rect_min_size = Vector2( 95, 0 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
min_value = 0.1
max_value = 30.0
step = 0.25
value = 1.0
align = 2
suffix = "minute(s)"
__meta__ = {
"_edit_use_anchors_": false
}
2021-01-05 20:01:50 +02:00
[node name="Performance" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 28.0
2021-12-11 20:02:51 +02:00
margin_right = 500.0
2021-01-05 20:01:50 +02:00
margin_bottom = 80.0
[node name="PerformanceContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Performance"]
2021-12-11 20:02:51 +02:00
margin_right = 500.0
2021-01-05 20:01:50 +02:00
margin_bottom = 52.0
columns = 3
[node name="SetFPSLimitLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Performance/PerformanceContainer"]
margin_top = 5.0
margin_right = 158.0
margin_bottom = 19.0
hint_tooltip = "Sets the limit of the application's frames per second. The lower the number, the lower the CPU usage, but the application gets slower, choppier and unresponsive. 0 means that there is no limit."
mouse_filter = 0
size_flags_horizontal = 0
text = "Set application FPS limit:"
[node name="SetFPSLimit" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Performance/PerformanceContainer"]
margin_left = 162.0
margin_right = 257.0
margin_bottom = 24.0
rect_min_size = Vector2( 95, 0 )
hint_tooltip = "Sets the limit of the application's frames per second. The lower the number, the lower the CPU usage, but the application gets slower, choppier and unresponsive. 0 means that there is no limit."
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
max_value = 144.0
align = 2
__meta__ = {
"_edit_use_anchors_": false
}
2021-12-11 20:02:51 +02:00
[node name="PauseAppFocusLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Performance/PerformanceContainer"]
margin_left = 261.0
2021-01-05 20:01:50 +02:00
margin_top = 5.0
2021-12-11 20:02:51 +02:00
margin_right = 500.0
2021-01-05 20:01:50 +02:00
margin_bottom = 19.0
2021-12-11 20:02:51 +02:00
hint_tooltip = "If this is toggled on, when the application's window loses focus, it gets paused. This helps lower CPU usage when idle. The application gets unpaused when the mouse enters the application's window."
2021-01-05 20:01:50 +02:00
mouse_filter = 0
2021-12-11 20:02:51 +02:00
text = "Pause application when it loses focus"
2021-01-05 20:01:50 +02:00
2021-12-11 20:02:51 +02:00
[node name="PauseAppFocus" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Performance/PerformanceContainer"]
2021-01-05 20:01:50 +02:00
margin_top = 28.0
margin_right = 158.0
margin_bottom = 52.0
2021-12-11 20:02:51 +02:00
hint_tooltip = "If this is toggled on, when the application's window loses focus, it gets paused. This helps lower CPU usage when idle. The application gets unpaused when the mouse enters the application's window."
2021-01-05 20:01:50 +02:00
mouse_default_cursor_shape = 2
pressed = true
text = "On"
__meta__ = {
"_edit_use_anchors_": false
}
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[node name="Extensions" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 56.0
margin_right = 498.0
margin_bottom = 65.0
script = ExtResource( 2 )
[node name="InstalledExtensions" type="ItemList" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions"]
margin_right = 498.0
margin_bottom = 9.0
auto_height = true
[node name="HBoxContainer" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions"]
margin_right = 40.0
margin_bottom = 40.0
[node name="AddExtensionButton" type="Button" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer"]
margin_right = 91.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Add Extension"
[node name="EnableButton" type="Button" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer"]
margin_right = 91.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
disabled = true
text = "Enable"
[node name="UninstallButton" type="Button" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer"]
margin_right = 91.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
disabled = true
text = "Uninstall"
[node name="OpenFolderButton" type="Button" parent="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer"]
margin_right = 12.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Open Folder"
2022-02-10 22:32:55 +02:00
[node name="Cursors" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
2020-07-29 01:54:15 +03:00
visible = false
2022-02-10 22:32:55 +02:00
margin_top = 56.0
margin_right = 525.0
margin_bottom = 164.0
2020-07-29 01:54:15 +03:00
2022-02-10 22:32:55 +02:00
[node name="CursorsContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors"]
margin_right = 525.0
margin_bottom = 108.0
2020-07-29 01:54:15 +03:00
custom_constants/vseparation = 4
custom_constants/hseparation = 4
2020-07-29 03:16:02 +03:00
columns = 3
2020-07-29 01:54:15 +03:00
2022-02-10 22:32:55 +02:00
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
2020-07-29 01:54:15 +03:00
margin_top = 5.0
2022-02-10 22:32:55 +02:00
margin_right = 126.0
2020-07-29 01:54:15 +03:00
margin_bottom = 19.0
text = "Left pixel indicator"
2022-02-10 22:32:55 +02:00
[node name="LeftIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 130.0
margin_right = 354.0
2020-07-29 01:54:15 +03:00
margin_bottom = 24.0
hint_tooltip = "Show left mouse pixel indicator or brush on the canvas when drawing"
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
pressed = true
text = "On"
2022-02-10 22:32:55 +02:00
[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 358.0
margin_top = 5.0
margin_right = 525.0
margin_bottom = 19.0
2020-07-29 01:54:15 +03:00
text = "Right pixel indicator"
2022-02-10 22:32:55 +02:00
[node name="RightIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
2020-07-29 01:54:15 +03:00
margin_top = 28.0
2022-02-10 22:32:55 +02:00
margin_right = 126.0
2020-07-29 01:54:15 +03:00
margin_bottom = 52.0
hint_tooltip = "Show right mouse pixel indicator or brush on the canvas when drawing"
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "On"
2022-02-10 22:32:55 +02:00
[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 130.0
margin_top = 33.0
margin_right = 354.0
margin_bottom = 47.0
text = "Show left tool icon"
[node name="LeftToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 358.0
margin_top = 28.0
margin_right = 525.0
margin_bottom = 52.0
hint_tooltip = "Displays an icon of the selected left tool next to the cursor on the canvas"
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
pressed = true
text = "On"
[node name="Label4" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
2020-07-29 01:54:15 +03:00
margin_top = 61.0
2022-02-10 22:32:55 +02:00
margin_right = 126.0
2020-07-29 01:54:15 +03:00
margin_bottom = 75.0
2022-02-10 22:32:55 +02:00
text = "Show right tool icon"
2020-07-29 01:54:15 +03:00
2022-02-10 22:32:55 +02:00
[node name="RightToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 130.0
2020-07-29 01:54:15 +03:00
margin_top = 56.0
2022-02-10 22:32:55 +02:00
margin_right = 354.0
2020-07-29 01:54:15 +03:00
margin_bottom = 80.0
2022-02-10 22:32:55 +02:00
hint_tooltip = "Displays an icon of the selected right tool next to the cursor on the canvas"
2020-07-29 01:54:15 +03:00
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
pressed = true
text = "On"
2022-02-10 22:32:55 +02:00
[node name="Label5" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 358.0
margin_top = 61.0
margin_right = 525.0
margin_bottom = 75.0
text = "Use native mouse cursors"
[node name="NativeCursorsCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_top = 84.0
margin_right = 126.0
margin_bottom = 108.0
mouse_default_cursor_shape = 2
text = "On"
[node name="Label6" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 130.0
2020-07-29 01:54:15 +03:00
margin_top = 89.0
2022-02-10 22:32:55 +02:00
margin_right = 354.0
2020-07-29 01:54:15 +03:00
margin_bottom = 103.0
2022-02-10 22:32:55 +02:00
text = "Use cross cursor for the canvas"
2020-07-29 01:54:15 +03:00
2022-02-10 22:32:55 +02:00
[node name="CrossCursorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"]
margin_left = 358.0
2020-07-29 01:54:15 +03:00
margin_top = 84.0
2022-02-10 22:32:55 +02:00
margin_right = 525.0
2020-07-29 01:54:15 +03:00
margin_bottom = 108.0
mouse_default_cursor_shape = 2
pressed = true
text = "On"
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[node name="Image" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 240.0
margin_right = 506.0
margin_bottom = 316.0
[node name="ImageOptions" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image"]
margin_right = 506.0
margin_bottom = 76.0
custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 3
[node name="DefaultWidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_top = 5.0
margin_right = 110.0
margin_bottom = 19.0
rect_min_size = Vector2( 110, 0 )
hint_tooltip = "A default width of a new image"
mouse_filter = 0
text = "Default width:"
[node name="ImageDefaultWidth" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_left = 114.0
margin_right = 188.0
margin_bottom = 24.0
hint_tooltip = "A default width of a new image"
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
value = 64.0
rounded = true
align = 2
suffix = "px"
[node name="DefaultHeightLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_top = 33.0
margin_right = 110.0
margin_bottom = 47.0
hint_tooltip = "A default height of a new image"
mouse_filter = 0
text = "Default height:"
[node name="ImageDefaultHeight" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_left = 114.0
margin_top = 28.0
margin_right = 188.0
margin_bottom = 52.0
hint_tooltip = "A default height of a new image"
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
value = 64.0
rounded = true
align = 2
suffix = "px"
[node name="DefaultFillColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_top = 59.0
margin_right = 110.0
margin_bottom = 73.0
hint_tooltip = "A default background color of a new image"
mouse_filter = 0
text = "Default fill color:"
[node name="DefaultFillColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Image/ImageOptions"]
margin_left = 114.0
margin_top = 56.0
margin_right = 188.0
margin_bottom = 76.0
rect_min_size = Vector2( 64, 20 )
hint_tooltip = "A default background color of a new image"
mouse_default_cursor_shape = 2
color = Color( 0, 0, 0, 0 )
2020-04-08 00:56:05 +02:00
[node name="Popups" type="Node" parent="."]
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[node name="AddExtensionFileDialog" type="FileDialog" parent="Popups"]
margin_right = 429.0
margin_bottom = 356.0
2022-04-27 13:03:39 +01:00
rect_min_size = Vector2( 172, 60.2 )
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
window_title = "Open File(s)"
resizable = true
mode = 1
access = 2
filters = PoolStringArray( "*.pck ; Godot Resource Pack File", "*.zip ;" )
show_hidden_files = true
2020-01-01 01:27:34 +02:00
[connection signal="about_to_show" from="." to="." method="_on_PreferencesDialog_about_to_show"]
[connection signal="popup_hide" from="." to="." method="_on_PreferencesDialog_popup_hide"]
Bring refactoring changes to master (#253)
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
2020-06-02 20:00:18 +03:00
[connection signal="item_selected" from="HSplitContainer/List" to="." method="_on_List_item_selected"]
2020-11-10 01:32:27 +02:00
[connection signal="value_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer/ShrinkHSlider" to="." method="_on_ShrinkHSlider_value_changed"]
2020-11-09 01:52:53 +02:00
[connection signal="pressed" from="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ShrinkContainer/ShrinkApplyButton" to="." method="_on_ShrinkApplyButton_pressed"]
Implement a basic extension system
Importing .pck or .zip Godot resource pack files into Pixelorama is now possible. This needs to be documented properly, but here's the basic idea, for now at least. This is super early work and I haven't tested it with a proper extension yet, so all of this could be a subject of change. I tested it with a custom theme extension though and it seems to be working perfectly.
Importing resource pack files, either by dragging and dropping them into the app window or by going to Edit>Preferences>Extensions>Add Extension, copies the files into user://extensions/. Extensions can be enabled/disabled and uninstalled. Uninstalling them deletes the resource pack files from user://extensions/.
The extension project source files need to be in a folder inside src/Extensions/ with the same name as the .pck or .zip file. **This is required for now, otherwise it will not work.** Inside that folder there also needs to be an extension.json file, with a structure similar to this:
{
"name": "ExtensionName",
"display_name": "Extension Name",
"description": "A Pixelorama extension",
"author": "Orama Interactive",
"version": "0.1",
"license": "MIT",
"nodes": [
"ExtensionExample.tscn"
]
}
The `nodes` array leads to the packed scene files with the nodes that are to be instantiated. **The root nodes of these scenes need to have the same name as the .tscn files they belong to.** The scripts of these nodes should have _enter_tree() and _exit_tree() methods to handle the extension enabling/disabling (or even uninstalling) logic. Note that .json files need to be included in the export options while exporting the extension from Godot.
Enabling an extension means that the scenes found in the extension.json's "nodes" array get instantiated, and disabling gets rid of these nodes from Pixelorama's SceneTree.
2022-02-19 03:21:08 +02:00
[connection signal="item_selected" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/InstalledExtensions" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_InstalledExtensions_item_selected"]
[connection signal="nothing_selected" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/InstalledExtensions" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_InstalledExtensions_nothing_selected"]
[connection signal="pressed" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer/AddExtensionButton" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_AddExtensionButton_pressed"]
[connection signal="pressed" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer/EnableButton" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_EnableButton_pressed"]
[connection signal="pressed" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer/UninstallButton" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_UninstallButton_pressed"]
[connection signal="pressed" from="HSplitContainer/ScrollContainer/VBoxContainer/Extensions/HBoxContainer/OpenFolderButton" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_OpenFolderButton_pressed"]
[connection signal="files_selected" from="Popups/AddExtensionFileDialog" to="HSplitContainer/ScrollContainer/VBoxContainer/Extensions" method="_on_AddExtensionFileDialog_files_selected"]