Skip to content

Commit

Permalink
Refactor getting mod information (#899)
Browse files Browse the repository at this point in the history
Mod counterpart to the launcher PR.
Adds a struct containing mod information instead of getting every field with its own dedicated function
  • Loading branch information
Alystrasz authored Nov 21, 2024
1 parent c1649d1 commit e7aa1c2
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 280 deletions.
148 changes: 11 additions & 137 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,17 @@
"argTypes":""
},
{
"name":"NSIsModEnabled",
"name":"NSGetModsInformation",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
"returnTypeString":"array<ModInfo>",
"argTypes":""
},
{
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
},
{
"name":"NSIsModRemote",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSGetModDescriptionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModVersionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModDownloadLinkByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModLoadPriority",
"helpText":"",
"returnTypeString":"int",
"argTypes":"string modName"
},
{
"name":"NSIsModRequiredOnClient",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSGetModConvarsByModName",
"helpText":"",
"returnTypeString":"array<string>",
"argTypes":"string modName"
},
{
"name":"DecodeJSON",
"helpText":"converts a json string to a squirrel table",
Expand Down Expand Up @@ -260,60 +218,12 @@
"returnTypeString":"array<string>",
"argTypes":""
},
{
"name":"NSIsModEnabled",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
},
{
"name":"NSIsModRemote",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSGetModDescriptionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModVersionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModDownloadLinkByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModLoadPriority",
"helpText":"",
"returnTypeString":"int",
"argTypes":"string modName"
},
{
"name":"NSIsModRequiredOnClient",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSGetModConvarsByModName",
"helpText":"",
"returnTypeString":"array<string>",
"argTypes":"string modName"
},
{
"name":"DecodeJSON",
"helpText":"converts a json string to a squirrel table",
Expand Down Expand Up @@ -467,58 +377,22 @@
"argTypes":""
},
{
"name":"NSIsModEnabled",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
},
{
"name":"NSIsModRemote",
"name":"NSGetModsInformation",
"helpText":"",
"returnTypeString":"bool",
"argTypes":"string modName"
},
{
"name":"NSGetModDescriptionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModVersionByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModDownloadLinkByModName",
"helpText":"",
"returnTypeString":"string",
"argTypes":"string modName"
},
{
"name":"NSGetModLoadPriority",
"helpText":"",
"returnTypeString":"int",
"argTypes":"string modName"
"returnTypeString":"array<ModInfo>",
"argTypes":""
},
{
"name":"NSIsModRequiredOnClient",
"name":"NSGetModInformation",
"helpText":"",
"returnTypeString":"bool",
"returnTypeString":"array<ModInfo>",
"argTypes":"string modName"
},
{
"name":"NSGetModConvarsByModName",
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"array<string>",
"argTypes":"string modName"
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
},
{
"name": "NSFetchVerifiedModsManifesto",
Expand Down
13 changes: 13 additions & 0 deletions Northstar.Client/mod/scripts/vscripts/cl_northstar_client_init.nut
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ global struct UIPresenceStruct {
int gameState
}

global struct ModInfo
{
string name = ""
string description = ""
string version = ""
string downloadLink = ""
int loadPriority = 0
bool enabled = false
bool requiredOnClient = false
bool isRemote
array<string> conVars = []
}

global struct RequiredModInfo
{
string name
Expand Down
Loading

0 comments on commit e7aa1c2

Please sign in to comment.