Added quitChat in Pong.ts to go to UGAME
This commit is contained in:
parent
7e644fe658
commit
75f3c2a769
5 changed files with 12 additions and 9 deletions
|
|
@ -263,7 +263,6 @@ div-private {
|
||||||
@apply
|
@apply
|
||||||
bg-white
|
bg-white
|
||||||
rounded-xl
|
rounded-xl
|
||||||
shadow-xl
|
|
||||||
w-200
|
w-200
|
||||||
h-33
|
h-33
|
||||||
p-6
|
p-6
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="game-modal" class="gamePopup hidden">
|
<div id="game-modal" class="gamePopup hidden">
|
||||||
<div class="popUpMessage" >
|
<div class="popUpMessage">
|
||||||
<div id="game-info">
|
<div id="game-info">
|
||||||
<p class="modal-messages " id="modal-message"></p>
|
<p class="modal-messages" id="modal-message"></p>
|
||||||
|
<button id="close-modal-message" class="btn-style relative bottom-8 left-85">Close</button>
|
||||||
</div>
|
</div>
|
||||||
<button id="close-modal-message" class="btn-style absolute bottom-67 right-12">Close</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -422,17 +422,19 @@ sendtextbox.addEventListener("keydown", (event) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
chatButton!.addEventListener("click", async () => {
|
chatButton!.addEventListener("click",() => {
|
||||||
if (chatBox.classList.contains("hidden")) {
|
if (chatBox.classList.contains("hidden")) {
|
||||||
chatBox.classList.toggle("hidden");
|
chatBox.classList.toggle("hidden");
|
||||||
overlay.classList.add("opacity-60");
|
overlay.classList.add("opacity-60");
|
||||||
await windowStateVisable();
|
windowStateVisable();
|
||||||
|
let socket = window.__state.chatSock;
|
||||||
|
if (!socket) return;
|
||||||
|
connected(socket);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
chatBox.classList.toggle("hidden");
|
chatBox.classList.toggle("hidden");
|
||||||
overlay.classList.remove("opacity-60");
|
overlay.classList.remove("opacity-60");
|
||||||
await windowStateHidden();
|
windowStateHidden();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export async function openMessagePopup(message: any) {
|
||||||
if (modalmessage) {
|
if (modalmessage) {
|
||||||
const messageElement = document.createElement("div");
|
const messageElement = document.createElement("div");
|
||||||
messageElement.innerHTML = `
|
messageElement.innerHTML = `
|
||||||
<div id="profile-about">Next Game Message ${incrementCounter()}: ${obj.nextGame}</div>
|
<div id="profile-about">Game-Info: ${incrementCounter()}: ${obj.nextGame}</div>
|
||||||
`;
|
`;
|
||||||
modalmessage.appendChild(messageElement);
|
modalmessage.appendChild(messageElement);
|
||||||
modalmessage.scrollTop = modalmessage.scrollHeight;
|
modalmessage.scrollTop = modalmessage.scrollHeight;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import { getUser as getSelfUser, type User } from "@app/auth";
|
||||||
import { isNullish } from "@app/utils";
|
import { isNullish } from "@app/utils";
|
||||||
import client from "@app/api";
|
import client from "@app/api";
|
||||||
import "./pong.css";
|
import "./pong.css";
|
||||||
|
import { quitChat } from "@app/chat/chatHelperFunctions/quitChat";
|
||||||
|
|
||||||
declare module "ft_state" {
|
declare module "ft_state" {
|
||||||
interface State {
|
interface State {
|
||||||
|
|
@ -249,6 +250,7 @@ function pongClient(
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case JoinRes.yes :
|
case JoinRes.yes :
|
||||||
showInfo('JoinRes = yes');
|
showInfo('JoinRes = yes');
|
||||||
|
quitChat();
|
||||||
break;
|
break;
|
||||||
case JoinRes.no :
|
case JoinRes.no :
|
||||||
showInfo('JoinRes = no');
|
showInfo('JoinRes = no');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue