Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezyma committed Dec 11, 2021
1 parent 6dda1b3 commit 6206ecd
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 6 deletions.
45 changes: 44 additions & 1 deletion release/pluginfinder/pluginfinder/pluginfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,50 @@
# TODO: Search function to filter plugins by text
# TODO: Uninstall needs to check for pluginData[plugin]["Data"] and remove those files/folders as well, if any exist.
# TODO: Restart Mod Organizer if a plugin has been installed.
# TODO: Fix issue with downloaded mods not getting deleted.
# TODO: Add install for translation files as well.
# TODO: Update data schema
#[
# {
# "PluginID": "someid",
# "ManifestUrl": "url.to.github.manifest.file"
# },
# {
# "PluginID": "someid",
# "ManifestUrl": "url.to.github.manifest.file"
# }
#]
#{
# "Name": "plugin name",
# "Author": "plugin author",
# "Description": "plugin description",
# "NexusUrl": "nexus url",
# "GithubUrl": "github url",
# "Download": "url.to.download.zip.for.plugin",
# "InstallPaths": [ "path/to/plugin/files/or/folders" ],
# "DataPaths": [ "path/to/plugin/data/files/or/folders" ],
# "TranslationPaths": [ "path/to/translation/files/to/install"],
# "Versions": [
# {
# "Version": "versionnum",
# "SupportsMin": "minMOversion",
# "SupportsMax": "maxMOversion",
# "Download": "url.to.download.zip.for.plugin",
# "InstallPaths": [ "path/to/plugin/files/or/folders" ],
# "DataPaths": [ "path/to/plugin/data/files/or/folders" ],
# "TranslationPaths": [ "path/to/translation/files/to/install"]
# }
# ]
#}

# Update PF to download a json file containing names and links to each plugin's manifest json file
# Retrieve the plugin manifest json only for plugins on the current page.
# Add paging system in place of the scrollbar.
# Add a search box at the top that filters based on the name in the central json file.
# Actually delete files in the DataFiles field on uninstall.
# Add a versions field with an array of information on version support, use this if it exists, then fallback to the default values and get the version the hacky way.
# Add localeFiles field with an array of files to be installed and uninstalled from localisations.
# Add version checking to see if plugins need updating and display current + new version.
# Restart ModOrganizer when PF is closed after a plugin was installed or uninstalled.

class PluginFinder():

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{
"Id": "pluginfinder",
"Name": "Plugin Finder",
"Description": "A plugin for finding an installing other Mod Organizer plugins.",
"Description": "Plugin Finder allows you to browse a list of Mod Organizer plugins as well as both installing and uninstalling them.",
"Author": "Kezyma",
"Nexus": "",
"Github": "https://github.com/Kezyma/ModOrganizer-Plugins",
Expand Down
32 changes: 32 additions & 0 deletions release/pluginfinder/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Plugin Finder
## v1.0.*

### Introduction
Plugin Finder allows you to browse a list of Mod Organizer plugins as well as both installing and uninstalling them.

### Installation
Copy the pluginfinder folder to Mod Organizer's plugins folder. If Mod Organizer is installed at `D:\MO\`, the plugins folder will be located at `D:\MO\plugins\`
Make sure that `__init__.py` is located at `D:\MO\plugins\pluginfinder\` and not directly copied into the plugins folder itself.

### Uninstallation
Delete the following folders from Mod Organizer, assuming Mod Organizer is installed at `D:\MO\`:
`D:\MO\plugins\pluginfinder\`
`D:\MO\plugins\data\pluginfinder\`

### Usage
A new item will appear in the tools menu of Mod Organizer. This will open up a list of plugins.

The Nexus and Github buttons open links to the relevant pages for the plugin.
The green download button will download and install the plugin to Mod Organizer.
The blue sync button will update download and reinstall the plugin to Mod Organizer.
The red minus button will uninstall the plugin from Mod Organizer.

After installing or uninstalling plugins, Mod Organizer must be restarted.

### Settings

#### enabled (default: true)
Determines whether the Plugin Finder plugin is enabled in Mod Organizer.

## Other Plugins
#### [Root Builder](https://www.nexusmods.com/skyrimspecialedition/mods/31720), [Reinstaller](https://www.nexusmods.com/skyrimspecialedition/mods/59292), [Shortcutter](https://www.nexusmods.com/skyrimspecialedition/mods/59827)
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ def display(self):
self.rebindUi()
self.setInitialSettings()


invalidCharacters = '|<>"?*:/\\'
def createShortcut(self):
profile = self.profileSelect.currentText()
app = self.appSelect.currentText()
label = self.nameText.text()
label = str(self.nameText.text())
for character in self.invalidCharacters:
label = str(label).replace(character, "")
icon = self.selectedIcon.text()
self.shortcutter.create(label, profile, app, self.shortcutter.paths.currentInstanceName(), icon)

Expand Down
2 changes: 1 addition & 1 deletion release/shortcutter/shortcutter/shortcutter_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class ShortcutterPlugin(SharedPlugin):

def __init__(self):
super().__init__("Shortcutter", "Shortcutter", mobase.VersionInfo(1,0,2, mobase.ReleaseType.ALPHA))
super().__init__("Shortcutter", "Shortcutter", mobase.VersionInfo(1,0,3, mobase.ReleaseType.ALPHA))

def init(self, organiser=mobase.IOrganizer):
self.shortcutter = Shortcutter(organiser)
Expand Down
22 changes: 22 additions & 0 deletions src/pluginfinder/plugin_directory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"Name": "Root Builder",
"Identifier": "rootbuilder",
"Manifest": ""
},
{
"Name": "Reinstaller",
"Identifier": "reinstaller",
"Manifest": ""
},
{
"Name": "Shortcutter",
"Identifier": "shortcutter",
"Manifest": ""
},
{
"Name": "Plugin Finder",
"Identifier": "pluginfinder",
"Manifest": ""
}
]
23 changes: 23 additions & 0 deletions src/rootbuilder/plugin_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Name": "Root Builder",
"Author": "Kezyma",
"Description": "Root Builder is a Mod Organizer 2 plugin that allows you to manage files in the base game folder, not just the Data folder.",
"NexusUrl": "https://www.nexusmods.com/skyrimspecialedition/mods/31720",
"GithubUrl": "https://github.com/Kezyma/ModOrganizer-Plugins",
"DownloadUrl": "https://github.com/Kezyma/ModOrganizer-Plugins/releases/download/Current/rootbuilder.zip",
"PluginPath": [ "rootbuilder" ],
"LocalePath": [ ],
"DataPath": [ "data/rootbuilder" ],
"Versions": [
{
"Version": "",
"Released": "",
"MinSupport": "",
"MaxSupport": "",
"DownloadUrl": "",
"PluginPath": [],
"LocalePath": [],
"DataPath": []
}
]
}
6 changes: 5 additions & 1 deletion src/shortcutter/plugins/shortcutter_tool_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ def display(self):
self.rebindUi()
self.setInitialSettings()


invalidCharacters = '|<>"?*:/\\'
def createShortcut(self):
profile = self.profileSelect.currentText()
app = self.appSelect.currentText()
label = self.nameText.text()
label = str(self.nameText.text())
for character in self.invalidCharacters:
label = str(label).replace(character, "")
icon = self.selectedIcon.text()
self.shortcutter.create(label, profile, app, self.shortcutter.paths.currentInstanceName(), icon)

Expand Down
2 changes: 1 addition & 1 deletion src/shortcutter/shortcutter_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class ShortcutterPlugin(SharedPlugin):

def __init__(self):
super().__init__("Shortcutter", "Shortcutter", mobase.VersionInfo(1,0,2, mobase.ReleaseType.ALPHA))
super().__init__("Shortcutter", "Shortcutter", mobase.VersionInfo(1,0,3, mobase.ReleaseType.ALPHA))

def init(self, organiser=mobase.IOrganizer):
self.shortcutter = Shortcutter(organiser)
Expand Down

0 comments on commit 6206ecd

Please sign in to comment.