aboutsummaryrefslogtreecommitdiff
path: root/libs/basic_games_native/src/basicgamesproxy.cpp
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-12 07:08:09 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-12 07:08:09 -0500
commit755698f1adceef55f52c8e44c9746537885c9bf7 (patch)
tree23d1a9fea936805708eeccf2ac2684620565d328 /libs/basic_games_native/src/basicgamesproxy.cpp
parent019870ffd8308d94289d72d45abeb3db39ccde92 (diff)
Replace Python plugins with native C++ .so, remove bundled Python (~95MB)
- Add native plugins: form43_checker, script_extender_checker, preview_dds, basic_games (75 game defs via IPluginProxy pattern with Steam/GOG detection) - Remove portable Python from Dockerfile and build-inner.sh - Add Python settings tab with venv support (system python3 + PyQt6) - Skip loading plugin_python.so when Python disabled (default: off) - Update pythonrunner.cpp to use venv at ~/.local/share/fluorine/python-venv/ - Preserve real file permissions in FUSE VFS (fixes native executable +x bits) - Add FUSE_SET_ATTR_MODE handler so chmod works through VFS - Fix desktop shortcut Exec= to use fluorine-manager launcher, not bare binary Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/basic_games_native/src/basicgamesproxy.cpp')
-rw-r--r--libs/basic_games_native/src/basicgamesproxy.cpp99
1 files changed, 99 insertions, 0 deletions
diff --git a/libs/basic_games_native/src/basicgamesproxy.cpp b/libs/basic_games_native/src/basicgamesproxy.cpp
new file mode 100644
index 0000000..f7efefd
--- /dev/null
+++ b/libs/basic_games_native/src/basicgamesproxy.cpp
@@ -0,0 +1,99 @@
+#include "basicgamesproxy.h"
+#include "basicgameplugin.h"
+#include "gamedefs.h"
+
+#include <uibase/versioninfo.h>
+
+BasicGamesProxy::BasicGamesProxy() {}
+
+BasicGamesProxy::~BasicGamesProxy()
+{
+ // Clean up all loaded plugins
+ for (auto& list : m_loaded) {
+ qDeleteAll(list);
+ }
+ m_loaded.clear();
+}
+
+bool BasicGamesProxy::init(MOBase::IOrganizer* organizer)
+{
+ m_organizer = organizer;
+ return true;
+}
+
+QString BasicGamesProxy::name() const
+{
+ return "Basic Games Native";
+}
+
+QString BasicGamesProxy::author() const
+{
+ return "Fluorine Manager";
+}
+
+QString BasicGamesProxy::description() const
+{
+ return "Native C++ implementation of basic game plugins";
+}
+
+MOBase::VersionInfo BasicGamesProxy::version() const
+{
+ return MOBase::VersionInfo(1, 0, 0);
+}
+
+QList<MOBase::PluginSetting> BasicGamesProxy::settings() const
+{
+ return {};
+}
+
+QStringList BasicGamesProxy::pluginList(const QDir&) const
+{
+ QStringList list;
+ const auto& defs = allGameDefinitions();
+ for (size_t i = 0; i < defs.size(); ++i) {
+ list.append(QString("native_game_%1").arg(i));
+ }
+ return list;
+}
+
+QList<QObject*> BasicGamesProxy::load(const QString& identifier)
+{
+ // Already loaded?
+ auto it = m_loaded.find(identifier);
+ if (it != m_loaded.end()) {
+ return it.value();
+ }
+
+ QList<QObject*> plugins;
+
+ // Parse the index from the identifier
+ if (!identifier.startsWith("native_game_"))
+ return plugins;
+
+ bool ok = false;
+ int index = identifier.mid(12).toInt(&ok);
+ if (!ok)
+ return plugins;
+
+ const auto& defs = allGameDefinitions();
+ if (index < 0 || index >= static_cast<int>(defs.size()))
+ return plugins;
+
+ auto* plugin = new BasicGamePlugin(defs[index]);
+ if (m_organizer) {
+ plugin->init(m_organizer);
+ }
+ plugins.append(plugin);
+
+ m_loaded.insert(identifier, plugins);
+ return plugins;
+}
+
+void BasicGamesProxy::unload(const QString& identifier)
+{
+ auto it = m_loaded.find(identifier);
+ if (it != m_loaded.end()) {
+ qDeleteAll(it.value());
+ m_loaded.erase(it);
+ }
+}