Skip to content

Commit 5f0e8d4

Browse files
Add typed modloader variants to ecosystem-schema model
This is done so to better handle the mapping of modloader variants to specific package installers. We do so via enum as any modification of these variants will incur a compilation error that must be handled.
1 parent 41489e2 commit 5f0e8d4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/ts/v1/models/ecosystem.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,23 @@ pub struct GameDefR2MM {
123123
pub struct R2MMModLoaderPackage {
124124
pub package_id: String,
125125
pub root_folder: String,
126-
pub loader: String,
126+
pub loader: R2MLLoader,
127+
}
128+
129+
#[derive(Serialize, Deserialize, Debug, Clone)]
130+
#[serde(rename_all = "lowercase")]
131+
pub enum R2MLLoader {
132+
BepInEx,
133+
GDWeave,
134+
GodotML,
135+
Lovely,
136+
MelonLoader,
137+
Northstar,
138+
#[serde(rename = "recursive-melonloader")]
139+
RecursiveMelonLoader,
140+
#[serde(rename = "return-of-modding")]
141+
ReturnOfModding,
142+
Shimloader,
127143
}
128144

129145
#[derive(Serialize, Deserialize, Debug, Clone)]

0 commit comments

Comments
 (0)