Moved tile mode drawing logic from Canvas to a new script

I mostly did it so I could move tile mode logic into a new node, so I could have control over the drawing order. TileMode.gd also always draws 8 blank rectangles, which are being drawn on top of the grid, in order to hide it if it gets out of boundaries. We are now very close to implementing an isometric grid, #305.

This shouldn't have much of a performance impact, but some more testing is most likely needed.
This commit is contained in:
OverloadedOrama 2020-08-18 17:03:49 +03:00
parent f2136236b1
commit 14d958e55f
6 changed files with 45 additions and 18 deletions

View file

@ -62,11 +62,11 @@ func change_theme(ID : int) -> void:
Global.control.theme = main_theme
Global.control.theme.default_font = font
var default_clear_color : Color = main_theme.get_stylebox("panel", "PanelContainer").bg_color
VisualServer.set_default_clear_color(Color(default_clear_color))
Global.default_clear_color = main_theme.get_stylebox("panel", "PanelContainer").bg_color
VisualServer.set_default_clear_color(Color(Global.default_clear_color))
(Global.animation_timeline.get_stylebox("panel", "Panel") as StyleBoxFlat).bg_color = main_theme.get_stylebox("panel", "Panel").bg_color
var layer_button_panel_container : PanelContainer = Global.find_node_by_name(Global.animation_timeline, "LayerButtonPanelContainer")
(layer_button_panel_container.get_stylebox("panel", "PanelContainer") as StyleBoxFlat).bg_color = default_clear_color
(layer_button_panel_container.get_stylebox("panel", "PanelContainer") as StyleBoxFlat).bg_color = Global.default_clear_color
var top_menu_style = main_theme.get_stylebox("TopMenu", "Panel")
var ruler_style = main_theme.get_stylebox("Ruler", "Button")