From 755698f1adceef55f52c8e44c9746537885c9bf7 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Thu, 12 Mar 2026 07:08:09 -0500 Subject: 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 --- libs/basic_games_native/src/basicgamesproxy.cpp | 99 +++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 libs/basic_games_native/src/basicgamesproxy.cpp (limited to 'libs/basic_games_native/src/basicgamesproxy.cpp') 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 + +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 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 BasicGamesProxy::load(const QString& identifier) +{ + // Already loaded? + auto it = m_loaded.find(identifier); + if (it != m_loaded.end()) { + return it.value(); + } + + QList 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(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); + } +} -- cgit v1.3.1