mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Add game interfaces (#140)
- modDataDirectory defines mod directory that maps to 'Data' - getModMappings allows mapping directories to multiple locations
This commit is contained in:
@@ -55,6 +55,7 @@ namespace mo2::python {
|
||||
.def("gameIcon", &IPluginGame::gameIcon)
|
||||
.def("gameDirectory", &IPluginGame::gameDirectory)
|
||||
.def("dataDirectory", &IPluginGame::dataDirectory)
|
||||
.def("modDataDirectory", &IPluginGame::modDataDirectory)
|
||||
.def("secondaryDataDirectories", &IPluginGame::secondaryDataDirectories)
|
||||
.def("setGamePath", &IPluginGame::setGamePath, "path"_a)
|
||||
.def("documentsDirectory", &IPluginGame::documentsDirectory)
|
||||
@@ -82,7 +83,8 @@ namespace mo2::python {
|
||||
.def("looksValid", &IPluginGame::looksValid, "directory"_a)
|
||||
.def("gameVersion", &IPluginGame::gameVersion)
|
||||
.def("getLauncherName", &IPluginGame::getLauncherName)
|
||||
.def("getSupportURL", &IPluginGame::getSupportURL);
|
||||
.def("getSupportURL", &IPluginGame::getSupportURL)
|
||||
.def("getModMappings", &IPluginGame::getModMappings);
|
||||
}
|
||||
|
||||
// multiple installers
|
||||
|
||||
@@ -397,6 +397,10 @@ namespace mo2::python {
|
||||
{
|
||||
PYBIND11_OVERRIDE_PURE(QDir, IPluginGame, dataDirectory, );
|
||||
}
|
||||
QString modDataDirectory() const override
|
||||
{
|
||||
PYBIND11_OVERRIDE(QString, IPluginGame, modDataDirectory, );
|
||||
}
|
||||
QMap<QString, QDir> secondaryDataDirectories() const override
|
||||
{
|
||||
using string_dir_map = QMap<QString, QDir>;
|
||||
@@ -511,6 +515,11 @@ namespace mo2::python {
|
||||
{
|
||||
PYBIND11_OVERRIDE(QString, IPluginGame, getSupportURL, );
|
||||
}
|
||||
QMap<QString, QStringList> getModMappings() const override
|
||||
{
|
||||
using vfs_map = QMap<QString, QStringList>;
|
||||
PYBIND11_OVERRIDE(vfs_map, IPluginGame, getModMappings, );
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mo2::python
|
||||
|
||||
Reference in New Issue
Block a user