1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

Add icons to some Help menu items, add a new "Support Pixelorama's Development" item and remove "Donate" from the About dialog

This commit is contained in:
Emmanouil Papadeas 2024-01-10 00:30:27 +02:00
parent 3dd288f32f
commit 72bec41e63
11 changed files with 172 additions and 28 deletions

View file

@ -970,6 +970,10 @@ msgstr ""
msgid "About Pixelorama"
msgstr ""
#. Found under the Help menu. When clicked, it opens the URL of Orama Interactive's patreon page.
msgid "Support Pixelorama's Development"
msgstr ""
msgid "Pixelorama - Pixelate your dreams!"
msgstr ""
@ -982,7 +986,8 @@ msgstr ""
msgid "Website"
msgstr ""
msgid "GitHub Repo"
#. Found in the About dialog. A button that, when you click it, it opens the URL of Pixelorama's source code.
msgid "Source Code"
msgstr ""
msgid "Donate"

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c7yvcxpiq8spa"
path="res://.godot/imported/icon_16x16.png-256ac70bddc974584d574bbbf4b41c7c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/icons/icon_16x16.png"
dest_files=["res://.godot/imported/icon_16x16.png-256ac70bddc974584d574bbbf4b41c7c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1 @@
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m5 9 5.5-5.5L8 1h7v7l-2.5-2.5L7 11zm7 6H4a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h2a1 1 0 0 1 0 2H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-2a1 1 0 0 1 2 0v2a3 3 0 0 1-3 3z" fill="#e0e0e0"/></svg>

After

Width:  |  Height:  |  Size: 286 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3v78ojo0pkfg"
path="res://.godot/imported/external_link.svg-4c5b7d811a70be6a780cd15f86677f9a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/misc/external_link.svg"
dest_files=["res://.godot/imported/external_link.svg-4c5b7d811a70be6a780cd15f86677f9a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1 @@
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.781 9.155C2.72 9.102 1 7.531 1 5.656 1 3.367 2.398 2 4.734 2 6.102 2 7.383 3.39 8 4c.617-.61 1.898-2 3.266-2C13.602 2 15 3.367 15 5.656c0 1.875-1.719 3.446-1.79 3.516l-4.866 4.687a.485.485 0 0 1-.688 0z" fill="#fc7f7f"/></svg>

After

Width:  |  Height:  |  Size: 322 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qqndfexvoxl1"
path="res://.godot/imported/heart.svg-69a32c8bb763f6140fb082aa8a95f07a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/misc/heart.svg"
dest_files=["res://.godot/imported/heart.svg-69a32c8bb763f6140fb082aa8a95f07a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -64,7 +64,13 @@ enum ImageMenu {
enum SelectMenu { SELECT_ALL, CLEAR_SELECTION, INVERT, TILE_MODE }
## Enumeration of items present in the Help Menu.
enum HelpMenu {
VIEW_SPLASH_SCREEN, ONLINE_DOCS, ISSUE_TRACKER, OPEN_LOGS_FOLDER, CHANGELOG, ABOUT_PIXELORAMA
VIEW_SPLASH_SCREEN,
ONLINE_DOCS,
ISSUE_TRACKER,
OPEN_LOGS_FOLDER,
CHANGELOG,
ABOUT_PIXELORAMA,
SUPPORT_PIXELORAMA
}
## The file used to save preferences that use [code]ProjectSettings.save_custom()[/code].

View file

@ -284,10 +284,6 @@ func _on_GitHub_pressed() -> void:
OS.shell_open("https://github.com/Orama-Interactive/Pixelorama")
func _on_Donate_pressed() -> void:
OS.shell_open("https://www.patreon.com/OramaInteractive")
func create_donors() -> void:
var donors_root := donors.create_item()
for donor in DONORS:

View file

@ -12,6 +12,7 @@ font = ExtResource("3_jqhhb")
font_size = 12
[node name="AboutDialog" type="Popup"]
position = Vector2i(0, 36)
size = Vector2i(700, 470)
unresizable = false
borderless = false
@ -54,18 +55,15 @@ layout_mode = 2
[node name="Website" type="Button" parent="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
text = "Website"
[node name="GitHub" type="Button" parent="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
text = "GitHub Repo"
[node name="Donate" type="Button" parent="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons"]
layout_mode = 2
mouse_default_cursor_shape = 2
text = "Donate"
text = "Source Code"
[node name="OramaLogo" type="TextureRect" parent="AboutUI/IconsButtons"]
layout_mode = 2
@ -159,6 +157,5 @@ label_settings = SubResource("LabelSettings_aewb6")
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="pressed" from="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons/Website" to="." method="_on_Website_pressed"]
[connection signal="pressed" from="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons/GitHub" to="." method="_on_GitHub_pressed"]
[connection signal="pressed" from="AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/LinkButtons/Donate" to="." method="_on_Donate_pressed"]
[connection signal="item_selected" from="AboutUI/Credits/Groups" to="." method="_on_Groups_item_selected"]
[connection signal="tab_changed" from="AboutUI/Credits/Licenses/LicenseTabs" to="." method="_on_LicenseTabs_tab_changed"]

View file

@ -1,6 +1,13 @@
extends Panel
const DOCS_URL := "https://www.oramainteractive.com/Pixelorama-Docs/"
const ISSUES_URL := "https://github.com/Orama-Interactive/Pixelorama/issues"
const SUPPORT_URL := "https://www.patreon.com/OramaInteractive"
# gdlint: ignore=max-line-length
const CHANGELOG_URL := "https://github.com/Orama-Interactive/Pixelorama/blob/master/CHANGELOG.md#v011---2023-06-13"
const EXTERNAL_LINK_ICON := preload("res://assets/graphics/misc/external_link.svg")
const PIXELORAMA_ICON := preload("res://assets/graphics/icons/icon_16x16.png")
const HEART_ICON := preload("res://assets/graphics/misc/heart.svg")
var recent_projects := []
var layouts := [
@ -326,33 +333,54 @@ func _setup_help_menu() -> void:
"Open Logs Folder": "open_logs_folder",
"Changelog": "changelog",
"About Pixelorama": "about_pixelorama",
"Support Pixelorama's Development": &"",
}
var i := 0
for item in help_menu_items:
_set_menu_shortcut(help_menu_items[item], help_menu, i, item)
var icon: Texture2D = null
if (
i == Global.HelpMenu.ONLINE_DOCS
or i == Global.HelpMenu.ISSUE_TRACKER
or i == Global.HelpMenu.CHANGELOG
):
icon = EXTERNAL_LINK_ICON
if i == Global.HelpMenu.ABOUT_PIXELORAMA:
icon = PIXELORAMA_ICON
elif i == Global.HelpMenu.SUPPORT_PIXELORAMA:
icon = HEART_ICON
_set_menu_shortcut(help_menu_items[item], help_menu, i, item, false, false, icon)
i += 1
help_menu.id_pressed.connect(help_menu_id_pressed)
func _set_menu_shortcut(
action: StringName, menu: PopupMenu, index: int, text: String, is_check := false, echo := false
action: StringName,
menu: PopupMenu,
index: int,
text: String,
is_check := false,
echo := false,
icon: Texture2D = null
) -> void:
if action.is_empty():
if is_check:
menu.add_item(text, index)
else:
menu.add_check_item(text, index)
return
var shortcut := Shortcut.new()
var event := InputEventAction.new()
event.action = action
shortcut.events.append(event)
if is_check:
menu.add_check_shortcut(shortcut, index)
else:
menu.add_item(text, index)
else:
menu.add_shortcut(shortcut, index, false, echo)
menu.set_item_text(index, text)
var shortcut := Shortcut.new()
var event := InputEventAction.new()
event.action = action
shortcut.events.append(event)
if is_check:
menu.add_check_shortcut(shortcut, index)
else:
menu.add_shortcut(shortcut, index, false, echo)
menu.set_item_text(index, text)
if is_instance_valid(icon):
menu.set_item_icon(index, icon)
func _handle_metadata(id: int, popup_menu: PopupMenu) -> void:
@ -740,9 +768,9 @@ func help_menu_id_pressed(id: int) -> void:
Global.HelpMenu.VIEW_SPLASH_SCREEN:
_popup_dialog(Global.control.get_node("Dialogs/SplashDialog"))
Global.HelpMenu.ONLINE_DOCS:
OS.shell_open("https://www.oramainteractive.com/Pixelorama-Docs/")
OS.shell_open(DOCS_URL)
Global.HelpMenu.ISSUE_TRACKER:
OS.shell_open("https://github.com/Orama-Interactive/Pixelorama/issues")
OS.shell_open(ISSUES_URL)
Global.HelpMenu.OPEN_LOGS_FOLDER:
var dir := DirAccess.open("user://logs")
dir.make_dir_recursive("user://logs") # In case someone deleted it
@ -751,5 +779,7 @@ func help_menu_id_pressed(id: int) -> void:
OS.shell_open(CHANGELOG_URL)
Global.HelpMenu.ABOUT_PIXELORAMA:
_popup_dialog(Global.control.get_node("Dialogs/AboutDialog"))
Global.HelpMenu.SUPPORT_PIXELORAMA:
OS.shell_open(SUPPORT_URL)
_:
_handle_metadata(id, help_menu)