diff --git a/owmods_gui/backend/src/gui_config.rs b/owmods_gui/backend/src/gui_config.rs index fccd54a6..9c02759d 100644 --- a/owmods_gui/backend/src/gui_config.rs +++ b/owmods_gui/backend/src/gui_config.rs @@ -12,7 +12,10 @@ pub enum Theme { Pink, Purple, Blurple, + OuterWildsOrange, GhostlyGreen, + NomaiBlue, + NomaiYellow, #[default] #[serde(other)] Green, diff --git a/owmods_gui/frontend/src/assets/translations/english.json b/owmods_gui/frontend/src/assets/translations/english.json index 46bd3936..a02ecc70 100644 --- a/owmods_gui/frontend/src/assets/translations/english.json +++ b/owmods_gui/frontend/src/assets/translations/english.json @@ -78,6 +78,8 @@ "MissingDLL": "Unable to find DLL file specified (\"$payload$\")", "MissingDep": "Missing dependency: $payload$", "NAME": "Name", + "NomaiBlue": "Nomai Blue", + "NomaiYellow": "Nomai Yellow", "NO_DOWNLOADS": "No Downloads", "NO_MODS": "No Mods Installed, Click \"Get Mods\" To Grab Some!", "NO_MODS_FROM_FILTER": "No Mods Found", @@ -88,6 +90,7 @@ "OPEN_README": "Show On Website", "OPEN_WEBSITE": "Browse Mods Website", "OUTDATED": "Outdated", + "OuterWildsOrange": "Outer Wilds Orange", "OWML_INSTALL_ERROR": "There was an error downloading OWML, please check your network connection and try again.", "OWML_NO_PRERELEASE": "There is no prerelease for OWML available", "OWML_PATH": "OWML Path", diff --git a/owmods_gui/frontend/src/assets/translations/template.json b/owmods_gui/frontend/src/assets/translations/template.json index 350b8f05..2fa1414f 100644 --- a/owmods_gui/frontend/src/assets/translations/template.json +++ b/owmods_gui/frontend/src/assets/translations/template.json @@ -78,6 +78,8 @@ "MissingDLL": "", "MissingDep": "", "NAME": "", + "NomaiBlue": "", + "NomaiYellow": "", "NO_DOWNLOADS": "", "NO_MODS": "", "NO_MODS_FROM_FILTER": "", @@ -88,6 +90,7 @@ "OPEN_README": "", "OPEN_WEBSITE": "", "OUTDATED": "", + "OuterWildsOrange": "", "OWML_INSTALL_ERROR": "", "OWML_NO_PRERELEASE": "", "OWML_PATH": "", diff --git a/owmods_gui/frontend/src/theme.ts b/owmods_gui/frontend/src/theme.ts index be4f4034..e9c63d43 100644 --- a/owmods_gui/frontend/src/theme.ts +++ b/owmods_gui/frontend/src/theme.ts @@ -93,6 +93,30 @@ const themeMap: Record = { secondary: { main: "#e4b3f4" } + }, + OuterWildsOrange: { + primary: { + main: "#ff7D25" + }, + secondary: { + main: "#17c0bb" + } + }, + NomaiBlue: { + primary: { + main: "#8793ff" + }, + secondary: { + main: "#999999" + } + }, + NomaiYellow: { + primary: { + main: "#fff592" + }, + secondary: { + main: "#996638" + } } }; diff --git a/owmods_gui/frontend/src/types.d.ts b/owmods_gui/frontend/src/types.d.ts index a0f19c01..f9dd1517 100644 --- a/owmods_gui/frontend/src/types.d.ts +++ b/owmods_gui/frontend/src/types.d.ts @@ -1,5 +1,5 @@ /* - Generated by typeshare 1.2.0 + Generated by typeshare 1.6.0 */ export type EmptyParams = undefined; @@ -20,95 +20,183 @@ export interface Alert { /** Represents the core config, contains critical info needed by the core API */ export interface Config { + /** The path to the OWML install, defaults to `~/.local/share/OuterWildsModManager/OWML` */ owmlPath: string; + /** The URL to the database */ databaseUrl: string; + /** The URL to fetch alerts from */ alertUrl: string; + /** The mod warnings that have been shown to the user */ viewedAlerts: string[]; } +/** Represents an error with a [LocalMod] */ +export type ModValidationError = + /** The mod's manifest was invalid, contains the error encountered when loading it */ + | { errorType: "InvalidManifest"; payload: string } + /** The mod is missing a dependency that needs to be installed, contains the unique name of the missing dep */ + | { errorType: "MissingDep"; payload: string } + /** A dependency of the mod is disabled, contains the unique name of the disabled dep */ + | { errorType: "DisabledDep"; payload: string } + /** There's another enabled mod that conflicts with this one, contains the conflicting mod */ + | { errorType: "ConflictingMod"; payload: string } + /** The DLL the mod specifies in its `manifest.json` doesn't exist, contains the path (if even present) to the DLL specified by the mod */ + | { errorType: "MissingDLL"; payload?: string } + /** There's another mod already in the DB with this mod's unique name, contains the path of the other mod that has the same unique name */ + | { errorType: "DuplicateMod"; payload: string } + /** The mod is outdated, contains the newest version */ + | { errorType: "Outdated"; payload: string }; + +/** Represents a warning a mod wants to show to the user on start */ +export interface ModWarning { + /** The title of the warning */ + title: string; + /** The body of the warning */ + body: string; +} + +/** Represents a manifest file for a local mod. */ +export interface ModManifest { + /** The unique name of the mod */ + uniqueName: string; + /** The name of the mod */ + name: string; + /** The author of the mod */ + author: string; + /** The version of the mod, usually in the format `major.minor.patch` */ + version: string; + /** The name of the DLL file to load when starting the mod */ + filename?: string; + /** The version of OWML this mod was built for */ + owmlVersion?: string; + /** The dependencies of the mod */ + dependencies?: string[]; + /** The mods this mod will conflict with */ + conflicts?: string[]; + /** The paths to preserve when updating the mod */ + pathsToPreserve?: string[]; + /** A warning the mod wants to show to the user on start */ + warning?: ModWarning; + /** An exe that runs before the game starts, a prepatcher. This is used for mods that need to patch the game before it starts */ + patcher?: string; +} + /** Represents an installed (and valid) mod */ export interface LocalMod { + /** Whether the mod is enabled */ enabled: boolean; + /** Any non-critical errors that occurred when loading the mod */ errors: ModValidationError[]; + /** The path to the mod */ modPath: string; + /** The manifest for the mod */ manifest: ModManifest; } /** Represents a mod that completely failed to load */ export interface FailedMod { + /** The error that caused the mod to fail to load */ error: ModValidationError; + /** The path to the mod */ modPath: string; + /** The path to the mod relative to the mods folder, this usually will match the unique name so it's good for display */ displayPath: string; } -/** Represents a manifest file for a local mod. */ -export interface ModManifest { - uniqueName: string; - name: string; - author: string; - version: string; - filename?: string; - owmlVersion?: string; - dependencies?: string[]; - conflicts?: string[]; - pathsToPreserve?: string[]; - warning?: ModWarning; - patcher?: string; -} - -/** Represents a warning a mod wants to show to the user on start */ -export interface ModWarning { - title: string; - body: string; -} - -/** Represents a mod in the remote database */ -export interface RemoteMod { - downloadUrl: string; - downloadCount: number; - version: string; - name: string; - uniqueName: string; - description: string; - readme?: ModReadMe; - slug: string; - required?: boolean; - repo: string; - author: string; - authorDisplay?: string; - parent?: string; - prerelease?: ModPrerelease; - alpha?: boolean; - tags?: string[]; -} - -/** A prerelease for a mod */ -export interface ModPrerelease { - downloadUrl: string; - version: string; -} - /** Contains URLs for a mod's README */ export interface ModReadMe { + /** The URL to the README in HTML format */ htmlUrl: string; + /** The URL to the README for download */ downloadUrl: string; } +/** A prerelease for a mod */ +export interface ModPrerelease { + /** The URL to download the prerelease from, always GitHub */ + downloadUrl: string; + /** The version of the prerelease, usually in the format `major.minor.patch` */ + version: string; +} + +/** Represents a mod in the remote database */ +export interface RemoteMod { + /** The URL to download the mod from, always GitHub */ + downloadUrl: string; + /** The number of times the mod has been downloaded, this uses GitHub releases */ + downloadCount: number; + /** The version of the mod, usually in the format `major.minor.patch` */ + version: string; + /** The name of the mod */ + name: string; + /** The unique name of the mod */ + uniqueName: string; + /** The description of the mod */ + description: string; + /** The mod's README file, if it has one */ + readme?: ModReadMe; + /** The slug of the mod, this is used for the URL on the website */ + slug: string; + /** Whether the mod is "required" this is an artifact of old manager as it treated OWML (and the manager itself) as a mod and required it to be installed */ + required?: boolean; + /** A link to the mod's repository on GitHub */ + repo: string; + /** The author of the mod, based on GitHub author name */ + author: string; + /** The display name of the author of the mod, manually set in the database */ + authorDisplay?: string; + /** The parent of the mod if this mod is an addon, e.g. NH */ + parent?: string; + /** The prerelease for the mod, if it has one */ + prerelease?: ModPrerelease; + /** Whether the mod is for the alpha version of the game, currently alpha support is not implemented */ + alpha?: boolean; + /** The tags for the mod, these are manually set in the database */ + tags?: string[]; +} + /** Represents the configuration for OWML */ export interface OWMLConfig { + /** The path to the game */ gamePath: string; debugMode: boolean; + /** Whether to launch the game directly */ forceExe: boolean; incrementalGC: boolean; + /** The path to OWML */ owmlPath?: string; + /** The port to use for sending logs to */ socketPort: number; } +/** + * Represents the type of message sent from the game + * + * See [the OWML docs](https://owml.outerwildsmods.com/mod_helper/console.html#WriteLine) for what the types mean. + */ +export enum SocketMessageType { + Message = "message", + Error = "error", + Warning = "warning", + Info = "info", + Success = "success", + Quit = "quit", + Fatal = "fatal", + Debug = "debug" +} + /** Represents a message sent from the game */ export interface SocketMessage { + /** The name of the sender, usually the name of the mod */ senderName?: string; + /** The type of the sender, usually ModHelper */ senderType?: string; + /** The message sent from the game */ message: string; + /** + * The type of message sent from the game + * Note that the message sent calls this `type` so we have to alias it because type is a reserved keyword + */ messageType: SocketMessageType; } @@ -123,6 +211,24 @@ export interface GameMessage { amount: number; } +export enum Language { + Wario = "Wario", + English = "English" +} + +export enum Theme { + Blue = "Blue", + Red = "Red", + Pink = "Pink", + Purple = "Purple", + Blurple = "Blurple", + OuterWildsOrange = "OuterWildsOrange", + GhostlyGreen = "GhostlyGreen", + NomaiBlue = "NomaiBlue", + NomaiYellow = "NomaiYellow", + Green = "Green" +} + export interface GuiConfig { language: Language; theme: Theme; @@ -158,6 +264,14 @@ export interface ProgressBars { counter: number; } +export enum ProtocolInstallType { + InstallMod = "installMod", + InstallURL = "installURL", + InstallPreRelease = "installPreRelease", + InstallZip = "installZip", + Unknown = "unknown" +} + /** * Represents a payload receive by a protocol handler (link from the website) * All URLs should start with owmods:// @@ -179,38 +293,11 @@ export interface ProtocolPayload { /** Represents a `LocalMod` that we aren't sure loaded successfully */ export type UnsafeLocalMod = + /** A mod was loaded successfully */ | { loadState: "valid"; mod: LocalMod } + /** A mod failed to load */ | { loadState: "invalid"; mod: FailedMod }; -/** Represents the type of message sent from the game */ -export enum SocketMessageType { - Message = "message", - Error = "error", - Warning = "warning", - Info = "info", - Success = "success", - Quit = "quit", - Fatal = "fatal", - Debug = "debug" -} - -/** Represents an error with a [LocalMod] */ -export type ModValidationError = - /** The mod's manifest was invalid, contains the error encountered when loading it */ - | { errorType: "InvalidManifest"; payload: string } - /** The mod is missing a dependency that needs to be installed, contains the unique name of the missing dep */ - | { errorType: "MissingDep"; payload: string } - /** A dependency of the mod is disabled, contains the unique name of the disabled dep */ - | { errorType: "DisabledDep"; payload: string } - /** There's another enabled mod that conflicts with this one, contains the conflicting mod */ - | { errorType: "ConflictingMod"; payload: string } - /** The DLL the mod specifies in its `manifest.json` doesn't exist, contains the path (if even present) to the DLL specified by the mod */ - | { errorType: "MissingDLL"; payload?: string } - /** There's another mod already in the DB with this mod's unique name, contains the path of the other mod that has the same unique name */ - | { errorType: "DuplicateMod"; payload: string } - /** The mod is outdated, contains the newest version */ - | { errorType: "Outdated"; payload: string }; - export type Event = | { name: "localRefresh"; params: EmptyParams } | { name: "remoteRefresh"; params: EmptyParams } @@ -231,26 +318,3 @@ export type Event = | { name: "requestReload"; params: string } /** Purposefully never used, some hooks only need to run once */ | { name: "none"; params: EmptyParams }; - -export enum Theme { - Blue = "Blue", - Red = "Red", - Pink = "Pink", - Purple = "Purple", - Blurple = "Blurple", - GhostlyGreen = "GhostlyGreen", - Green = "Green" -} - -export enum Language { - Wario = "Wario", - English = "English" -} - -export enum ProtocolInstallType { - InstallMod = "installMod", - InstallURL = "installURL", - InstallPreRelease = "installPreRelease", - InstallZip = "installZip", - Unknown = "unknown" -}