mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Renamed "Base" to "BaseTool" and made it a class
This commit is contained in:
parent
dc469dd4b5
commit
ce7320ad4f
|
@ -14,6 +14,11 @@ _global_script_classes=[ {
|
|||
"language": "GDScript",
|
||||
"path": "res://src/Classes/AnimationTag.gd"
|
||||
}, {
|
||||
"base": "VBoxContainer",
|
||||
"class": "BaseTool",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/Tools/BaseTool.gd"
|
||||
}, {
|
||||
"base": "Popup",
|
||||
"class": "Brushes",
|
||||
"language": "GDScript",
|
||||
|
@ -86,6 +91,7 @@ _global_script_classes=[ {
|
|||
} ]
|
||||
_global_script_class_icons={
|
||||
"AnimationTag": "",
|
||||
"BaseTool": "",
|
||||
"Brushes": "",
|
||||
"Canvas": "",
|
||||
"Cel": "",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends VBoxContainer
|
||||
class_name BaseTool extends VBoxContainer
|
||||
|
||||
|
||||
var kname : String
|
||||
|
@ -8,7 +8,7 @@ var cursor_text := ""
|
|||
var _cursor := Vector2.INF
|
||||
|
||||
|
||||
func _ready():
|
||||
func _ready() -> void:
|
||||
kname = name.replace(" ", "_").to_lower()
|
||||
$Label.text = tool_slot.name
|
||||
|
||||
|
@ -19,12 +19,12 @@ func _ready():
|
|||
$Mirror/Vertical.pressed = tool_slot.vertical_mirror
|
||||
|
||||
|
||||
func _on_PixelPerfect_toggled(button_pressed : bool):
|
||||
func _on_PixelPerfect_toggled(button_pressed : bool) -> void:
|
||||
tool_slot.pixel_perfect = button_pressed
|
||||
tool_slot.save_config()
|
||||
|
||||
|
||||
func _on_Horizontal_toggled(button_pressed : bool):
|
||||
func _on_Horizontal_toggled(button_pressed : bool) -> void:
|
||||
tool_slot.horizontal_mirror = button_pressed
|
||||
tool_slot.save_config()
|
||||
Global.show_y_symmetry_axis = button_pressed
|
||||
|
@ -34,7 +34,7 @@ func _on_Horizontal_toggled(button_pressed : bool):
|
|||
Global.current_project.y_symmetry_axis.visible = Global.show_y_symmetry_axis and Global.show_guides
|
||||
|
||||
|
||||
func _on_Vertical_toggled(button_pressed : bool):
|
||||
func _on_Vertical_toggled(button_pressed : bool) -> void:
|
||||
tool_slot.vertical_mirror = button_pressed
|
||||
tool_slot.save_config()
|
||||
Global.show_x_symmetry_axis = button_pressed
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/Tools/BaseTool.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/horizontal_mirror_on.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/horizontal_mirror_off.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/vertical_mirror_on.png" type="Texture" id=4]
|
|
@ -1,4 +1,4 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
var _pattern : Patterns.Pattern
|
||||
|
@ -35,13 +35,13 @@ func _on_Pattern_selected(pattern : Patterns.Pattern) -> void:
|
|||
save_config()
|
||||
|
||||
|
||||
func _on_PatternOffsetX_value_changed(value : float):
|
||||
func _on_PatternOffsetX_value_changed(value : float) -> void:
|
||||
_offset_x = int(value)
|
||||
update_config()
|
||||
save_config()
|
||||
|
||||
|
||||
func _on_PatternOffsetY_value_changed(value : float):
|
||||
func _on_PatternOffsetY_value_changed(value : float) -> void:
|
||||
_offset_y = int(value)
|
||||
update_config()
|
||||
save_config()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/Bucket.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
|
@ -12,7 +12,7 @@ corner_radius_bottom_right = 5
|
|||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
|
@ -81,11 +81,11 @@ rect_min_size = Vector2( 32, 32 )
|
|||
hint_tooltip = "Select a brush"
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 4
|
||||
custom_styles/hover = SubResource( 2 )
|
||||
custom_styles/pressed = SubResource( 2 )
|
||||
custom_styles/focus = SubResource( 1 )
|
||||
custom_styles/disabled = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 2 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/focus = SubResource( 2 )
|
||||
custom_styles/disabled = SubResource( 2 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="FillPattern/Type" index="0"]
|
||||
margin_right = 32.0
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
var _color_slot := 0
|
||||
|
||||
|
||||
func _on_Options_item_selected(id):
|
||||
func _on_Options_item_selected(id : int) -> void:
|
||||
_color_slot = id
|
||||
update_config()
|
||||
save_config()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/ColorPicker.gd" type="Script" id=2]
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 1 )]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
var _brush := Brushes.get_default_brush()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/Draw.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
|
@ -12,7 +12,7 @@ corner_radius_bottom_right = 5
|
|||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
|
@ -38,11 +38,11 @@ rect_min_size = Vector2( 32, 32 )
|
|||
hint_tooltip = "Select a brush"
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
custom_styles/hover = SubResource( 2 )
|
||||
custom_styles/pressed = SubResource( 2 )
|
||||
custom_styles/focus = SubResource( 1 )
|
||||
custom_styles/disabled = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 2 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/focus = SubResource( 2 )
|
||||
custom_styles/disabled = SubResource( 2 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="Brush/Type" index="0"]
|
||||
margin_right = 32.0
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
func draw_start(_position : Vector2) -> void:
|
||||
Global.camera.drag = true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/Pan.gd" type="Script" id=2]
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 1 )]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
var _start := Rect2(0, 0, 0, 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/RectSelect.gd" type="Script" id=2]
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 1 )]
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
extends "res://src/Tools/Base.gd"
|
||||
extends BaseTool
|
||||
|
||||
|
||||
var _zoom_mode := 0
|
||||
|
||||
|
||||
func _on_ModeOptions_item_selected(id):
|
||||
func _on_ModeOptions_item_selected(id : int) -> void:
|
||||
_zoom_mode = id
|
||||
update_config()
|
||||
save_config()
|
||||
|
||||
|
||||
func _on_FitToFrame_pressed():
|
||||
func _on_FitToFrame_pressed() -> void:
|
||||
Global.camera.fit_to_frame(Global.current_project.size)
|
||||
|
||||
|
||||
func _on_100_pressed():
|
||||
func _on_100_pressed() -> void:
|
||||
Global.camera.zoom_100()
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/BaseTool.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Tools/Zoom.gd" type="Script" id=2]
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 1 )]
|
||||
|
|
Loading…
Reference in a new issue