Skip to content

Commit 2f75060

Browse files
author
NotValra
committed
qol
1 parent a17f721 commit 2f75060

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

src/background/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ function getDefaultSettings() {
8585
totalearnedEnabled: true,
8686
EnableRobloxApiDocs: false,
8787
QuickOutfitsEnabled: false,
88-
gameTitleIssueEnable: true
88+
gameTitleIssueEnable: true,
89+
closeUiByClickingTheBackground: true
8990
};
9091
}
9192

src/content/core/settings/settingConfig.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ export const SETTINGS_CONFIG = {
119119
],
120120
type: "checkbox",
121121
default: true
122+
},
123+
closeUiByClickingTheBackground: {
124+
label: "Close the 'What am I joining' UI by clicking the background",
125+
description: "This allows you to click the background to close the UI, can be annoying if you want to see the info provided in the UI",
126+
type: "checkbox",
127+
default: true
122128
}
123129
}
124130
},

src/content/core/ui/startModal/gamelaunchmodal.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ try {
184184
let activeInstance = null;
185185
let keepOverlayOpen = false;
186186

187-
export function showLoadingOverlay(onCancel, customLogo = null) {
187+
export function showLoadingOverlay(onCancel, customLogo = null, closeOnBackgroundClick = false) {
188188
keepOverlayOpen = false;
189189

190190
if (activeInstance) {
@@ -241,7 +241,13 @@ export function showLoadingOverlay(onCancel, customLogo = null) {
241241

242242
const { overlay, close } = createOverlay({
243243
title: '', bodyContent: bodyWrapper, showLogo: false,
244-
maxWidth: '350px', preventBackdropClose: true
244+
maxWidth: '350px', preventBackdropClose: !closeOnBackgroundClick,
245+
onClose: () => {
246+
if (activeInstance) {
247+
activeInstance = null;
248+
if (typeof onCancel === 'function') onCancel();
249+
}
250+
}
245251
});
246252

247253
const titleEl = overlay.querySelector('.group-description-dialog-body-header');
@@ -264,8 +270,9 @@ export function hideLoadingOverlay(force = false) {
264270
if (keepOverlayOpen && !force) return;
265271

266272
if (activeInstance) {
267-
activeInstance.close();
273+
const instance = activeInstance;
268274
activeInstance = null;
275+
instance.close();
269276
}
270277
}
271278

src/content/features/games/revertlogo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ try {
4646
} catch(e) { }
4747

4848

49-
function openInterface(onCancel, customLogo) {
49+
function openInterface(onCancel, customLogo, closeOnBackgroundClick) {
5050
document.body.classList.add(HIDE_ROBLOX_UI_CLASS);
5151
showLoadingOverlay(() => {
5252
closeInterface();
5353
if (onCancel) onCancel();
54-
}, customLogo);
54+
}, customLogo, closeOnBackgroundClick);
5555
}
5656

5757
function closeInterface(force = false) {
@@ -432,7 +432,7 @@ function initializeJoinDialogEnhancer() {
432432
}
433433
});
434434

435-
chrome.storage.local.get({ whatamIJoiningEnabled: true, AlwaysGetInfo: false, customLogoData: null, revertLogo: false }, (settings) => {
435+
chrome.storage.local.get({ whatamIJoiningEnabled: true, AlwaysGetInfo: false, customLogoData: null, revertLogo: false, closeUiByClickingTheBackground: true }, (settings) => {
436436

437437
const processGameLaunchData = async (gameLaunchFrame) => {
438438
gameLaunchElementExists = true;
@@ -446,7 +446,7 @@ function initializeJoinDialogEnhancer() {
446446

447447
const logoToUse = (settings.revertLogo === true && settings.customLogoData) ? settings.customLogoData : null;
448448

449-
openInterface(null, logoToUse);
449+
openInterface(null, logoToUse, settings.closeUiByClickingTheBackground);
450450

451451
let urlParams;
452452
let placeId;

0 commit comments

Comments
 (0)