-
Notifications
You must be signed in to change notification settings - Fork 206
Convert X Rebirth to the Game Description Language #23536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
halgari
wants to merge
12
commits into
master
Choose a base branch
from
halgari/games-to-gdl-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+623
−2,343
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1652dd6
Convert X Rebirth extension to the Game Description Language
halgari a9e32b2
Address code review: build bootstrap, content.xml casing, test ordering
halgari e3f8eb1
Revert unneeded @gdl/runtime alias in vitest.config.ts
halgari 6f3628e
Remove the game-extension-test harness
halgari d62a16b
Enable GDL corpus testing for X Rebirth
halgari b5b7b28
xrebirth: add corpus syntheticContent; bump GDL submodule
halgari 88788eb
xrebirth: express stopPatterns as globs
halgari f6fe2ea
xrebirth: single source for stop patterns
halgari e28ce90
xrebirth: inline drop-in globs, drop stopPatterns
halgari 71f8de2
chore: bump game-description-language submodule to squashed HEAD
halgari 1023fde
chore: bump game-description-language submodule (rebased onto main)
halgari 1a4b9db
chore: track game-description-language main after PR #2 merge
halgari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ dist | |
| dist_custom | ||
| dist_portable | ||
| dist_web | ||
| .gdl-out | ||
| **/tests/cache | ||
| out | ||
| doc | ||
| coverage | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [submodule "game-description-language"] | ||
| path = game-description-language | ||
| url = https://github.com/Nexus-Mods/game-description-language.git | ||
| branch = main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| import * as path from "node:path"; | ||
|
|
||
| import { createConfig, bundle } from "../../../scripts/extensions-rolldown.mjs"; | ||
| import { buildGdlExtension } from "../../../scripts/build-gdl-extension.mjs"; | ||
|
|
||
| const extensionPath = path.resolve(import.meta.dirname); | ||
| const entryPoint = path.resolve(extensionPath, "src", "index.ts"); | ||
| const output = path.resolve(extensionPath, "dist", "index.cjs"); | ||
|
|
||
| const config = createConfig(entryPoint, output); | ||
| await bundle(config); | ||
| // This extension is described declaratively in game.yaml and compiled by the | ||
| // Game Description Language (GDL) toolchain (the game-description-language | ||
| // submodule) into a Vortex-loadable dist/index.js. The imperative bits | ||
| // (content.xml installer, health checks) live in src/hooks.ts. | ||
| await buildGdlExtension(path.resolve(import.meta.dirname)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| gdl: 1 | ||
| version: 1.0.1 | ||
|
|
||
| game: | ||
| id: xrebirth | ||
| name: X Rebirth | ||
| executable: XRebirth.exe | ||
| requiredFiles: [XRebirth.exe] | ||
| logo: gameart.webp | ||
| author: Black Tree Gaming Ltd. | ||
| nexusDomain: xrebirth | ||
| # All X Rebirth mods deploy under the game's `extensions` folder. | ||
| queryModPath: extensions | ||
|
|
||
| stores: | ||
| steam: "2870" | ||
|
|
||
| # Mod types are classification tags only: every type deploys to the same | ||
| # `extensions` folder (matching the original extension, which set modType tags | ||
| # but never gave them distinct paths). | ||
| modTypes: | ||
| - { id: xrebirth-savegame, name: "X Rebirth - savegame", path: "${installPath}/extensions" } | ||
| - { | ||
| id: xrebirth-shader-injector, | ||
| name: "X Rebirth - shader injector", | ||
| path: "${installPath}/extensions", | ||
| } | ||
| - { id: xrebirth-utility, name: "X Rebirth - utility", path: "${installPath}/extensions" } | ||
| - { id: xrebirth-dropin, name: "X Rebirth - drop-in", path: "${installPath}/extensions" } | ||
| - { id: xrebirth-save-patch, name: "X Rebirth - save patch", path: "${installPath}/extensions" } | ||
| - { | ||
| id: xrebirth-documentation, | ||
| name: "X Rebirth - documentation", | ||
| path: "${installPath}/extensions", | ||
| } | ||
|
|
||
| # Priority order (lower = tried first) mirrors the original PRIORITIES table. | ||
| installers: | ||
| # 50 - canonical content.xml mod: parses the XML and emits attribute | ||
| # instructions, so it runs through a custom install hook. | ||
| - id: content-xml | ||
| priority: 50 | ||
| when: { hasFile: "**/content.xml" } | ||
| install: { hook: installContentXml } | ||
|
|
||
| # 60 - save_NNN.xml / quicksave.xml at any depth (keep archive layout). | ||
| - id: savegame | ||
| priority: 60 | ||
| when: { matches: '(?i)(^|/)(quicksave|save_\d+)\.xml$' } | ||
| copy: { stripCommonRoot: false } | ||
| modType: xrebirth-savegame | ||
|
|
||
| # 65 - SweetFX / ReShade shader injector markers. | ||
| - id: shader-injector | ||
| priority: 65 | ||
| when: | ||
| any: | ||
| - { matches: '(?i)(^|/)d3d9\.dll$' } | ||
| - { matches: '(?i)(^|/)dxgi\.dll$' } | ||
| - { matches: '(?i)(^|/)d3d9\.ini$' } | ||
| - { matches: '(?i)(^|/)SweetFX([\\/]|_)' } | ||
| - { matches: "(?i)(^|/)reshade-shaders/" } | ||
| - { matches: "(?i)(^|/)ReShade/" } | ||
| copy: { stripCommonRoot: true } | ||
| modType: xrebirth-shader-injector | ||
|
|
||
| # 70 - any .exe present (standalone utility/tool). | ||
| - id: utility | ||
| priority: 70 | ||
| when: { extensions: { list: [".exe"], mode: any } } | ||
| copy: { stripCommonRoot: true } | ||
| modType: xrebirth-utility | ||
|
|
||
| # 75 - looks like an X Rebirth drop-in: loose game content (archives, game | ||
| # subfolders, audio/video/config) that deploys into extensions/ as-is. | ||
| - id: dropin | ||
| priority: 75 | ||
| when: | ||
| any: | ||
| - { hasFile: "**/*.cat" } | ||
| - { hasFile: "**/*.dat" } | ||
| - { hasFile: "**/*.cur" } | ||
| - { hasFile: "**/*.ini" } | ||
| - { hasFile: "**/*.{ogg,mp3,wav}" } | ||
| - { hasFile: "**/*.{mkv,mp4,webm}" } | ||
| - { hasFile: "**/t/*.xml" } | ||
| - { hasFile: "**/assets/**" } | ||
| - { hasFile: "**/libraries/**/*.xml" } | ||
| - { hasFile: "**/maps/**/*.xml" } | ||
| - { hasFile: "**/md/**/*.xml" } | ||
| - { hasFile: "**/cinematics/**" } | ||
| - { hasFile: "**/aiscripts/**/*.xml" } | ||
| - { hasFile: "**/voice-*/**/*.{ogg,wav}" } | ||
| - { hasFile: "**/ui/**" } | ||
| - { hasFile: "**/sfx/**" } | ||
| copy: { stripCommonRoot: true } | ||
| modType: xrebirth-dropin | ||
|
|
||
| # 80 - every file is .xml/.txt and at least one is .xml (XML-only save patch). | ||
| - id: save-patch | ||
| priority: 80 | ||
| when: | ||
| all: | ||
| - { extensions: { list: [".xml", ".txt"], mode: all } } | ||
| - { extensions: { list: [".xml"], mode: any } } | ||
| copy: { stripCommonRoot: false } | ||
| modType: xrebirth-save-patch | ||
|
|
||
| # 90 - pure documentation (every file is a doc extension). | ||
| - id: documentation | ||
| priority: 90 | ||
| when: | ||
| extensions: | ||
| list: | ||
| [ | ||
| ".pdf", | ||
| ".png", | ||
| ".jpg", | ||
| ".jpeg", | ||
| ".gif", | ||
| ".svg", | ||
| ".xlsx", | ||
| ".xls", | ||
| ".docx", | ||
| ".doc", | ||
| ".odt", | ||
| ".ods", | ||
| ".md", | ||
| ".rtf", | ||
| ] | ||
| mode: all | ||
| copy: { stripCommonRoot: true } | ||
| modType: xrebirth-documentation | ||
|
|
||
| # Corpus testing: run the installers against real X Rebirth mod manifests | ||
| # fetched from Nexus (`gdl test:corpus --fetch`). When the extension is built, | ||
| # the corpus drives the real installer chain (including the content.xml hook) | ||
| # and health checks; syntheticContent supplies the bytes the hook reads, since | ||
| # manifests carry only file lists. | ||
| tests: | ||
| corpus: nexus | ||
| syntheticContent: | ||
| content.xml: '<content id="mod-${manifestId}" name="Test ${manifestId}" version="1.0" author="harness"/>' | ||
|
|
||
| # In-game health checks (registered via context.registerHealthCheck). | ||
| diagnostics: | ||
| - hook: modHasFilesCheck | ||
| - hook: contentXmlCustomFileNameCheck | ||
| - hook: modShapeRecognisedCheck |
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update the
buildnx target config. I recommend adding a new default target to the rootnx.jsonfile:And adding
gdlto the build inputs: