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

Get rid of TuxFamily #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Don't have Flatpak? Just download the [latest release](https://github.com/MakovW

- **Sleek & Native**: Dive into the elegance of the native Godot theme, seamlessly integrated into Godots. Get ready to be awed by the fluid aesthetics that keep you engaged.

- **Remote Editors Unleashed**: Experience the ultimate convenience of the Remote Editors feature. Seamlessly download Godot versions from the legendary [tuxfamily.org](https://downloads.tuxfamily.org/godotengine/) and take control of your creative arsenal.
- **Remote Editors Unleashed**: Experience the ultimate convenience of the Remote Editors feature. Seamlessly download Godot versions from the official [GitHub Releases](https://github.com/godotengine/godot/releases) and take control of your creative arsenal.

- **Project Mastery**: Manage projects with unparalleled finesse. Godots empowers you to embrace almost every feature available in the original Godot Project Manager App. Plus, there's a special twist—bind a downloaded editor to your project, unlocking the potential to run and edit it within a bound scope.

Expand Down
34 changes: 8 additions & 26 deletions src/components/editors/remote/remote_editors.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ extends Control
signal installed(name, abs_path)

const MIRROR_GITHUB_ID = 0
const MIRROR_TUX_FAMILY_ID = 1
const MIRROR_DEFAULT = MIRROR_GITHUB_ID

const uuid = preload("res://addons/uuid.gd")
Expand All @@ -16,16 +15,12 @@ const uuid = preload("res://addons/uuid.gd")
@onready var _direct_link_button: Button = %DirectLinkButton
@onready var _refresh_button: Button = %RefreshButton
@onready var _remote_editors_tree = %RemoteEditorsTree
@onready var _tree_mirror_button: = %TreeMirrorButton as OptionButton

var _editor_downloads
var _tree_mirrors = {}
var _mirror
var _active_mirror_cache = Cache.smart_value(
self, "active_mirror", true
).map_return_value(func(v):
if not v in _tree_mirrors:
return MIRROR_DEFAULT
else:
return v
)

Expand All @@ -35,24 +30,12 @@ func init(editor_downloads):


func _ready():
_tree_mirrors[MIRROR_GITHUB_ID] = RemoteEditorsTreeDataSourceGithub.Self.new(
RemoteEditorsTreeDataSource.RemoteAssetsCallable.new(download_zip)
)
_tree_mirrors[MIRROR_TUX_FAMILY_ID] = RemoteEditorsTreeDataSourceTuxFamily.Self.new(
_mirror = RemoteEditorsTreeDataSourceGithub.Self.new(
RemoteEditorsTreeDataSource.RemoteAssetsCallable.new(download_zip)
)

_tree_mirror_button.add_item("GitHub", MIRROR_GITHUB_ID)
_tree_mirror_button.add_item("TuxFamily", MIRROR_TUX_FAMILY_ID)
_tree_mirror_button.selected = _tree_mirror_button.get_item_index(
_active_mirror_cache.ret(MIRROR_DEFAULT)
)
_tree_mirror_button.item_selected.connect(func(item_idx):
var item_id = _tree_mirror_button.get_item_id(item_idx)
if item_id in _tree_mirrors:
_remote_editors_tree.set_data_source(_tree_mirrors[item_id])
_active_mirror_cache.put(item_id)
)

_remote_editors_tree.set_data_source(_mirror)
_active_mirror_cache.put(MIRROR_DEFAULT)

_open_downloads_button.pressed.connect(func():
OS.shell_show_in_file_manager(ProjectSettings.globalize_path(Config.DOWNLOADS_PATH.ret()))
Expand All @@ -74,8 +57,7 @@ func _ready():
_refresh_button.tooltip_text = tr("Refresh")
#_refresh_button.self_modulate = Color(1, 1, 1, 0.6)
_remote_editors_tree.post_ready(_refresh_button)
var cached_mirror_id = _active_mirror_cache.ret(MIRROR_DEFAULT)
_remote_editors_tree.set_data_source(_tree_mirrors[cached_mirror_id])
_remote_editors_tree.set_data_source(_mirror)


func download_zip(url, file_name):
Expand Down Expand Up @@ -114,8 +96,8 @@ func install_zip(zip_abs_path, root_unzip_folder_name, possible_editor_name, on_
var editor_install = _editor_install_scene.instantiate()
add_child(editor_install)
editor_install.init(possible_editor_name, zip_content_dir)
editor_install.installed.connect(func(name, exec_path):
installed.emit(name, ProjectSettings.globalize_path(exec_path))
editor_install.installed.connect(func(p_name, exec_path):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is a reserved variable from Node, therefore I changed it to avoid conflicts.

installed.emit(p_name, ProjectSettings.globalize_path(exec_path))
if on_install:
on_install.call()
)
Expand Down
5 changes: 0 additions & 5 deletions src/components/editors/remote/remote_editors.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ unique_name_in_owner = true
layout_mode = 2
text = "Direct Link"

[node name="TreeMirrorButton" type="OptionButton" parent="VBoxContainer/TopActions"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 10

[node name="RefreshButton" type="Button" parent="VBoxContainer/TopActions"]
unique_name_in_owner = true
layout_mode = 2
Expand Down

This file was deleted.