Skip to content

Commit

Permalink
GH-658 Add version pick to plug-in updater subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 4, 2024
1 parent a513634 commit c594cf1
Show file tree
Hide file tree
Showing 8 changed files with 824 additions and 320 deletions.
3 changes: 2 additions & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ version_module_config = ""
version_year = 2023
version_website = "https://orchestrator.vahera.com"
version_docs_url = "https://docs.vahera.com/orchestrator"
version_releases_url = "https://api.github.com/repos/Vahera/godot-orchestrator/releases"
version_releases_url = "https://api.github.com/repos/Vahera/godot-orchestrator/releases"
version_manifests_url = "https://raw.githubusercontent.com/Vahera/godot-orchestrator/main/release_manifests.json"
13 changes: 13 additions & 0 deletions src/common/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ void OrchestratorSettings::remove_action_favorite(const String& p_action_name)
}
}

void OrchestratorSettings::set_notify_prerelease_builds(bool p_notify_about_prereleases)
{
ProjectSettings* ps = ProjectSettings::get_singleton();

const String key = "orchestrator/settings/notify_about_pre-releases";
if (!ps->has_setting(key))
return;

ps->set_setting(key, p_notify_about_prereleases);
ps->save();
}

void OrchestratorSettings::_register_deprecated_settings()
{
// Default settings (Orchestrator v1)
Expand All @@ -138,6 +150,7 @@ void OrchestratorSettings::_register_settings()
_settings.emplace_back(RESOURCE_SETTING("settings/default_type", "Object", "Node"));
_settings.emplace_back(SENUM_SETTING("settings/storage_format", "Text,Binary", "Text"));
_settings.emplace_back(SENUM_SETTING("settings/log_level", "FATAL,ERROR,WARN,INFO,DEBUG,TRACE", "INFO"));
_settings.emplace_back(BOOL_SETTING("settings/notify_about_pre-releases", true));

_settings.emplace_back(RANGE_SETTING("settings/runtime/max_call_stack", "256,1024,256", 1024));
_settings.emplace_back(INT_SETTING("settings/runtime/max_loop_iterations", 1000000));
Expand Down
8 changes: 8 additions & 0 deletions src/common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ class OrchestratorSettings : public Object
/// @param p_action_name the action category to be removed
void remove_action_favorite(const String& p_action_name);

/// Return whether to notify about pre-releases
/// @return true to notify about pre-releases, false otherwise
bool is_notify_about_prereleases() { return get_setting("settings/notify_about_pre-releases", true); }

/// Set whether to notify pre-release builds
/// @param p_notify_prerelease_builds true to notify about pre-releases, false for only stable releases
void set_notify_prerelease_builds(bool p_notify_prerelease_builds);

const std::vector<Setting>& get_settings() const { return _settings; }

private:
Expand Down
2 changes: 1 addition & 1 deletion src/editor/editor_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ void OrchestratorEditorPanel::_notification(int p_what)
version->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
right_menu->add_child(version);

_updater = memnew(OrchestratorUpdater);
_updater = memnew(OrchestratorUpdaterButton);
right_menu->add_child(_updater);

if (_window_wrapper->is_window_available())
Expand Down
4 changes: 2 additions & 2 deletions src/editor/editor_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class OrchestratorFileDialog;
class OrchestratorGettingStarted;
class OrchestratorGotoNodeDialog;
class OrchestratorScreenSelect;
class OrchestratorUpdater;
class OrchestratorUpdaterButton;
class OrchestratorWindowWrapper;
class OScript;

Expand Down Expand Up @@ -134,7 +134,7 @@ class OrchestratorEditorPanel : public PanelContainer
OrchestratorScreenSelect* _screen_select{ nullptr }; //! Window screen selector
OrchestratorWindowWrapper* _window_wrapper{ nullptr }; //! Window wrapper
OrchestratorGettingStarted* _getting_started{ nullptr }; //! Getting started landing
OrchestratorUpdater* _updater{ nullptr }; //! Updater
OrchestratorUpdaterButton* _updater{ nullptr }; //! Updater
Control* _select_separator{ nullptr }; //! Separator that is hidden based on float state
Control* _left_panel{ nullptr }; //! Togglable left panel
Container* _viewport_container{ nullptr }; //! Main viewport container
Expand Down
4 changes: 3 additions & 1 deletion src/editor/register_editor_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ void register_editor_types()
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorEditorViewport)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorScriptEditorViewport)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorGotoNodeDialog)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorUpdater)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorUpdaterButton)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorUpdaterVersionPicker)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorUpdaterReleaseNotesDialog)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorAboutDialog)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorScreenSelect)
ORCHESTRATOR_REGISTER_INTERNAL_CLASS(OrchestratorWindowWrapper)
Expand Down
Loading

0 comments on commit c594cf1

Please sign in to comment.