mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
Game bar (#392)
* Fix games with custom touch control sometimes not showing touch icon * Create game-bar with screenshot button * Disable Game bar when opening the Guide * Remove SCREENSHOT_BUTTON_POSITION pref * Make the touch control action functional * Show game bar when the game starts * Fix 720p/High not working (#387) * Update icons * Update game bar's animations * Reset states of Game bar actions before playing * Don't show Touch control action on non-touch-supported devices * Clean up * Update translations * Update actions' texts * Clean up
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { GameBar } from "@modules/game-bar/game-bar";
|
||||
import { BxEvent } from "@utils/bx-event";
|
||||
import { STATES } from "@utils/global";
|
||||
import { getPref, PrefKey } from "@utils/preferences";
|
||||
@@ -15,25 +16,12 @@ enum InputType {
|
||||
export const BxExposed = {
|
||||
onPollingModeChanged: (mode: 'All' | 'None') => {
|
||||
if (!STATES.isPlaying) {
|
||||
return false;
|
||||
GameBar.disable();
|
||||
return;
|
||||
}
|
||||
|
||||
const $screenshotBtn = document.querySelector('.bx-screenshot-button');
|
||||
const $touchControllerBar = document.getElementById('bx-touch-controller-bar');
|
||||
|
||||
if (mode !== 'None') {
|
||||
// Hide screenshot button
|
||||
$screenshotBtn && $screenshotBtn.classList.add('bx-gone');
|
||||
|
||||
// Hide touch controller bar
|
||||
$touchControllerBar && $touchControllerBar.classList.add('bx-gone');
|
||||
} else {
|
||||
// Show screenshot button
|
||||
$screenshotBtn && $screenshotBtn.classList.remove('bx-gone');
|
||||
|
||||
// Show touch controller bar
|
||||
$touchControllerBar && $touchControllerBar.classList.remove('bx-gone');
|
||||
}
|
||||
// Toggle Game bar
|
||||
mode !== 'None' ? GameBar.disable() : GameBar.enable();
|
||||
},
|
||||
|
||||
getTitleInfo: () => STATES.currentStream.titleInfo,
|
||||
|
Reference in New Issue
Block a user