New forge doesn't support older nwjs. Keeping old forge for old builds

This commit is contained in:
DazedAnon 2026-07-13 11:40:43 -05:00
parent 3645db1f57
commit 2b825a02f3
5 changed files with 2228 additions and 63 deletions

View file

@ -2395,10 +2395,11 @@ class WorkflowTab(QWidget):
self._pt_forge_hotkey_edit = QLineEdit("F10") self._pt_forge_hotkey_edit = QLineEdit("F10")
self._pt_forge_hotkey_edit.setFixedWidth(_PT_FIELD_W) self._pt_forge_hotkey_edit.setFixedWidth(_PT_FIELD_W)
self._pt_forge_hotkey_edit.setPlaceholderText("F10") self._pt_forge_hotkey_edit.setPlaceholderText("F8")
self._pt_forge_hotkey_edit.setToolTip( self._pt_forge_hotkey_edit.setToolTip(
"Key to open Forge (e.g. F10, F6, Ctrl+Shift+F).\n" "Key to open Forge (e.g. F8, F6, F10).\n"
"Under Wine/Linux, F10 is often stolen by the window menu - use F6/F8 instead.\n" "MV uses the legacy plugin; MZ uses the modern one.\n"
"Under Wine/Linux, F10 is often stolen by the window menu - prefer F8.\n"
"Click Apply to game after changing." "Click Apply to game after changing."
) )
hotkey_row.addWidget(self._pt_forge_hotkey_edit) hotkey_row.addWidget(self._pt_forge_hotkey_edit)

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,10 @@
"""Forge plugin build — install-time hotkey and UI scale injection. """Forge plugin build — install-time hotkey and UI scale injection.
Vanilla Forge_MV.js / Forge_MZ.js from len's repo stay untouched on disk. Vanilla Forge_MV.js / Forge_MZ.js stay untouched on disk.
Patches are applied in memory when installing or applying settings to a game. Patches are applied in memory when installing or applying settings to a game.
MV uses the pre-rewrite legacy plugin (old NW.js / Chrome ~65).
MZ uses the rewritten unified forge.js bundle.
""" """
from __future__ import annotations from __future__ import annotations

View file

@ -1,12 +1,18 @@
"""Download / update Forge plugins from len's upstream repo (gitgud.io). """Download / update Forge plugins from len's upstream repo (gitgud.io).
Upstream: https://gitgud.io/zero64801/forge-mvmz Upstream: https://gitgud.io/zero64801/forge-mvmz
CI builds a unified forge.js plugin (master branch artifacts). CI builds a unified forge.js plugin (master branch artifacts) for MZ.
RPG Maker MV ships with NW.js / Chrome ~65, which cannot run the rewritten
Svelte Forge bundle. MV therefore keeps the pre-rewrite legacy plugin
(``Forge_MV.js`` / ``upstream/Forge_MV.js`` / ``legacy/Forge_MV.js``).
Offline copies: util/forge/upstream/ Offline copies: util/forge/upstream/
Active plugins: util/forge/Forge_MZ.js, util/forge/Forge_MV.js Active plugins: util/forge/Forge_MZ.js (modern), util/forge/Forge_MV.js (legacy)
End users receive curated copies shipped with DazedMTLTool updates. End users receive curated copies shipped with DazedMTLTool updates.
Upstream fetches are maintainer-only (``--refresh-offline`` or ``--force``). Upstream fetches are maintainer-only (``--refresh-offline`` or ``--force``)
and only refresh the MZ modern plugin.
""" """
from __future__ import annotations from __future__ import annotations
@ -120,12 +126,11 @@ def _fetch_plugins(log_fn) -> bytes:
return _download_bytes(_artifact_url("forge.js")) return _download_bytes(_artifact_url("forge.js"))
def _install_plugin_bytes(data: bytes) -> None: def _install_modern_mz_bytes(data: bytes) -> None:
"""Write forge.js into both engine plugin paths and the offline bundle.""" """Write modern forge.js into MZ active + offline paths only (never MV)."""
UPSTREAM_DIR.mkdir(parents=True, exist_ok=True) UPSTREAM_DIR.mkdir(parents=True, exist_ok=True)
for engine in PLUGIN_BY_ENGINE: bundled_plugin_path("MZ").write_bytes(data)
bundled_plugin_path(engine).write_bytes(data) upstream_plugin_path("MZ").write_bytes(data)
upstream_plugin_path(engine).write_bytes(data)
def _download_bytes(url: str) -> bytes: def _download_bytes(url: str) -> bytes:
@ -135,7 +140,7 @@ def _download_bytes(url: str) -> bytes:
def refresh_forge_plugins(log_fn=print) -> bool: def refresh_forge_plugins(log_fn=print) -> bool:
"""Download len's latest forge.js and install Forge_MV/MZ copies.""" """Download len's latest forge.js and refresh the MZ modern plugin only."""
try: try:
commit = _upstream_commit() commit = _upstream_commit()
except Exception as exc: except Exception as exc:
@ -152,13 +157,17 @@ def refresh_forge_plugins(log_fn=print) -> bool:
_log("ERROR: forge.js download did not look like a plugin file.", log_fn) _log("ERROR: forge.js download did not look like a plugin file.", log_fn)
return False return False
_install_plugin_bytes(data) _install_modern_mz_bytes(data)
versions = _load_versions() versions = _load_versions()
versions["commit"] = commit versions["commit"] = commit
versions["branch"] = FORGE_BRANCH versions["branch"] = FORGE_BRANCH
_save_versions(versions) _save_versions(versions)
_log(f"Forge plugins updated ({commit[:12]})", log_fn) _log(
f"Forge MZ plugin updated ({commit[:12]}). "
"MV keeps the legacy Chrome-65-compatible plugin.",
log_fn,
)
return True return True

File diff suppressed because one or more lines are too long