mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 10:14:42 -04:00
Added a Splash Screen popup window
Re-organized transparent backgrounds, removed the Timer from Canvas nodes.
This commit is contained in:
parent
d1ef5c17e9
commit
d42648efe1
28 changed files with 241 additions and 104 deletions
|
@ -29,8 +29,6 @@ var line_2d : Line2D
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Global.can_draw = false
|
||||
|
||||
# The sprite itself
|
||||
if layers.empty():
|
||||
var sprite := Image.new()
|
||||
|
@ -837,9 +835,6 @@ func point_in_rectangle(p : Vector2, coord1 : Vector2, coord2 : Vector2) -> bool
|
|||
func rectangle_center(rect_position : Vector2, rect_size : Vector2) -> Vector2:
|
||||
return (rect_position - rect_size / 2).floor()
|
||||
|
||||
func _on_Timer_timeout() -> void:
|
||||
Global.can_draw = true
|
||||
|
||||
# Custom blend rect function, needed because Godot's issue #31124
|
||||
func blend_rect(bg : Image, brush : Image, src_rect : Rect2, dst : Vector2) -> void:
|
||||
var brush_size := brush.get_size()
|
||||
|
|
|
@ -89,35 +89,35 @@ func change_theme(ID : int) -> void:
|
|||
var ruler_style
|
||||
if ID == 0: #Dark Theme
|
||||
Global.theme_type = "Dark"
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Dark.png"), 0)
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Dark.png"), 0)
|
||||
VisualServer.set_default_clear_color(Color(0.247059, 0.25098, 0.247059))
|
||||
main_theme = preload("res://Themes & Styles/Dark Theme/Dark Theme.tres")
|
||||
top_menu_style = preload("res://Themes & Styles/Dark Theme/DarkTopMenuStyle.tres")
|
||||
ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres")
|
||||
elif ID == 1: #Gray Theme
|
||||
Global.theme_type = "Dark"
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Gray.png"), 0)
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Gray.png"), 0)
|
||||
VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961))
|
||||
main_theme = preload("res://Themes & Styles/Gray Theme/Gray Theme.tres")
|
||||
top_menu_style = preload("res://Themes & Styles/Gray Theme/GrayTopMenuStyle.tres")
|
||||
ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres")
|
||||
elif ID == 2: #Godot's Theme
|
||||
Global.theme_type = "Dark"
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0)
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Godot.png"), 0)
|
||||
VisualServer.set_default_clear_color(Color(0.27451, 0.278431, 0.305882))
|
||||
main_theme = preload("res://Themes & Styles/Godot\'s Theme/Godot\'s Theme.tres")
|
||||
top_menu_style = preload("res://Themes & Styles/Godot\'s Theme/TopMenuStyle.tres")
|
||||
ruler_style = preload("res://Themes & Styles/Godot\'s Theme/RulerStyle.tres")
|
||||
elif ID == 3: #Gold Theme
|
||||
Global.theme_type = "Gold"
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Gold.png"), 0)
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Gold.png"), 0)
|
||||
VisualServer.set_default_clear_color(Color(0.694118, 0.619608, 0.458824))
|
||||
main_theme = preload("res://Themes & Styles/Gold Theme/Gold Theme.tres")
|
||||
top_menu_style = preload("res://Themes & Styles/Gold Theme/GoldTopMenuStyle.tres")
|
||||
ruler_style = preload("res://Themes & Styles/Gold Theme/GoldRulerStyle.tres")
|
||||
elif ID == 4: #Light Theme
|
||||
Global.theme_type = "Light"
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Light.png"), 0)
|
||||
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Light.png"), 0)
|
||||
VisualServer.set_default_clear_color(Color(0.705882, 0.705882, 0.705882))
|
||||
main_theme = preload("res://Themes & Styles/Light Theme/Light Theme.tres")
|
||||
top_menu_style = preload("res://Themes & Styles/Light Theme/LightTopMenuStyle.tres")
|
||||
|
|
4
Scripts/Dialogs/SplashDialog.gd
Normal file
4
Scripts/Dialogs/SplashDialog.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends WindowDialog
|
||||
|
||||
func _on_ArtCredits_pressed() -> void:
|
||||
OS.shell_open("https://www.instagram.com/erevos_art")
|
|
@ -222,7 +222,7 @@ func _ready() -> void:
|
|||
|
||||
undo_redo = UndoRedo.new()
|
||||
transparent_background = ImageTexture.new()
|
||||
transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Dark.png"), 0)
|
||||
transparent_background.create_from_image(preload("res://Assets/Graphics/Canvas Backgrounds/Transparent Background Dark.png"), 0)
|
||||
image_clipboard = Image.new()
|
||||
|
||||
var root = get_tree().get_root()
|
||||
|
|
|
@ -153,6 +153,8 @@ func _ready() -> void:
|
|||
|
||||
Import.import_brushes("Brushes")
|
||||
|
||||
$SplashDialog.popup_centered() # Splash screen
|
||||
|
||||
func _input(event : InputEvent) -> void:
|
||||
Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
|
||||
Global.left_cursor.texture = Global.left_cursor_tool_texture
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue