[Base] Moved IsUseNexusForGameBarEnabled from emulator_window to system.h
This will remove direct usage of system specific code from emulator_window
This commit is contained in:
parent
bcc3c3172d
commit
9dfb0d0b68
|
@ -1870,24 +1870,6 @@ void EmulatorWindow::ToggleGPUSetting(gpu_cvar value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine if the Xbox Gamebar is enabled via the Windows registry
|
|
||||||
bool EmulatorWindow::IsUseNexusForGameBarEnabled() {
|
|
||||||
#ifdef _WIN32
|
|
||||||
const LPCWSTR reg_path = L"SOFTWARE\\Microsoft\\GameBar";
|
|
||||||
const LPCWSTR key = L"UseNexusForGameBarEnabled";
|
|
||||||
|
|
||||||
DWORD value = 0;
|
|
||||||
DWORD dataSize = sizeof(value);
|
|
||||||
|
|
||||||
RegGetValue(HKEY_CURRENT_USER, reg_path, key, RRF_RT_DWORD, nullptr, &value,
|
|
||||||
&dataSize);
|
|
||||||
|
|
||||||
return (bool)value;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmulatorWindow::DisplayHotKeysConfig() {
|
void EmulatorWindow::DisplayHotKeysConfig() {
|
||||||
std::string msg = "";
|
std::string msg = "";
|
||||||
std::string msg_passthru = "";
|
std::string msg_passthru = "";
|
||||||
|
|
|
@ -236,7 +236,6 @@ class EmulatorWindow {
|
||||||
bool vibrate = true);
|
bool vibrate = true);
|
||||||
void GamepadHotKeys();
|
void GamepadHotKeys();
|
||||||
void ToggleGPUSetting(gpu_cvar index);
|
void ToggleGPUSetting(gpu_cvar index);
|
||||||
bool IsUseNexusForGameBarEnabled();
|
|
||||||
void DisplayHotKeysConfig();
|
void DisplayHotKeysConfig();
|
||||||
|
|
||||||
static std::string CanonicalizeFileExtension(
|
static std::string CanonicalizeFileExtension(
|
||||||
|
|
|
@ -29,6 +29,9 @@ void LaunchFileExplorer(const std::filesystem::path& path);
|
||||||
|
|
||||||
bool SetProcessPriorityClass(const uint32_t priority_class);
|
bool SetProcessPriorityClass(const uint32_t priority_class);
|
||||||
|
|
||||||
|
// Determine if the Xbox Gamebar is enabled via the Windows registry
|
||||||
|
bool IsUseNexusForGameBarEnabled();
|
||||||
|
|
||||||
enum class SimpleMessageBoxType {
|
enum class SimpleMessageBoxType {
|
||||||
Help,
|
Help,
|
||||||
Warning,
|
Warning,
|
||||||
|
|
|
@ -296,4 +296,5 @@ void ShowSimpleMessageBox(SimpleMessageBoxType type, std::string_view message) {
|
||||||
|
|
||||||
bool SetProcessPriorityClass(const uint32_t priority_class) { return true; }
|
bool SetProcessPriorityClass(const uint32_t priority_class) { return true; }
|
||||||
|
|
||||||
|
bool IsUseNexusForGameBarEnabled() { return false; }
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
|
@ -69,4 +69,5 @@ void ShowSimpleMessageBox(SimpleMessageBoxType type, std::string_view message) {
|
||||||
|
|
||||||
bool SetProcessPriorityClass(const uint32_t priority_class) { return true; }
|
bool SetProcessPriorityClass(const uint32_t priority_class) { return true; }
|
||||||
|
|
||||||
|
bool IsUseNexusForGameBarEnabled() { return false; }
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
|
@ -64,4 +64,17 @@ bool SetProcessPriorityClass(const uint32_t priority_class) {
|
||||||
xeniaToWindowsPriorityClassMapping[priority_class]);
|
xeniaToWindowsPriorityClassMapping[priority_class]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsUseNexusForGameBarEnabled() {
|
||||||
|
const LPCWSTR reg_path = L"SOFTWARE\\Microsoft\\GameBar";
|
||||||
|
const LPCWSTR key = L"UseNexusForGameBarEnabled";
|
||||||
|
|
||||||
|
DWORD value = 0;
|
||||||
|
DWORD dataSize = sizeof(value);
|
||||||
|
|
||||||
|
RegGetValue(HKEY_CURRENT_USER, reg_path, key, RRF_RT_DWORD, nullptr, &value,
|
||||||
|
&dataSize);
|
||||||
|
|
||||||
|
return static_cast<bool>(value);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
Loading…
Reference in New Issue