mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-23 00:58:33 +02:00
add waiting screen anim and toggle
This commit is contained in:
+33
-8
@@ -45,8 +45,8 @@ const InputHandler = {
|
||||
|
||||
if (isDebugMode || ScreenManager.canEnterGame()) {
|
||||
console.log("✅ Can enter immediately - showing waiting screen");
|
||||
if (typeof Game !== 'undefined' && Game.drawWaitingScreen) {
|
||||
Game.drawWaitingScreen();
|
||||
if (typeof ScreenManager !== 'undefined' && ScreenManager.drawWaitingScreen) {
|
||||
ScreenManager.drawWaitingScreen();
|
||||
}
|
||||
} else {
|
||||
console.log("⏳ Will be queued - showing queue message");
|
||||
@@ -136,8 +136,8 @@ const InputHandler = {
|
||||
socket.emit('chat message', 'enter');
|
||||
|
||||
// Show waiting screen while game starts
|
||||
if (typeof Game !== 'undefined' && Game.drawWaitingScreen) {
|
||||
Game.drawWaitingScreen();
|
||||
if (typeof ScreenManager !== 'undefined' && ScreenManager.drawWaitingScreen) {
|
||||
ScreenManager.drawWaitingScreen();
|
||||
}
|
||||
|
||||
// Add debug message to chat
|
||||
@@ -146,6 +146,13 @@ const InputHandler = {
|
||||
} else {
|
||||
console.log("Debug key pressed but not in debug mode");
|
||||
}
|
||||
} else if (e.key === 'A' || e.key === 'a') {
|
||||
// Toggle animation on waiting screen
|
||||
console.log("🎬 'A' key pressed - toggling animation");
|
||||
e.preventDefault();
|
||||
if (typeof ScreenManager !== 'undefined') {
|
||||
ScreenManager.toggleAnimation();
|
||||
}
|
||||
} else {
|
||||
console.log("Game display has focus, but Game is not active.");
|
||||
}
|
||||
@@ -165,8 +172,8 @@ const InputHandler = {
|
||||
|
||||
if (isDebugMode || ScreenManager.canEnterGame()) {
|
||||
console.log("✅ Can enter immediately - showing waiting screen");
|
||||
if (typeof Game !== 'undefined' && Game.drawWaitingScreen) {
|
||||
Game.drawWaitingScreen();
|
||||
if (typeof ScreenManager !== 'undefined' && ScreenManager.drawWaitingScreen) {
|
||||
ScreenManager.drawWaitingScreen();
|
||||
}
|
||||
} else {
|
||||
console.log("⏳ Will be queued - showing queue message");
|
||||
@@ -195,14 +202,32 @@ const InputHandler = {
|
||||
socket.emit('auto_start');
|
||||
|
||||
console.log("✅ Auto-start requested - showing waiting screen");
|
||||
if (typeof Game !== 'undefined' && Game.drawWaitingScreen) {
|
||||
Game.drawWaitingScreen();
|
||||
if (typeof ScreenManager !== 'undefined' && ScreenManager.drawWaitingScreen) {
|
||||
ScreenManager.drawWaitingScreen();
|
||||
}
|
||||
|
||||
// Add visual feedback to chat
|
||||
$('#messages').append($('<li style="color: #0f0;">').text("🖱️ Game start requested..."));
|
||||
UI.scrollChat();
|
||||
});
|
||||
|
||||
// Add click handling for the animation toggle button
|
||||
$('#animationToggleButton').click(function(e) {
|
||||
console.log("🎬 Animation toggle button clicked");
|
||||
|
||||
if (typeof ScreenManager !== 'undefined' && ScreenManager.toggleAnimation) {
|
||||
ScreenManager.toggleAnimation();
|
||||
// Redraw the waiting screen to reflect the change
|
||||
if (typeof ScreenManager.drawWaitingScreen === 'function') {
|
||||
ScreenManager.drawWaitingScreen();
|
||||
}
|
||||
}
|
||||
|
||||
// Add visual feedback to chat
|
||||
const status = ScreenManager._animationEnabled ? "enabled" : "disabled";
|
||||
$('#messages').append($('<li style="color: #aa0;">').text(`🎬 Animation ${status}`));
|
||||
UI.scrollChat();
|
||||
});
|
||||
},
|
||||
|
||||
setupModeToggle: function() {
|
||||
|
||||
Reference in New Issue
Block a user