mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-18 14:51:26 +02:00
139 lines
5.9 KiB
HTML
139 lines
5.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Wowgue - A Wownero Roguelike</title>
|
|
<link rel="stylesheet" type="text/css" href="styles/stylesheet.css">
|
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
|
|
<!-- Socket.io -->
|
|
<script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
|
|
|
|
<!-- Initialize socket -->
|
|
<script>
|
|
window.socket = io();
|
|
</script>
|
|
|
|
<!-- Core libraries -->
|
|
<script src="js/jquery-3.4.1.min.js"></script>
|
|
<script src="js/rot.min.js"></script>
|
|
<script src="js/options.js"></script>
|
|
<script src="js/teletype.js"></script>
|
|
|
|
<!-- Modular game components (order matters for dependencies) -->
|
|
<script src="js/displayManager.js"></script>
|
|
<script src="js/screenManager.js"></script>
|
|
<script src="js/renderEngine.js"></script>
|
|
<script src="js/gameState.js"></script>
|
|
<script src="js/game.js"></script>
|
|
|
|
<!-- Other modules -->
|
|
<script src="js/ui.js"></script>
|
|
<script src="js/socketHandlers.js"></script>
|
|
<script src="js/inputHandler.js"></script>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<!-- Header area -->
|
|
<header class="banner">
|
|
<div id="staticbanner">
|
|
<span id="banner"></span><span id="bannercursor">|</span>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Status area for block height -->
|
|
<div class="status">
|
|
<div id="blockHeight">Block Height: <span id="heightValue">Loading...</span></div>
|
|
<div id="connectionStatus">Status: <span id="statusValue">Connecting...</span></div>
|
|
<button id="startButton" style="background: #0a5c0a; color: #ff0; border: 2px solid #0f0; padding: 8px 16px; font-weight: bold; cursor: pointer; margin-top: 5px; display: none;">
|
|
🎮 START GAME
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Game display -->
|
|
<div id="game-display" class="rotdis"></div>
|
|
|
|
<!-- Debug display area (hidden in production) -->
|
|
<div id="debug-display" style="display: none; background: rgba(0,0,0,0.8); color: #0f0; font-family: monospace; font-size: 12px; padding: 10px; margin: 5px; border: 1px solid #333; max-height: 200px; overflow-y: auto;">
|
|
<div><strong>Debug Information:</strong></div>
|
|
<div id="debug-content">Ready...</div>
|
|
</div>
|
|
|
|
<!-- Chat messages area -->
|
|
<div class="chat-container">
|
|
<div id="messageBox">
|
|
<ul id="messages"></ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Chat input in its own row -->
|
|
<div class="input-container">
|
|
<form id="chatForm" action="">
|
|
<input id="chatInput" autocomplete="off" placeholder="Type a command..." />
|
|
<button type="submit">Send</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="footer">
|
|
Wownero Roguelike v0.1.0 | Use WASD or arrow keys to move
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Browser info panel -->
|
|
<div id="browser-info" style="position: fixed; right: 10px; top: 40px; background: rgba(0,0,0,0.7); color: #0f0; padding: 5px; font-family: monospace; font-size: 12px; z-index: 1000; display: none;">
|
|
<div>Browser: <span id="browser-name">checking...</span></div>
|
|
<div>Display: <span id="display-status">checking...</span></div>
|
|
<button onclick="document.getElementById('browser-info').style.display='none'" style="margin-top: 5px; background: #333; border: 1px solid #666; color: white; font-size: 10px; padding: 2px 4px;">
|
|
Close
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Initialize game when ready -->
|
|
<script>
|
|
$(document).ready(function() {
|
|
console.log("Document ready - initializing modules...");
|
|
console.log("Socket available:", !!window.socket);
|
|
console.log("Game object available:", typeof Game !== 'undefined');
|
|
console.log("SocketHandlers available:", typeof SocketHandlers !== 'undefined');
|
|
console.log("UI available:", typeof UI !== 'undefined');
|
|
console.log("InputHandler available:", typeof InputHandler !== 'undefined');
|
|
|
|
// Small delay to ensure all modules are fully loaded
|
|
setTimeout(function() {
|
|
// Initialize Game first
|
|
if (typeof Game !== 'undefined') {
|
|
console.log("Initializing Game...");
|
|
const gameInitResult = Game.init();
|
|
console.log("Game initialization result:", gameInitResult);
|
|
|
|
// Ensure welcome screen is shown after a brief delay
|
|
setTimeout(function() {
|
|
if (gameInitResult && typeof ScreenManager !== 'undefined' && ScreenManager.drawWelcomeScreen) {
|
|
console.log("Ensuring welcome screen is drawn...");
|
|
ScreenManager.drawWelcomeScreen();
|
|
}
|
|
}, 50);
|
|
} else {
|
|
console.error("Game object not found!");
|
|
}
|
|
|
|
// Initialize SocketHandlers (CRITICAL for receiving game_start events!)
|
|
if (typeof SocketHandlers !== 'undefined') {
|
|
console.log("Initializing SocketHandlers...");
|
|
SocketHandlers.init();
|
|
} else {
|
|
console.error("SocketHandlers object not found!");
|
|
}
|
|
|
|
// Initialize InputHandler
|
|
if (typeof InputHandler !== 'undefined') {
|
|
console.log("Initializing InputHandler...");
|
|
InputHandler.init();
|
|
} else {
|
|
console.error("InputHandler object not found!");
|
|
}
|
|
}, 100); // 100ms delay to ensure everything is loaded
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |