diff --git a/assets/map.png b/assets/map.png new file mode 100644 index 00000000..8901e95a Binary files /dev/null and b/assets/map.png differ diff --git a/assets/map_inactive.png b/assets/map_inactive.png new file mode 100644 index 00000000..8184c751 Binary files /dev/null and b/assets/map_inactive.png differ diff --git a/src/Client/WorldMapWindow.java b/src/Client/WorldMapWindow.java index a5534e47..32e69099 100644 --- a/src/Client/WorldMapWindow.java +++ b/src/Client/WorldMapWindow.java @@ -52,13 +52,13 @@ public CameraPoint(float x, float y) { private static Image pointImage; private static Image waypointImage; private static int planeIndex; - public static boolean renderChunkGrid; - public static boolean renderChunkLabelling; private static boolean showLegend; - public static boolean showLabels; - public static boolean showScenery; - public static boolean showIcons; - public static boolean showOtherFloors; + public static boolean showOtherFloors = true; + public static boolean showIcons = true; + public static boolean showScenery = true; + public static boolean showLabels = true; + public static boolean renderChunkGrid = false; + public static boolean renderChunkLabelling = false; private static boolean followPlayer; private static String searchText; private static int searchNumber; diff --git a/src/Game/Renderer.java b/src/Game/Renderer.java index b0b66adb..3f55552c 100644 --- a/src/Game/Renderer.java +++ b/src/Game/Renderer.java @@ -118,6 +118,8 @@ public class Renderer { public static Image image_cursor; public static Image image_gear; public static Image image_gear_gold; + public static Image image_map_inactive; + public static Image image_map; public static Image image_wiki_hbar_inactive_system; public static Image image_wiki_hbar_active_system; public static Image image_wiki_hbar_inactive_jf; @@ -254,6 +256,8 @@ public static void init() { image_cursor = ImageIO.read(Launcher.getResource("/assets/cursor.png")); image_gear = ImageIO.read(Launcher.getResource("/assets/gear.png")); image_gear_gold = ImageIO.read(Launcher.getResource("/assets/gear_gold.png")); + image_map_inactive = ImageIO.read(Launcher.getResource("/assets/map_inactive.png")); + image_map = ImageIO.read(Launcher.getResource("/assets/map.png")); SpecialStar.initializeSpecialStars(); image_small_skull = ImageIO.read(Launcher.getResource("/assets/small_skull.png")); } catch (Exception e) { @@ -1605,6 +1609,36 @@ public static void present(Image image) { Launcher.getConfigWindow().toggleConfigWindow(); } + // Draw map icon + if (Client.login_screen == Client.SCREEN_CLICK_TO_LOGIN + || Client.login_screen == Client.SCREEN_USERNAME_PASSWORD_LOGIN) { + int mapX = width - 10 - image_map_inactive.getWidth(null); + int mapY = 45; + + Rectangle mapBounds = + new Rectangle( + mapX, mapY, image_map_inactive.getWidth(null), image_map_inactive.getHeight(null)); + + // Draw coloured version on hover, de-saturated otherwise + if (MouseHandler.x >= mapBounds.x + && MouseHandler.x <= mapBounds.x + mapBounds.width + && MouseHandler.y >= mapBounds.y + && MouseHandler.y <= mapBounds.y + mapBounds.height) { + g2.drawImage(image_map, mapX, mapY, null); + } else { + g2.drawImage(image_map_inactive, mapX, mapY, null); + } + + // Handle map icon click + if (bufferedMouseClick.getX() >= mapBounds.x + && bufferedMouseClick.getX() <= mapBounds.x + mapBounds.width + && bufferedMouseClick.getY() >= mapBounds.y + && bufferedMouseClick.getY() <= mapBounds.y + mapBounds.height + && bufferedMouseClick.isMouseClicked()) { + Launcher.getWorldMapWindow().toggleWorldMapWindow(); + } + } + // Draw world list drawShadowText(g2, "World (Click to change): ", 80, height - 8, color_text, true, false); for (int i = 1; i <= Settings.WORLDS_TO_DISPLAY; i++) {