mirror of https://github.com/Alia5/GlosSI
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
867 B
TypeScript
22 lines
867 B
TypeScript
import { SteamUiMode } from '../../common/Steam';
|
|
import { initTweak } from '../../common/tweakApi';
|
|
|
|
|
|
initTweak('MinimizeSteamGamepadUI', async () => {
|
|
|
|
const [isGamepadUI, minimizeGPUI] = await Promise.all([
|
|
(async () => (await SteamClient.UI.GetUiMode()) === SteamUiMode.GamepadUI)(),
|
|
(async () => (await GlosSIApi.SteamTarget.getGlosSISettings()).minimizeSteamGamepadUI)()
|
|
]);
|
|
if (isGamepadUI && minimizeGPUI) {
|
|
SteamClient.Window.Minimize();
|
|
return true;
|
|
}
|
|
if (!isGamepadUI && minimizeGPUI) {
|
|
console.warn('MinimizeSteamGamepadUI is enabled but Steam is not in GamepadUI mode');
|
|
}
|
|
return false;
|
|
}).then((minimized: boolean) => {
|
|
console.log('MinimizeSteamGamepadUI installed; Minimized GamepadUI:', minimized);
|
|
}).catch((e) => console.error('MinimizeSteamGamepadUI failed to install', e));
|