Add option for Game Bar's position

This commit is contained in:
redphx
2024-05-12 08:01:49 +07:00
parent 84adf9989e
commit 1be9bd8ee1
6 changed files with 40 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ enum InputType {
export const BxExposed = {
// Enable/disable Game Bar when playing/pausing
onPollingModeChanged: (mode: 'All' | 'None') => {
if (!getPref(PrefKey.GAME_BAR_ENABLED)) {
if (getPref(PrefKey.GAME_BAR_POSITION) === 'off') {
return;
}

View File

@@ -32,7 +32,7 @@ export enum PrefKey {
STREAM_DISABLE_FEEDBACK_DIALOG = 'stream_disable_feedback_dialog',
GAME_BAR_ENABLED = 'game_bar_enabled',
GAME_BAR_POSITION = 'game_bar_position',
LOCAL_CO_OP_ENABLED = 'local_co_op_enabled',
// LOCAL_CO_OP_SEPARATE_TOUCH_CONTROLLER = 'local_co_op_separate_touch_controller',
@@ -314,9 +314,14 @@ export class Preferences {
default: false,
},
[PrefKey.GAME_BAR_ENABLED]: {
label: t('enable-game-bar'),
default: true,
[PrefKey.GAME_BAR_POSITION]: {
label: t('position'),
default: 'bottom-left',
options: {
'bottom-left': t('bottom-left'),
'bottom-right': t('bottom-right'),
'off': t('off'),
},
},
[PrefKey.LOCAL_CO_OP_ENABLED]: {