|
14 | 14 | #include <uibase/iexecutable.h> |
15 | 15 | #include <uibase/iexecutableslist.h> |
16 | 16 | #include <uibase/iinstallationmanager.h> |
| 17 | +#include <uibase/iinstance.h> |
| 18 | +#include <uibase/iinstancemanager.h> |
17 | 19 | #include <uibase/imodinterface.h> |
18 | 20 | #include <uibase/imodrepositorybridge.h> |
19 | 21 | #include <uibase/imoinfo.h> |
@@ -644,6 +646,8 @@ namespace mo2::python { |
644 | 646 |
|
645 | 647 | .def("virtualFileTree", &IOrganizer::virtualFileTree) |
646 | 648 |
|
| 649 | + .def("instanceManager", &IOrganizer::instanceManager, |
| 650 | + py::return_value_policy::reference) |
647 | 651 | .def("downloadManager", &IOrganizer::downloadManager, |
648 | 652 | py::return_value_policy::reference) |
649 | 653 | .def("pluginList", &IOrganizer::pluginList, |
@@ -799,6 +803,42 @@ namespace mo2::python { |
799 | 803 | .def_static("getPluginDataPath", &IOrganizer::getPluginDataPath); |
800 | 804 | } |
801 | 805 |
|
| 806 | + void add_iinstance_manager_classes(py::module_ m) |
| 807 | + { |
| 808 | + py::class_<IInstance, std::shared_ptr<IInstance>>(m, "IInstance") |
| 809 | + .def("readFromIni", &IInstance::readFromIni) |
| 810 | + .def("displayName", &IInstance::displayName) |
| 811 | + .def("gameName", &IInstance::gameName) |
| 812 | + .def("gameDirectory", &IInstance::gameDirectory) |
| 813 | + .def("directory", &IInstance::directory) |
| 814 | + .def("baseDirectory", &IInstance::baseDirectory) |
| 815 | + .def("isPortable", &IInstance::isPortable) |
| 816 | + .def("profileName", &IInstance::profileName) |
| 817 | + .def("iniPath", &IInstance::iniPath); |
| 818 | + |
| 819 | + py::class_<IInstanceManager>(m, "IInstanceManager") |
| 820 | + .def("overrideInstance", &IInstanceManager::overrideInstance, |
| 821 | + "instance_name"_a) |
| 822 | + .def("overrideProfile", &IInstanceManager::overrideProfile, |
| 823 | + "profile_name"_a) |
| 824 | + .def("clearOverrides", &IInstanceManager::clearOverrides) |
| 825 | + .def("clearCurrentInstance", &IInstanceManager::clearCurrentInstance) |
| 826 | + .def("currentInstance", &IInstanceManager::currentInstance, |
| 827 | + py::return_value_policy::reference) |
| 828 | + .def("setCurrentInstance", &IInstanceManager::setCurrentInstance, |
| 829 | + "instance_name"_a) |
| 830 | + .def("allowedToChangeInstance", &IInstanceManager::allowedToChangeInstance) |
| 831 | + .def("portableInstanceExists", &IInstanceManager::portableInstanceExists) |
| 832 | + .def("portablePath", &IInstanceManager::portablePath) |
| 833 | + .def("globalInstancesRootPath", &IInstanceManager::globalInstancesRootPath) |
| 834 | + .def("globalInstancePaths", &IInstanceManager::globalInstancePaths) |
| 835 | + .def("globalInstanceExists", &IInstanceManager::globalInstanceExists, |
| 836 | + "instance_name"_a) |
| 837 | + .def("globalInstancePath", &IInstanceManager::globalInstancePath, |
| 838 | + "instance_name"_a) |
| 839 | + .def("iniPath", &IInstanceManager::iniPath, "instance_directory"_a); |
| 840 | + } |
| 841 | + |
802 | 842 | void add_idownload_manager_classes(py::module_ m) |
803 | 843 | { |
804 | 844 | py::class_<IDownloadManager>(m, "IDownloadManager") |
@@ -925,6 +965,7 @@ namespace mo2::python { |
925 | 965 |
|
926 | 966 | add_ipluginlist_classes(m); |
927 | 967 | add_imodlist_classes(m); |
| 968 | + add_iinstance_manager_classes(m); |
928 | 969 | add_idownload_manager_classes(m); |
929 | 970 | add_iinstallation_manager_classes(m); |
930 | 971 | add_iorganizer_classes(m); |
|
0 commit comments