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
|
||||
bg-white
|
||||
rounded-xl
|
||||
shadow-xl
|
||||
w-200
|
||||
h-33
|
||||
p-6
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="game-modal" class="gamePopup hidden">
|
||||
<div class="popUpMessage" >
|
||||
<div class="popUpMessage">
|
||||
<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>
|
||||
<button id="close-modal-message" class="btn-style absolute bottom-67 right-12">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -422,17 +422,19 @@ sendtextbox.addEventListener("keydown", (event) => {
|
|||
}
|
||||
});
|
||||
|
||||
chatButton!.addEventListener("click", async () => {
|
||||
chatButton!.addEventListener("click",() => {
|
||||
if (chatBox.classList.contains("hidden")) {
|
||||
chatBox.classList.toggle("hidden");
|
||||
overlay.classList.add("opacity-60");
|
||||
await windowStateVisable();
|
||||
|
||||
windowStateVisable();
|
||||
let socket = window.__state.chatSock;
|
||||
if (!socket) return;
|
||||
connected(socket);
|
||||
|
||||
} else {
|
||||
chatBox.classList.toggle("hidden");
|
||||
overlay.classList.remove("opacity-60");
|
||||
await windowStateHidden();
|
||||
windowStateHidden();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export async function openMessagePopup(message: any) {
|
|||
if (modalmessage) {
|
||||
const messageElement = document.createElement("div");
|
||||
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.scrollTop = modalmessage.scrollHeight;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { getUser as getSelfUser, type User } from "@app/auth";
|
|||
import { isNullish } from "@app/utils";
|
||||
import client from "@app/api";
|
||||
import "./pong.css";
|
||||
import { quitChat } from "@app/chat/chatHelperFunctions/quitChat";
|
||||
|
||||
declare module "ft_state" {
|
||||
interface State {
|
||||
|
|
@ -249,6 +250,7 @@ function pongClient(
|
|||
switch (res) {
|
||||
case JoinRes.yes :
|
||||
showInfo('JoinRes = yes');
|
||||
quitChat();
|
||||
break;
|
||||
case JoinRes.no :
|
||||
showInfo('JoinRes = no');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue