Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darker/dimmed backdrop on teams menu #321

Merged
merged 11 commits into from
Jun 1, 2024
47 changes: 34 additions & 13 deletions client/src/scripts/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
updateServerSelectors();

// eslint-disable-next-line @typescript-eslint/no-misused-promises
serverList.children("li.server-list-item").on("click", async function(this: HTMLLIElement) {
serverList.children("li.server-list-item").on("click", async function (this: HTMLLIElement) {

Check failure on line 210 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses

Check failure on line 210 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses
const region = this.getAttribute("data-region");

if (region === null) return;
Expand Down Expand Up @@ -312,7 +312,7 @@
});

const createTeamMenu = $("#create-team-menu");
$("#btn-create-team, #btn-join-team").on("click", function() {
$("#btn-create-team, #btn-join-team").on("click", function () {

Check failure on line 315 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses

Check failure on line 315 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses
const now = Date.now();
if (now - lastPlayButtonClickTime < 1500 || teamSocket) return;
lastPlayButtonClickTime = now;
Expand Down Expand Up @@ -438,6 +438,13 @@
$("#splash-server-message").show();
resetPlayButtons();
createTeamMenu.fadeOut(250);

// ---------------------------------------------------------
// Dimmed backdrop on team menu. (Probably not needed here)
// ---------------------------------------------------------
$("#splash-ui").css("filter", "");
$("#splash-ui").css("pointer-events", "");
// ---------------------------------------------------------
};

teamSocket.onclose = (): void => {
Expand All @@ -457,9 +464,23 @@
joinedTeam = false;
window.location.hash = "";
createTeamMenu.fadeOut(250);

// ----------------------------------------------
// Dimmed Backdrop on team menu.
// ----------------------------------------------
$("#splash-ui").css("filter", "");
$("#splash-ui").css("pointer-events", "");
// ----------------------------------------------
};

createTeamMenu.fadeIn(250);

// ----------------------------------------------
// Dimmed Backdrop on team menu.
// ----------------------------------------------
$("#splash-ui").css("filter", "brightness(0.6)");
$("#splash-ui").css("pointer-events", "none");
// ----------------------------------------------
});

$("#close-create-team").on("click", () => {
Expand Down Expand Up @@ -500,15 +521,15 @@
.css("color", "#FFFFFF00");
});

$("#create-team-toggle-auto-fill").on("click", function() {
$("#create-team-toggle-auto-fill").on("click", function () {

Check failure on line 524 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses

Check failure on line 524 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses
autoFill = $(this).prop("checked");
teamSocket?.send(JSON.stringify({
type: CustomTeamMessages.Settings,
autoFill
}));
});

$("#create-team-toggle-lock").on("click", function() {
$("#create-team-toggle-lock").on("click", function () {

Check failure on line 532 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses

Check failure on line 532 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses
teamSocket?.send(JSON.stringify({
type: CustomTeamMessages.Settings,
locked: $(this).prop("checked")
Expand Down Expand Up @@ -664,7 +685,7 @@
void game.endGame();
});
// eslint-disable-next-line @typescript-eslint/no-misused-promises
$("#btn-play-again, #btn-spectate-replay").on("click", async() => {
$("#btn-play-again, #btn-spectate-replay").on("click", async () => {

Check failure on line 688 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses

Check failure on line 688 in client/src/scripts/ui.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected space before function parentheses
await game.endGame();
if (teamSocket) teamSocket.send(JSON.stringify({ type: CustomTeamMessages.Start })); // TODO Check if player is team leader
else joinGame();
Expand Down Expand Up @@ -775,7 +796,7 @@
</div>
<span class="skin-name">${skin.name}</span>
</div>`);
skinItem.on("click", function() {
skinItem.on("click", function () {
game.console.setBuiltInCVar("cv_loadout_skin", skin.idString);
$(this).addClass("selected").siblings().removeClass("selected");
updateSplashCustomize(skin.idString);
Expand All @@ -801,7 +822,7 @@
<span class="emote-name">${emote.name}</span>
</div>`);

emoteItem.on("click", function() {
emoteItem.on("click", function () {
if (selectedEmoteSlot === undefined) return;
game.console.setBuiltInCVar(`cv_loadout_${selectedEmoteSlot}_emote`, emote.idString);

Expand Down Expand Up @@ -903,7 +924,7 @@
"background-repeat": "no-repeat"
});

crosshairItem.on("click", function() {
crosshairItem.on("click", function () {
game.console.setBuiltInCVar("cv_loadout_crosshair", crosshairIndex);
loadCrosshair();
$(this).addClass("selected").siblings().removeClass("selected");
Expand Down Expand Up @@ -954,7 +975,7 @@
</div>`
);

noBadgeItem.on("click", function() {
noBadgeItem.on("click", function () {
game.console.setBuiltInCVar("cv_loadout_badge", "");
$(this).addClass("selected").siblings().removeClass("selected");
});
Expand All @@ -971,7 +992,7 @@
</div>`
);

badgeItem.on("click", function() {
badgeItem.on("click", function () {
game.console.setBuiltInCVar("cv_loadout_badge", badge.idString);
$(this).addClass("selected").siblings().removeClass("selected");
});
Expand Down Expand Up @@ -1182,7 +1203,7 @@
});
renderSelect.value = game.console.getBuiltInCVar("cv_renderer");

void (async() => {
void (async () => {
$("#webgpu-option").toggle(await isWebGPUSupported());
})();

Expand Down Expand Up @@ -1549,7 +1570,7 @@

$("#btn-toggle-ping")
.show()
.on("click", function() {
.on("click", function () {
game.inputManager.pingWheelActive = !game.inputManager.pingWheelActive;
const { pingWheelActive } = game.inputManager;
$(this)
Expand Down Expand Up @@ -1609,7 +1630,7 @@
tabContent.show();
});

$("#warning-modal-agree-checkbox").on("click", function() {
$("#warning-modal-agree-checkbox").on("click", function () {
$("#warning-btn-play-solo, #btn-play-solo").toggleClass("btn-disabled", !$(this).prop("checked"));
});

Expand Down
Loading