mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-12-02 11:54:04 +01:00
fix transparency
This commit is contained in:
+611
-748
File diff suppressed because it is too large
Load Diff
+12
-10
@@ -23,12 +23,13 @@ tileSet.onload = function() {
|
||||
|
||||
tileSet.onerror = function() {
|
||||
console.error("❌ Failed to load tileset image!");
|
||||
alert("Tileset image failed to load. Switching to ASCII mode.");
|
||||
alert("Tileset image failed to load. Game will attempt to use ASCII mode.");
|
||||
window.globalTileSetStatus = "error"; // Set a status for Game.js to check if needed
|
||||
|
||||
// Force ASCII mode when tileset fails to load
|
||||
if (typeof Game !== 'undefined' && Game._display) {
|
||||
Game.switchToAsciiMode();
|
||||
}
|
||||
// REMOVED: if (typeof Game !== 'undefined' && Game._display) {
|
||||
// REMOVED: Game.switchToAsciiMode();
|
||||
// REMOVED: }
|
||||
};
|
||||
|
||||
// Try different possible paths (to handle serving from different directories)
|
||||
@@ -45,12 +46,13 @@ setTimeout(function() {
|
||||
tileSet.src = "/tiles.png"; // Try from root
|
||||
|
||||
setTimeout(function() {
|
||||
if (!tileSetLoaded) {
|
||||
if (!tileSetLoaded && window.globalTileSetStatus !== "error") { // Check if error already handled
|
||||
console.error("Failed to load tileset after trying multiple paths");
|
||||
alert("Could not load tileset. Switching to ASCII mode.");
|
||||
if (typeof Game !== 'undefined' && Game._display) {
|
||||
Game.switchToAsciiMode();
|
||||
}
|
||||
alert("Could not load tileset. Game will attempt to use ASCII mode.");
|
||||
window.globalTileSetStatus = "error"; // Set a status
|
||||
// REMOVED: if (typeof Game !== 'undefined' && Game._display) {
|
||||
// REMOVED: Game.switchToAsciiMode();
|
||||
// REMOVED: }
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
@@ -60,7 +62,7 @@ setTimeout(function() {
|
||||
|
||||
var options = {
|
||||
layout: "tile",
|
||||
bg: "#000", // Black background instead of transparent for better visibility
|
||||
bg: "transparent", // Black background instead of transparent for better visibility
|
||||
// Adjusted dimensions for ~800x600 display
|
||||
width: 25, // 25 tiles * 32px/tile = 800px
|
||||
height: 19, // 19 tiles * 32px/tile = 608px
|
||||
|
||||
Reference in New Issue
Block a user