Skip to content

Commit 9af6ae9

Browse files
author
NotValra
committed
2.4 beta.2 with bug fixes and small additions!!!!
1 parent 0d1efd5 commit 9af6ae9

16 files changed

Lines changed: 191 additions & 56 deletions

File tree

src/background/background.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function getDefaultSettings() {
7575
EnableVideoTest: false,
7676
EnableGameTrailer: true,
7777
Enableautoplay: true,
78+
alwaysShowDeveloperSettings: false
7879
};
7980
}
8081

src/content/core/settings/generateSettings.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { getFullRegionName, REGIONS, getContinent } from '../regions.js';
44
import { getCurrentTheme, THEME_CONFIG } from '../theme.js';
55
import { createDropdown } from '../ui/dropdown.js';
66
import { createFileUpload } from '../ui/fileupload.js';
7+
import { createPill } from '../ui/general/pill.js';
78
import { handleSaveSettings } from './handlesettings.js';
89
import { createStyledInput } from '../ui/catalog/input.js';
910

@@ -190,6 +191,19 @@ export function generateSingleSettingHTML(settingName, setting, REGIONS = {}) {
190191
const label = document.createElement('label');
191192
label.textContent = setting.label;
192193
controlsContainer.appendChild(label);
194+
195+
if (setting.experimental) {
196+
const experimentalPill = createPill('Experimental', setting.experimental, 'experimental');
197+
controlsContainer.appendChild(experimentalPill);
198+
}
199+
if (setting.beta) {
200+
const betaPill = createPill('Beta', setting.beta, 'beta');
201+
controlsContainer.appendChild(betaPill);
202+
}
203+
if (setting.deprecated) {
204+
const deprecatedPill = createPill('Deprecated', setting.deprecated, 'deprecated');
205+
controlsContainer.appendChild(deprecatedPill);
206+
}
193207

194208
const inputElement = generateSettingInput(settingName, setting, REGIONS);
195209
controlsContainer.appendChild(inputElement);
@@ -252,6 +266,19 @@ export function generateSingleSettingHTML(settingName, setting, REGIONS = {}) {
252266
const childLabel = document.createElement('label');
253267
childLabel.textContent = childSetting.label;
254268
childControls.appendChild(childLabel);
269+
270+
if (childSetting.experimental) {
271+
const experimentalPill = createPill('Experimental', childSetting.experimental, 'experimental');
272+
childControls.appendChild(experimentalPill);
273+
}
274+
if (childSetting.beta) {
275+
const betaPill = createPill('Beta', childSetting.beta, 'beta');
276+
childControls.appendChild(betaPill);
277+
}
278+
if (childSetting.deprecated) {
279+
const deprecatedPill = createPill('Deprecated', childSetting.deprecated, 'deprecated');
280+
childControls.appendChild(deprecatedPill);
281+
}
255282

256283
const childInput = generateSettingInput(childName, childSetting, REGIONS);
257284
childControls.appendChild(childInput);

src/content/core/settings/settingConfig.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ export const SETTINGS_CONFIG = {
2020
hiddenCatalogEnabled: {
2121
label: "Hidden Catalog",
2222
description: ["Shows Roblox made items before they are on the official catalog.",
23-
"{{WARNING red}} This has now been patched by Roblox, but you can still see previous hidden items.",
23+
2424
],
25+
deprecated: "Patched by Roblox",
2526
type: "checkbox",
2627
default: false
2728
},
2829
SaveLotsRobuxEnabled: {
2930
label: "Save 10%-40% Robux on Purchases",
3031
description: ["This adds a button allowing you to save 40% on items on the catalog and 10% on gamepasses",
3132
"Keep in mind a group is required for this to work.",
32-
"**WARNING this currently uses a method that could have a slight risk of an account ban.** In full release it will be changed."
33+
"**WARNING this currently uses a method that could have a slight risk of an account ban.** In full release it will be changed.",
34+
"**USE AT YOUR OWN RISK**"
3335
],
3436
type: "checkbox",
37+
beta: "Currently in a prerelease state.",
3538
default: false,
3639
childSettings: {
3740
RobuxPlaceId: {
@@ -344,16 +347,18 @@ export const SETTINGS_CONFIG = {
344347
pendingRobuxEnabled: {
345348
label: "Unpending Robux",
346349
description: ["Shows an estimate of how many pending Robux will stop pending within 24 hours.",],
350+
experimental: "May be inaccurate",
347351
type: "checkbox",
348352
default: true
349353
},
350354
antibotsEnabled: {
351355
label: "Anti-Bot Members",
352-
description: ["{{Experimental Feature green}}",
356+
description: [
353357
"This adds a button that will allow you to scan all members in a community for bots.",
354358
"If there is any bots it will allow you to quickly ban or kick them.",
355359
"This calculates bots by similar avatars and display names, so it may not be 100% accurate."
356360
],
361+
experimental: "May be buggy",
357362
type: "checkbox",
358363
default: true
359364
},
@@ -397,7 +402,17 @@ export const SETTINGS_CONFIG = {
397402
description: ["This calculates the total amount of Robux and money you have spent on your account based on your transaction history."],
398403
type: "checkbox",
399404
default: true
400-
}
405+
},
406+
pendingrobuxtrans: {
407+
408+
label: "Unpending Robux Transactions",
409+
description: ["This estimates how many Robux will stop pending in 24 hours.",
410+
411+
],
412+
experimental: "May be inaccurate",
413+
type: "checkbox",
414+
default: true
415+
},
401416
}
402417
},
403418
Miscellaneous: {
@@ -448,16 +463,7 @@ export const SETTINGS_CONFIG = {
448463
type: "checkbox",
449464
default: true
450465
},
451-
pendingrobuxtrans: {
452-
453-
label: "Unpending Robux Transactions",
454-
description: ["This estimates how many Robux will stop pending in 24 hours.",
455-
"This feature is experimental since I couldn't test it myself, but it should work fine."
456-
],
457466

458-
type: "checkbox",
459-
default: true
460-
},
461467
revertLogo: {
462468
label: "Change the app launch icon",
463469
description: ["This changes the icon that shows when you join a game.",
@@ -479,7 +485,7 @@ export const SETTINGS_CONFIG = {
479485
description: [
480486
"Compresses the image to reduce storage space (max 512px, JPEG 80% quality for photos, PNG for transparent images).",
481487
"Disable this to keep full quality and transparency, but it may use more storage space.",
482-
"{{WARNING orange}} Uncompressed images must still be under 1MB."
488+
"Uncompressed images must still be under 1MB."
483489
],
484490
type: "checkbox",
485491
default: true
@@ -499,7 +505,6 @@ export const SETTINGS_CONFIG = {
499505
description: [
500506
"Makes you appear as offline to you and other people.",
501507
"This is useful if you want to appear offline while still allowing connections to join you in experiences, since the official offline status by Roblox does not allow this.",
502-
"This may take a few minutes to update after turning on the feature.",
503508
"Joining an experience will overwrite this status.",
504509
"This may take a few minutes to actually change your status to offline after turning on the feature."
505510

src/content/core/settings/ui/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export async function checkRoValraPage() {
123123
};
124124
};
125125

126-
const { rovalraHeader, settingsContainer } = buildSettingsPage({
126+
const { rovalraHeader, settingsContainer } = await buildSettingsPage({
127127
handleSearch: (event) => handleSearch(event, regionData.regions),
128128
debounce: debouncedSearch,
129129
loadTabContent,

src/content/core/settings/ui/settingsbutton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let rovalraButtonAdded = false;
44

55

66
export function addCustomButton(debouncedAddPopoverButton) {
7-
if (!window.location.href.includes('/my/account') || window.location.href.includes('?rovalra=info')) {
7+
if (!window.location.href.includes('/my/account') || window.location.href.includes('?rovalra=')) {
88
return;
99
}
1010

src/content/core/settings/ui/settingui.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,19 @@ import { applyTheme } from '../../../features/settings/index.js';
55
import { createDropdown } from '../../ui/dropdown.js';
66

77

8-
export function buildSettingsPage({ handleSearch, debounce, loadTabContent, buttonData, REGIONS, initSettings }) {
8+
function ensureDeveloperSettings() {
9+
if (!SETTINGS_CONFIG.Developer) {
10+
addDeveloperTab({});
11+
}
12+
}
13+
14+
export async function buildSettingsPage({ handleSearch, debounce, loadTabContent, buttonData, REGIONS, initSettings }) {
15+
const settings = await new Promise(resolve => {
16+
chrome.storage.local.get('alwaysShowDeveloperSettings', resolve);
17+
});
18+
19+
let devTabAdded = settings.alwaysShowDeveloperSettings === true;
20+
if (devTabAdded) ensureDeveloperSettings();
921
const assets = getAssets();
1022
const containerMain = document.querySelector('main.container-main');
1123
if (!containerMain) {
@@ -149,14 +161,12 @@ export function buildSettingsPage({ handleSearch, debounce, loadTabContent, butt
149161
overflow-y: auto;
150162
overflow-x: auto;
151163
padding-left: 0px;
152-
z-index: 1000;
153164
position: relative;
154165
margin-top: 7px;
155166
background-color: transparent;
156167
min-width: 0;
157168
`;
158169

159-
let devTabAdded = false;
160170
const unifiedMenu = createUnifiedMenu({ handleSearch, debounce, buttonData, devTabAdded, loadTabContent, REGIONS, initSettings });
161171

162172
rovalraIcon.addEventListener('click', () => {
@@ -166,6 +176,7 @@ export function buildSettingsPage({ handleSearch, debounce, loadTabContent, butt
166176

167177
if (rovalraIconClickCount >= 10 && !devTabAdded) {
168178
devTabAdded = true;
179+
ensureDeveloperSettings();
169180
addDeveloperTab({
170181
REGIONS,
171182
initSettings,
@@ -333,15 +344,22 @@ function createSidebarItem(sectionName, title, loadTabContent) {
333344
return listItem;
334345
}
335346

336-
function addDeveloperTab({ REGIONS, initSettings, menuList, loadTabContent, renderMobileDropdown }) {
347+
function addDeveloperTab({ menuList, loadTabContent, renderMobileDropdown }) {
337348
SETTINGS_CONFIG.Developer = {
338349
title: "Developer",
339350
settings: {
340351
info: {
341352
label: ["Developer Settings"],
342353
description: ["These are featured used mostly to develop rovalra, if you don't know what your doing dont touch them."],
343-
type: "YOUR MOM!!!!!"
354+
type: "yay"
344355
},
356+
alwaysShowDeveloperSettings: {
357+
label: ["Always show developer settings tab"],
358+
description: ["This will make the developer settings tab always show. So you dont have to do the easter egg every time."],
359+
type: "checkbox",
360+
default: false
361+
362+
},
345363
EnablebannerTest: {
346364
label: ["Banner test"],
347365
description: ["This adds a test banner to experiences"],
@@ -429,7 +447,6 @@ export function injectSettingsStyles() {
429447
#rovalra-mobile-menu-container {
430448
display: none;
431449
margin-bottom: 20px;
432-
z-index: 2000;
433450
position: relative;
434451
}
435452
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { addTooltip } from '../tooltip.js';
2+
3+
let isCssInjected = false;
4+
5+
function injectPillCss() {
6+
if (isCssInjected) return;
7+
isCssInjected = true;
8+
9+
const style = document.createElement('style');
10+
style.id = 'rovalra-pill-style';
11+
style.textContent = `
12+
.rovalra-pill {
13+
display: inline-block;
14+
padding: 4px 10px;
15+
border-radius: 12px;
16+
font-size: 12px;
17+
font-weight: 600;
18+
line-height: 1.5;
19+
cursor: default;
20+
align-self: flex-start;
21+
}
22+
23+
.rovalra-pill.experimental {
24+
background-color: rgb(2, 170, 81);
25+
color: var(--rovalra-main-text-color);
26+
}
27+
28+
.rovalra-pill.beta {
29+
background-color: rgb(51, 95, 255);
30+
color: var(--rovalra-main-text-color);
31+
}
32+
33+
.rovalra-pill.deprecated {
34+
background-color: rgb(220, 53, 69);
35+
color: #FFFFFF;
36+
}
37+
`;
38+
document.head.appendChild(style);
39+
}
40+
41+
export function createPill(text, tooltipText, type) {
42+
injectPillCss();
43+
const pill = document.createElement('div');
44+
pill.className = `rovalra-pill ${type}`;
45+
pill.textContent = text;
46+
addTooltip(pill, tooltipText, { position: 'top' });
47+
return pill;
48+
}

src/content/core/ui/overlay.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function injectOverlayCss() {
2929
}
3030

3131

32-
export function createOverlay({ title, bodyContent, actions = [], maxWidth = '550px', maxHeight = 'none', showLogo = false, preventBackdropClose = false }) {
32+
export function createOverlay({ title, bodyContent, actions = [], maxWidth = '550px', maxHeight = 'none', showLogo = false, preventBackdropClose = false, onClose }) {
3333
injectOverlayCss();
3434

3535
const overlay = document.createElement('div');
@@ -101,6 +101,9 @@ export function createOverlay({ title, bodyContent, actions = [], maxWidth = '55
101101
const close = () => {
102102
overlay.remove();
103103
document.body.style.overflow = '';
104+
if (typeof onClose === 'function') {
105+
onClose();
106+
}
104107
};
105108

106109
const closeButton = createCloseButton({ onClick: close });

src/content/features/games/about/botDetector.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ class BotDetector {
5151
if (!placeId) return;
5252

5353
const isLightTheme = document.body.classList.contains('light-theme');
54-
const tooltipTextColor = isLightTheme ? 'rgb(25, 25, 25)' : 'rgb(213, 215, 221)';
54+
const tooltipTextColor = "var(--rovalra-secondary-text-color)";
5555

5656
let statsContainer = document.querySelector('.bot-stats-container');
5757
if (!statsContainer) {
5858
statsContainer = document.createElement('div');
5959
statsContainer.className = 'bot-stats-container';
6060
statsContainer.style.cssText = `
6161
display: flex;
62-
margin-left: 12px;
6362
font-size: 14px;
6463
align-items: center;
6564
width: 100%;
@@ -79,7 +78,7 @@ class BotDetector {
7978
if (botPercentage > 20) {
8079
statsContainer.innerHTML = `
8180
<div style="display: flex; align-items: center; gap: 4px; color: ${tooltipTextColor};">
82-
<span style="font-weight: 500;"><span style="color: ${isLightTheme ? 'rgb(25, 25, 25)' : 'rgb(247, 247, 248)'};">${gameName}</span> has a lot of bots</span>
81+
<span style="font-weight: 500;"><span style="color: var(--rovalra-main-text-color)">${gameName}</span> has a lot of bots</span>
8382
<i class="icon-moreinfo"></i>
8483
</div>
8584
`;
@@ -88,7 +87,7 @@ class BotDetector {
8887
} else if (botPercentage > BOT_PERCENTAGE_THRESHOLD) {
8988
statsContainer.innerHTML = `
9089
<div style="display: flex; align-items: center; gap: 4px; color: ${tooltipTextColor};">
91-
<span style="font-weight: 500;"><span style="color: ${isLightTheme ? 'rgb(25, 25, 25)' : 'rgb(247, 247, 248)'};">${gameName}</span> has some bots but mostly real players</span>
90+
<span style="font-weight: 500;"><span style="color: var(--rovalra-main-text-color);">${gameName}</span> has some bots but mostly real players</span>
9291
<i class="icon-moreinfo"></i>
9392
</div>
9493
`;
@@ -128,7 +127,6 @@ class BotDetector {
128127
this.scanServers(placeId, servers);
129128
}
130129
} catch (error) {
131-
// Error handling suppressed
132130
}
133131
}
134132

@@ -228,7 +226,6 @@ class BotDetector {
228226
await new Promise(resolve => setTimeout(resolve, 1000));
229227
}
230228
} catch (batchError) {
231-
// Error handling suppressed
232229
}
233230
}
234231

0 commit comments

Comments
 (0)