#pragma once #include "config/XMLConfig.h" #include "util/math/vector2.h" #include "wxgui.h" namespace DefaultColumnSize { enum : uint32 { name = 500u, version = 60u, dlc = 50u, game_time = 140u, game_started = 160u, region = 80u, title_id = 160u }; }; enum class MSWThemeOption : int { kAuto = 0, kLight = 1, kDark = 2, }; ENABLE_ENUM_ITERATORS(MSWThemeOption, MSWThemeOption::kAuto, MSWThemeOption::kDark); typedef union { struct { uint16 key : 13; // enough bits for all keycodes uint16 alt : 1; uint16 ctrl : 1; uint16 shift : 1; }; uint16 raw; } uKeyboardHotkey; typedef sint16 ControllerHotkey_t; struct sHotkeyCfg { static constexpr uint8 keyboardNone{WXK_NONE}; static constexpr sint8 controllerNone{-1}; // no enums to work with, but buttons start from 0 uKeyboardHotkey keyboard{keyboardNone}; ControllerHotkey_t controller{controllerNone}; /* for defaults */ sHotkeyCfg(const uKeyboardHotkey& keyboard = {keyboardNone}, const ControllerHotkey_t& controller = {controllerNone}) : keyboard(keyboard), controller(controller) {}; /* for reading from xml */ sHotkeyCfg(const char* xml_values) { std::istringstream iss(xml_values); iss >> keyboard.raw >> controller; } }; template<> struct fmt::formatter : formatter { template auto format(const sHotkeyCfg c, FormatContext& ctx) const { std::string xml_values = fmt::format("{} {}", c.keyboard.raw, c.controller); return formatter::format(xml_values, ctx); } }; struct wxCemuConfig { ConfigValue language{wxLANGUAGE_DEFAULT}; ConfigValue msw_theme { static_cast(MSWThemeOption::kAuto) }; ConfigValue use_discord_presence{true}; ConfigValue fullscreen{ false }; ConfigValue fullscreen_menubar{false}; ConfigValue feral_gamemode{false}; // max 15 entries static constexpr size_t kMaxRecentEntries = 15; std::vector recent_launch_files; std::vector recent_nfc_files; Vector2i window_position{-1, -1}; Vector2i window_size{-1, -1}; ConfigValue window_maximized; ConfigValue pad_open; Vector2i pad_position{-1, -1}; Vector2i pad_size{-1, -1}; ConfigValue pad_maximized; ConfigValue check_update{true}; ConfigValue receive_untested_updates{false}; ConfigValue save_screenshot{true}; ConfigValue did_show_vulkan_warning{false}; ConfigValue did_show_graphic_pack_download{false}; // no longer used but we keep the config value around in case people downgrade Cemu. Despite the name this was used for the Getting Started dialog ConfigValue did_show_macos_disclaimer{false}; ConfigValue show_icon_column{true}; int game_list_style = 0; std::string game_list_column_order; struct { uint32 name = DefaultColumnSize::name; uint32 version = DefaultColumnSize::version; uint32 dlc = DefaultColumnSize::dlc; uint32 game_time = DefaultColumnSize::game_time; uint32 game_started = DefaultColumnSize::game_started; uint32 region = DefaultColumnSize::region; uint32 title_id = 0; } column_width{}; // hotkeys struct { sHotkeyCfg modifiers; sHotkeyCfg toggleFullscreen; sHotkeyCfg toggleFullscreenAlt; sHotkeyCfg exitFullscreen; sHotkeyCfg takeScreenshot; sHotkeyCfg toggleFastForward; sHotkeyCfg exitApplication; #ifdef CEMU_DEBUG_ASSERT sHotkeyCfg endEmulation; #endif } hotkeys{}; void AddRecentlyLaunchedFile(std::string_view file); void AddRecentNfcFile(std::string_view file); void Load(XMLConfigParser& parser); void Save(XMLConfigParser& parser); }; typedef XMLChildConfig XMLWxCemuConfig_t; extern XMLWxCemuConfig_t g_wxConfig; inline XMLWxCemuConfig_t& GetWxGuiConfigHandle() { return g_wxConfig; } inline wxCemuConfig& GetWxGUIConfig() { return GetWxGuiConfigHandle().Data(); }