mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:44:42 -04:00
Finished implementing the isometric grid - Closes #305
Added the ability to change grid type in Preferences, and made an isometric cell size value which affects just the size of the cells of the isometric grid. Also updated translations.
This commit is contained in:
parent
1ff32f2892
commit
8d1c2e96f3
5 changed files with 74 additions and 10 deletions
|
@ -16,8 +16,10 @@ var preferences = [
|
|||
["default_image_height", "Image/ImageOptions/ImageDefaultHeight", "value", Global.default_image_height],
|
||||
["default_fill_color", "Image/ImageOptions/DefaultFillColor", "color", Global.default_fill_color],
|
||||
|
||||
["grid_type", "Canvas/GridOptions/GridType", "selected", Global.grid_type],
|
||||
["grid_width", "Canvas/GridOptions/GridWidthValue", "value", Global.grid_width],
|
||||
["grid_height", "Canvas/GridOptions/GridHeightValue", "value", Global.grid_height],
|
||||
["grid_isometric_cell_size", "Canvas/GridOptions/IsometricCellSizeValue", "value", Global.grid_isometric_cell_size],
|
||||
["grid_color", "Canvas/GridOptions/GridColor", "color", Global.grid_color],
|
||||
["guide_color", "Canvas/GuideOptions/GuideColor", "color", Global.guide_color],
|
||||
["checker_size", "Canvas/CheckerOptions/CheckerSizeValue", "value", Global.checker_size],
|
||||
|
@ -76,6 +78,9 @@ func _ready() -> void:
|
|||
if pref[2] == "color":
|
||||
preference_update(pref[0])
|
||||
disable_restore_default_button(restore_default_button, Global.get(pref[0]).is_equal_approx(pref[3]))
|
||||
elif pref[2] == "selected":
|
||||
preference_update(pref[0])
|
||||
disable_restore_default_button(restore_default_button, Global.get(pref[0]) == pref[3])
|
||||
|
||||
|
||||
func _on_Preference_toggled(button_pressed : bool, prop : String, default_value, restore_default_button : BaseButton) -> void:
|
||||
|
@ -115,7 +120,7 @@ func preference_update(prop : String) -> void:
|
|||
else:
|
||||
autosave_interval.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
|
||||
|
||||
if prop in ["grid_width", "grid_height", "grid_color"]:
|
||||
if prop in ["grid_type", "grid_width", "grid_height", "grid_isometric_cell_size", "grid_color"]:
|
||||
Global.canvas.grid.isometric_polylines.clear()
|
||||
Global.canvas.grid.update()
|
||||
|
||||
|
|
|
@ -216,6 +216,25 @@ custom_constants/vseparation = 4
|
|||
custom_constants/hseparation = 4
|
||||
columns = 3
|
||||
|
||||
[node name="TypeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 14.0
|
||||
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"]
|
||||
margin_right = 29.0
|
||||
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
|
||||
|
||||
[node name="WidthLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 5.0
|
||||
margin_right = 110.0
|
||||
|
@ -260,6 +279,26 @@ rounded = true
|
|||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="IsometricCellSizeLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 14.0
|
||||
hint_tooltip = "Sets the size of the cells in an isometric grid"
|
||||
mouse_filter = 0
|
||||
text = "Isometric cell size:"
|
||||
|
||||
[node name="IsometricCellSizeValue" type="SpinBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_top = 28.0
|
||||
margin_right = 110.0
|
||||
margin_bottom = 52.0
|
||||
hint_tooltip = "Sets the size of the cells in an isometric grid"
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 2.0
|
||||
max_value = 16384.0
|
||||
value = 2.0
|
||||
rounded = true
|
||||
align = 2
|
||||
suffix = "px"
|
||||
|
||||
[node name="GridColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Canvas/GridOptions"]
|
||||
margin_left = 114.0
|
||||
margin_top = 33.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue