-
Notifications
You must be signed in to change notification settings - Fork 9
add exports to uninstall plugin #49
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
Open
ezio416
wants to merge
5
commits into
openplanet-nl:master
Choose a base branch
from
ezio416:dev-exports
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c8d3899
add export to uninstall plugin
ezio416 94da3e9
clean up a little
ezio416 364dcb4
add synchronous uninstall function
ezio416 f7f9a23
remove async export, add comment, use tabs
ezio416 7558b32
move export code to new file
ezio416 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ essential = true | |
|
|
||
| [script] | ||
| dependencies = [ "Controls" ] | ||
| exports = [ "src/Export.as" ] | ||
| timeout = 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| namespace PluginManager | ||
| { | ||
| /* | ||
| Queues a plugin for deletion. Note that this will invalidate the plugin object | ||
| passed in on the next frame! Do not use the Plugin handle after calling this! | ||
| */ | ||
| import void PluginUninstall(Meta::Plugin@ plugin) from "PluginManager"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| namespace PluginManager | ||
| { | ||
| void PluginUninstall(Meta::Plugin@ plugin) | ||
| { | ||
| startnew(PluginUninstallAsync, plugin); | ||
| } | ||
|
|
||
| void PluginUninstallAsync(ref@ metaPlugin) | ||
| { | ||
| auto plugin = cast<Meta::Plugin>(metaPlugin); | ||
| if (plugin is null) { | ||
| error("tried to uninstall a plugin but it was null!"); | ||
| return; | ||
| } | ||
|
|
||
| // Grab ID now since handle will be invalid after uninstalling | ||
| const string id = plugin.ID; | ||
|
|
||
| ::PluginUninstallAsync(metaPlugin); | ||
| @metaPlugin = null; | ||
| @plugin = null; | ||
|
|
||
| // Make sure plugin tab (if open) updates correctly | ||
| for (int i = g_window.m_tabs.Length - 1; i >= 0; i--) { | ||
| auto tab = cast<PluginTab>(g_window.m_tabs[i]); | ||
| if (tab !is null && tab.m_plugin !is null && tab.m_plugin.m_id == id) { | ||
| tab.m_plugin.CheckIfInstalled(); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.