Skip to content

Commit

Permalink
Add additional Help-menu options
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jan 11, 2024
1 parent b5b3421 commit f2e3766
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
19 changes: 17 additions & 2 deletions src/editor/main_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ void OrchestratorMainView::_notification(int p_what)
_help_menu->set_v_size_flags(SIZE_SHRINK_BEGIN);
_help_menu->set_text("Help");
_help_menu->get_popup()->clear();
_help_menu->get_popup()->add_icon_item(SceneUtils::get_icon(this, "ExternalLink"), "Online Documentation", AccelMenuIds::ONLINE_DOCUMENTATION);
_help_menu->get_popup()->add_icon_item(SceneUtils::get_icon(this, "ExternalLink"), "Community", AccelMenuIds::COMMUNITY);
_help_menu->get_popup()->add_separator();
_help_menu->get_popup()->add_icon_item(SceneUtils::get_icon(this, "ExternalLink"), "Report a Bug", AccelMenuIds::GITHUB_ISSUES);
_help_menu->get_popup()->add_icon_item(SceneUtils::get_icon(this, "ExternalLink"), "Suggest a Feature", AccelMenuIds::GITHUB_FEATURE);
_help_menu->get_popup()->add_separator();
_help_menu->get_popup()->add_item("About " VERSION_NAME, AccelMenuIds::ABOUT);
_help_menu->get_popup()->add_icon_item(SceneUtils::get_icon(this, "Heart"), "Support " VERSION_NAME, AccelMenuIds::SUPPORT);
_help_menu->get_popup()->connect("id_pressed", callable_mp(this, &OrchestratorMainView::_on_menu_option));
left_menu_container->add_child(_help_menu);

Expand All @@ -152,8 +159,6 @@ void OrchestratorMainView::_notification(int p_what)
open_documentation->connect(
"pressed",
callable_mp(this, &OrchestratorMainView::_on_menu_option).bind(AccelMenuIds::ONLINE_DOCUMENTATION));
// Temporarily hidden until docs are updated for stable builds
open_documentation->set_visible(false);
right_menu_container->add_child(open_documentation);

VSeparator* vs = memnew(VSeparator);
Expand Down Expand Up @@ -638,6 +643,16 @@ void OrchestratorMainView::_on_menu_option(int p_option)
case ONLINE_DOCUMENTATION:
OS::get_singleton()->shell_open(_plugin->get_plugin_online_documentation_url());
break;
case COMMUNITY:
OS::get_singleton()->shell_open(_plugin->get_community_url());
break;
case GITHUB_ISSUES:
case GITHUB_FEATURE:
OS::get_singleton()->shell_open(_plugin->get_github_issues_url());
break;
case SUPPORT:
OS::get_singleton()->shell_open(_plugin->get_patreon_url());
break;
case ABOUT:
_about_window->popup_centered(Size2(780, 500));
break;
Expand Down
6 changes: 5 additions & 1 deletion src/editor/main_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ class OrchestratorMainView : public Control
TOGGLE_LEFT_PANEL,
GOTO_NODE,
ABOUT,
ONLINE_DOCUMENTATION
ONLINE_DOCUMENTATION,
COMMUNITY,
GITHUB_ISSUES,
GITHUB_FEATURE,
SUPPORT
};

//! Simple struct for managing details about a script file
Expand Down
10 changes: 10 additions & 0 deletions src/plugin/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,21 @@ String OrchestratorPlugin::get_github_release_url() const
return VERSION_RELEASES_URL;
}

String OrchestratorPlugin::get_github_issues_url() const
{
return "https://github.com/Vahera/godot-orchestrator/issues/new/choose";
}

String OrchestratorPlugin::get_patreon_url() const
{
return "https://patreon.com/vahera";
}

String OrchestratorPlugin::get_community_url() const
{
return "https://discord.gg/J3UWtzWSkT";
}

String OrchestratorPlugin::get_plugin_version() const
{
return VERSION_NUMBER;
Expand Down
2 changes: 2 additions & 0 deletions src/plugin/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class OrchestratorPlugin : public EditorPlugin
String get_plugin_online_documentation_url() const;

String get_github_release_url() const;
String get_github_issues_url() const;
String get_patreon_url() const;
String get_community_url() const;

//~ Begin EditorPlugin interface
String get_plugin_version() const;
Expand Down

0 comments on commit f2e3766

Please sign in to comment.