Skip to content

Commit 0c84f58

Browse files
committed
More UI updates
1 parent 6a5588e commit 0c84f58

5 files changed

Lines changed: 70 additions & 7 deletions

File tree

src/chat/interface/chatinterface.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ var clientSettings = require("./clientsettings.js");
523523
json.color,
524524
json.font
525525
);
526-
sounds.play("notify", 1);
526+
if (clientSettings.getSetting("INTERFACE_SOUNDS")) {
527+
sounds.play("notify", 1);
528+
}
527529
if (clientSettings.getSetting("CHAT_NOTIFY")) {
528530
notify.sendIfNotOnScreen(
529531
"New message!",

src/chat/interface/clientsettings.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class ClientSettingsMenu {
66
this.client_settings_name = "randomRantsPlusClientSettings";
77
this.defaultSettings = {
88
CHAT_NOTIFY: true,
9+
UI_SOUNDS: true,
10+
JOKE_COMMANDS: true,
911
};
1012
this.settings = {};
1113
this.settingsList = [
@@ -14,6 +16,16 @@ class ClientSettingsMenu {
1416
id: "CHAT_NOTIFY",
1517
type: "on-off",
1618
},
19+
{
20+
name: "Interface sounds",
21+
id: "UI_SOUNDS",
22+
type: "on-off",
23+
},
24+
{
25+
name: "Show goofy admin commands",
26+
id: "JOKE_COMMANDS",
27+
type: "on-off",
28+
},
1729
];
1830
this.init();
1931
}
@@ -29,7 +41,7 @@ class ClientSettingsMenu {
2941
var value = this.getSetting(id);
3042
var _this = this;
3143
return {
32-
element: "span",
44+
element: "div",
3345
className: "clientSettingsSwitchButton",
3446
GPWhenCreated: function (elm) {
3547
if (value) {
@@ -119,10 +131,19 @@ class ClientSettingsMenu {
119131
height: "fit-content",
120132
},
121133
children: [
134+
{
135+
element: "p",
136+
textContent: "Tips:",
137+
},
138+
{
139+
element: "p",
140+
textContent:
141+
"These settings won't be applied to everyone else, and these are only stored for this device.",
142+
},
122143
{
123144
element: "p",
124145
textContent:
125-
"Tips: Notifcations must be enabled in your browser for this site so that you can see them, you can change which ones you recieve here.",
146+
"For notifcations to work, make sure your current notifcations are cleared on your device and not blocked, and make sure the site is allowed to send notifications",
126147
},
127148
],
128149
},
@@ -146,9 +167,13 @@ class ClientSettingsMenu {
146167
if (settingInfo.type == "on-off") {
147168
return {
148169
element: "div",
170+
style: {
171+
padding: "4px 0px",
172+
display: "flex",
173+
},
149174
children: [
150175
{
151-
element: "span",
176+
element: "div",
152177
textContent: settingInfo.name + ": ",
153178
},
154179
this.addClientSettingSwitchButton(settingInfo.id),

src/chat/interface/commands/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var dialogs = require("../../../dialogs.js");
66
var sws = require("../sharedwebsocket.js");
77
var audio = require("../../../audio.js");
88
var confetti = require("./confetti.js");
9+
var clientSettings = require("../clientsettings.js");
910

1011
var commandEffectsDiv = elements.getGPId("commandEffects");
1112

@@ -32,6 +33,9 @@ com.popupMessage = function (message) {
3233
};
3334

3435
com.macreJoke = function () {
36+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
37+
return;
38+
}
3539
var img = document.createElement("img");
3640
img.src = "images/commands/macres-a.svg";
3741
img.style.top = "0";
@@ -57,6 +61,9 @@ com.macreJoke = function () {
5761
};
5862

5963
com.luigJoke = async function () {
64+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
65+
return;
66+
}
6067
var video = document.createElement("video");
6168
video.src = "videos/luig.mp4";
6269
video.style.top = "0";
@@ -73,6 +80,9 @@ com.luigJoke = async function () {
7380
};
7481

7582
com.spin = function () {
83+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
84+
return;
85+
}
7686
var rotatedeg = 0;
7787
var chat = document.body;
7888
var int = setInterval(() => {
@@ -94,6 +104,9 @@ com.spin = function () {
94104
};
95105

96106
com.popcat = function (time) {
107+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
108+
return;
109+
}
97110
var ms = 1000;
98111
if (Number(time)) {
99112
ms = Number(time) * 1000;
@@ -134,6 +147,9 @@ com.kick = function () {
134147
};
135148

136149
com.shake = function (intensity = 1) {
150+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
151+
return;
152+
}
137153
if (isNaN(intensity)) {
138154
intensity = 3;
139155
}
@@ -195,6 +211,9 @@ com.confetti = function () {
195211
};
196212

197213
com.funni = async function () {
214+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
215+
return;
216+
}
198217
var img = document.createElement("img");
199218
img.src = "https://jasonglenevans.github.io/GvbvdxxChatEmojis/MSG_5.png";
200219
img.style.top = "0";
@@ -213,6 +232,9 @@ com.funni = async function () {
213232
};
214233

215234
com.doom = function () {
235+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
236+
return;
237+
}
216238
let overlay = document.createElement("div");
217239
overlay.innerText = "⚠️ DOOM COUNTDOWN: 10 ⚠️";
218240
overlay.style.cssText = `position: fixed;top: 10px;left: 50%;transform: translateX(-50%);font-size: 2em;font-weight: bold;color: red;text-shadow: 2px 2px black;z-index: 9999;pointer-events: none;user-select: none;`;
@@ -238,6 +260,9 @@ com.doom = function () {
238260
};
239261

240262
com.bandicam = function () {
263+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
264+
return;
265+
}
241266
var overlay = document.createElement("span");
242267
overlay.innerText = "www.Bandicam.com";
243268
overlay.style.cssText = `position: fixed;
@@ -264,6 +289,9 @@ com.bandicam = function () {
264289
};
265290

266291
com.spooky = async function () {
292+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
293+
return;
294+
}
267295
let overlay = document.createElement("div");
268296
overlay.style.position = "fixed";
269297
overlay.style.top = "0";
@@ -294,6 +322,9 @@ com.spooky = async function () {
294322
};
295323

296324
com.bsod = function () {
325+
if (!clientSettings.getSetting("JOKE_COMMANDS")) {
326+
return;
327+
}
297328
var bsodStopped = false;
298329

299330
var errors = []; // store all error icons

src/chat/interface/navsounds.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var sounds = require("./sounds.js");
2+
var clientSettings = require("./clientsettings.js");
23

34
const clickableClasses = [
45
"divButton",
@@ -23,7 +24,9 @@ document.addEventListener("click", (e) => {
2324
el.tabIndex >= 0;
2425

2526
if (isClickable) {
26-
sounds.play("select", 1);
27+
if (clientSettings.getSetting("UI_SOUNDS")) {
28+
sounds.play("select", 1);
29+
}
2730
return;
2831
}
2932

@@ -41,6 +44,8 @@ document.addEventListener("input", (e) => {
4144
el.isContentEditable;
4245

4346
if (isTypingTarget) {
44-
sounds.play("type", 1);
47+
if (clientSettings.getSetting("UI_SOUNDS")) {
48+
sounds.play("type", 1);
49+
}
4550
}
4651
});

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1761141290865"}
1+
{"timestamp":"1761142207366"}

0 commit comments

Comments
 (0)