diff --git a/owmods_gui/backend/src/gui_config.rs b/owmods_gui/backend/src/gui_config.rs index 710a4726..fccd54a6 100644 --- a/owmods_gui/backend/src/gui_config.rs +++ b/owmods_gui/backend/src/gui_config.rs @@ -55,16 +55,15 @@ pub struct GuiConfig { pub no_log_server: bool, #[serde(default = "_default_false")] pub hide_installed_in_remote: bool, - // Old - #[serde(skip_serializing_if = "Option::is_none")] - rainbow: Option, + #[serde(default = "_default_false")] + rainbow: bool, } impl Default for GuiConfig { fn default() -> Self { Self { theme: Theme::default(), - rainbow: None, + rainbow: false, language: Language::default(), watch_fs: true, no_warning: false, @@ -82,19 +81,8 @@ impl GuiConfig { Ok(path) } - fn migrate(&mut self) -> bool { - if self.rainbow.is_some() { - self.rainbow = None; - return true; - } - false - } - fn read() -> Result { - let mut conf = deserialize_from_json::(&Self::path()?)?; - if conf.migrate() { - conf.save()?; - } + let conf = deserialize_from_json::(&Self::path()?)?; Ok(conf) } diff --git a/owmods_gui/frontend/index.html b/owmods_gui/frontend/index.html index b926079d..6739d6d3 100644 --- a/owmods_gui/frontend/index.html +++ b/owmods_gui/frontend/index.html @@ -6,6 +6,7 @@ + Outer Wilds Mod Manager diff --git a/owmods_gui/frontend/logs/index.html b/owmods_gui/frontend/logs/index.html index d4cd2cbd..eafebc48 100644 --- a/owmods_gui/frontend/logs/index.html +++ b/owmods_gui/frontend/logs/index.html @@ -6,6 +6,7 @@ + Log Window diff --git a/owmods_gui/frontend/src/assets/translations/english.json b/owmods_gui/frontend/src/assets/translations/english.json index 054339fd..46bd3936 100644 --- a/owmods_gui/frontend/src/assets/translations/english.json +++ b/owmods_gui/frontend/src/assets/translations/english.json @@ -101,6 +101,7 @@ "PRERELEASE_WARNING": "Prereleases are experimental versions of mods that may not work correctly. Are you sure you want to install?", "Pink": "Pink", "Purple": "Purple", + "RAINBOW": "Rainbow Mode (Epilepsy Warning)", "REFRESH": "Refresh", "RESET": "Reset", "RUN_GAME": "Run Game", @@ -127,6 +128,7 @@ "TOOLTIP_LOG_MULTI_WINDOW": "Makes launching multiple instances of the game open multiple windows instead of all logging to one", "TOOLTIP_OWML_DEBUG_MODE": "Makes OWML log more stuff", "TOOLTIP_OWML_PATH": "Must be an absolute path. All mods are installed in a 'Mods' folder inside this.", + "TOOLTIP_RAINBOW": "Adds a rainbow effect to the manager (possible epilepsy warning)", "TOOLTIP_WATCH_FS": "Watches OWML's Mods folder and settings for changes and refreshes if detected", "UNINSTALL": "Uninstall", "UNIQUE_NAME": "Unique Name", diff --git a/owmods_gui/frontend/src/components/common/BaseApp.tsx b/owmods_gui/frontend/src/components/common/BaseApp.tsx index faa6860a..da973564 100644 --- a/owmods_gui/frontend/src/components/common/BaseApp.tsx +++ b/owmods_gui/frontend/src/components/common/BaseApp.tsx @@ -2,18 +2,31 @@ import { ThemeProvider } from "@emotion/react"; import { CssBaseline, Box, CircularProgress } from "@mui/material"; import { TranslationContext } from "./TranslationContext"; import { Language, Theme } from "@types"; -import { ReactNode, memo } from "react"; +import { ReactNode, memo, useEffect } from "react"; import StyledErrorBoundary from "./StyledErrorBoundary"; import { getMuiTheme } from "../../theme"; +import rainbowCss from "../../rainbow.css?raw"; export interface BaseAppProps { isLoading: boolean; children: ReactNode; language?: Language; theme?: Theme; + usesRainbow?: boolean; } const BaseApp = memo(function BaseApp(props: BaseAppProps) { + useEffect(() => { + const rainbowElem = document.getElementById("rainbow-style"); + if (rainbowElem) { + if (props.usesRainbow) { + rainbowElem.innerHTML = rainbowCss; + } else { + rainbowElem.innerHTML = ""; + } + } + }, [props.usesRainbow]); + return ( diff --git a/owmods_gui/frontend/src/components/logs/LogApp.tsx b/owmods_gui/frontend/src/components/logs/LogApp.tsx index b54c8bc7..56f699ad 100644 --- a/owmods_gui/frontend/src/components/logs/LogApp.tsx +++ b/owmods_gui/frontend/src/components/logs/LogApp.tsx @@ -82,6 +82,7 @@ const LogApp = ({ port }: { port: number }) => { { diff --git a/owmods_gui/frontend/src/components/main/top-bar/settings/SettingsForm.tsx b/owmods_gui/frontend/src/components/main/top-bar/settings/SettingsForm.tsx index e14e974d..e48a567c 100644 --- a/owmods_gui/frontend/src/components/main/top-bar/settings/SettingsForm.tsx +++ b/owmods_gui/frontend/src/components/main/top-bar/settings/SettingsForm.tsx @@ -134,6 +134,13 @@ const SettingsForm = forwardRef(function SettingsForm(props: SettingsFormProps, options={ThemeArr} id="theme" /> + .MuiButton-startIcon > svg { + stroke: white !important; + stroke-width: 2px; +} diff --git a/owmods_gui/frontend/src/types.d.ts b/owmods_gui/frontend/src/types.d.ts index c355571c..a0f19c01 100644 --- a/owmods_gui/frontend/src/types.d.ts +++ b/owmods_gui/frontend/src/types.d.ts @@ -132,7 +132,7 @@ export interface GuiConfig { autoEnableDeps: boolean; noLogServer: boolean; hideInstalledInRemote: boolean; - rainbow?: boolean; + rainbow: boolean; } export interface LogPayload {