Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set project name #490

Merged
merged 33 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0aa41f6
Merge pull request #1 from Orama-Interactive/master
Variable-ind Jan 26, 2021
2c502db
Merge pull request #2 from Orama-Interactive/master
Variable-ind Jan 26, 2021
63c5ea2
Merge pull request #5 from Orama-Interactive/master
Variable-ind Jan 29, 2021
dc4278d
Merge pull request #7 from Orama-Interactive/master
Variable-ind Feb 3, 2021
6b824f6
Merge pull request #8 from Orama-Interactive/master
Variable-ind Feb 4, 2021
5d74449
fixed some more bugs
Variable-ind Feb 5, 2021
925d3c9
Removed some more bugs
Variable-ind Feb 5, 2021
5d0dda6
Added "Replace Frame" option
Variable-ind Feb 5, 2021
81e0583
Update PreviewDialog.tscn
Variable-ind Feb 5, 2021
04d7316
Update PreviewDialog.gd
Variable-ind Feb 5, 2021
563bb43
Update OpenSave.gd
Variable-ind Feb 5, 2021
c03122c
Merge pull request #9 from Orama-Interactive/master
Variable-ind Feb 6, 2021
4cc7c88
Added some new pixel fonts
Variable-ind Feb 7, 2021
f8ac82e
Merge pull request #10 from Orama-Interactive/master
Variable-ind Feb 9, 2021
d1d0a1e
updating (#12)
Variable-ind May 4, 2021
77e559f
Merge pull request #13 from Orama-Interactive/master
Variable-ind May 4, 2021
90cbee1
Merge pull request #14 from Orama-Interactive/master
Variable-ind May 5, 2021
62331c8
Merge pull request #15 from Orama-Interactive/master
Variable-ind May 10, 2021
c178e9e
removed unneeded fonts
Variable-ind May 10, 2021
6fdaad9
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 11, 2021
ae6a284
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 13, 2021
a26cf59
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 13, 2021
0df974d
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 14, 2021
d1b67e0
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 16, 2021
fbbbccb
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 18, 2021
878b077
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 21, 2021
d4b4cf0
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 22, 2021
a349460
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 22, 2021
281a7ce
Merge branch 'Orama-Interactive:master' into master
Variable-ind May 24, 2021
15e7685
Set project name. Also fixed a bug
Variable-ind May 24, 2021
916be5b
Add files via upload
Variable-ind May 24, 2021
5c50f0c
Adjust save name to project name
Variable-ind May 24, 2021
714640d
Add files via upload
Variable-ind May 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/UI/Dialogs/CreateNewImage.gd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ func _on_CreateNewImage_confirmed() -> void:
Global.canvas.fill_color = fill_color

var frame : Frame = Global.canvas.new_empty_frame(false, true, Vector2(width, height))
var new_project := Project.new([frame], tr("untitled"), Vector2(width, height).floor())
var new_project : Project
var proj_name :String = $VBoxContainer/ProjectName/NameInput.text
if proj_name.is_valid_filename():
new_project = Project.new([frame], tr(proj_name), Vector2(width, height).floor())
else:
# an empty field or non valid name...
new_project = Project.new([frame], tr("untitled"), Vector2(width, height).floor())
new_project.layers.append(Layer.new())
Global.projects.append(new_project)
Global.tabs.current_tab = Global.tabs.get_tab_count() - 1
Expand Down Expand Up @@ -131,12 +137,21 @@ func toggle_size_buttons() -> void:


func _on_TemplatesOptions_item_selected(id : int) -> void:
#if a template is chosen while "ratio button" is pressed then temporarily release it
var temporary_release = false
if ratio_box.pressed:
ratio_box.pressed = false
temporary_release = true

if id > 0:
width_value.value = templates[id - 1].resolution.x
height_value.value = templates[id - 1].resolution.y
else:
width_value.value = Global.default_image_width
height_value.value = Global.default_image_height

if temporary_release:
ratio_box.pressed = true


func _on_PortraitButton_toggled(button_pressed : bool) -> void:
Expand Down
50 changes: 35 additions & 15 deletions src/UI/Dialogs/CreateNewImage.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[ext_resource path="res://assets/graphics/dark_themes/misc/lock_aspect_guides.png" type="Texture" id=6]

[node name="CreateNewImage" type="ConfirmationDialog"]
margin_right = 300.0
margin_bottom = 200.0
rect_min_size = Vector2( 375, 200 )
margin_right = 375.0
margin_bottom = 222.0
rect_min_size = Vector2( 375, 222 )
window_title = "New..."
resizable = true
script = ExtResource( 1 )
Expand All @@ -22,26 +22,46 @@ __meta__ = {
margin_left = 8.0
margin_top = 8.0
margin_right = 367.0
margin_bottom = 164.0
margin_bottom = 186.0
size_flags_horizontal = 0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="ProjectName" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 359.0
margin_bottom = 24.0

[node name="NameLabel" type="Label" parent="VBoxContainer/ProjectName"]
margin_top = 5.0
margin_right = 100.0
margin_bottom = 19.0
rect_min_size = Vector2( 100, 0 )
text = "Project Name:"

[node name="NameInput" type="LineEdit" parent="VBoxContainer/ProjectName"]
margin_left = 104.0
margin_right = 359.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
placeholder_text = "Enter name... (Default \"untitled\")"

[node name="ImageSize" type="Label" parent="VBoxContainer"]
margin_top = 28.0
margin_right = 359.0
margin_bottom = 14.0
margin_bottom = 42.0
text = "Image Size"

[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 18.0
margin_top = 46.0
margin_right = 359.0
margin_bottom = 22.0
margin_bottom = 50.0

[node name="TemplatesContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 26.0
margin_top = 54.0
margin_right = 359.0
margin_bottom = 46.0
margin_bottom = 74.0

[node name="TemplatesLabel" type="Label" parent="VBoxContainer/TemplatesContainer"]
margin_top = 3.0
Expand All @@ -62,9 +82,9 @@ items = [ "Default", null, false, 0, null ]
selected = 0

[node name="SizeContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 50.0
margin_top = 78.0
margin_right = 359.0
margin_bottom = 102.0
margin_bottom = 130.0

[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/SizeContainer"]
margin_right = 346.0
Expand Down Expand Up @@ -141,9 +161,9 @@ __meta__ = {
}

[node name="SizeButtonsContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 106.0
margin_top = 134.0
margin_right = 359.0
margin_bottom = 126.0
margin_bottom = 154.0

[node name="PortraitButton" type="Button" parent="VBoxContainer/SizeButtonsContainer"]
margin_right = 20.0
Expand Down Expand Up @@ -193,9 +213,9 @@ __meta__ = {
}

[node name="FillColorContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 130.0
margin_top = 158.0
margin_right = 359.0
margin_bottom = 150.0
margin_bottom = 178.0

[node name="FillColorLabel" type="Label" parent="VBoxContainer/FillColorContainer"]
margin_top = 3.0
Expand Down
4 changes: 4 additions & 0 deletions src/UI/TopMenuContainer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ func save_project_file() -> void:
if path == "":
if OS.get_name() == "HTML5":
Global.save_sprites_html5_dialog.popup_centered()
Global.save_sprites_html5_dialog.get_node("FileNameContainer/FileNameLineEdit").text = Global.current_project.name
else:
Global.save_sprites_dialog.popup_centered()
Global.save_sprites_dialog.current_file = Global.current_project.name
Global.dialog_open(true)
else:
Global.control._on_SaveSprite_file_selected(path)
Expand All @@ -270,8 +272,10 @@ func save_project_file_as() -> void:
Global.control.is_quitting_on_save = false
if OS.get_name() == "HTML5":
Global.save_sprites_html5_dialog.popup_centered()
Global.save_sprites_html5_dialog.get_node("FileNameContainer/FileNameLineEdit").text = Global.current_project.name
else:
Global.save_sprites_dialog.popup_centered()
Global.save_sprites_dialog.current_file = Global.current_project.name
Global.dialog_open(true)


Expand Down