Skyblocker icon indicating copy to clipboard operation
Skyblocker copied to clipboard

Fancy Dungeon Map

Open kevinthegreat1 opened this issue 9 months ago • 10 comments

  • Render player heads in the dungeon map
  • Add map to the leap menu
  • More to come

Note: this screenshot is taken on a low gui scale

Fancy Dungeon Map

kevinthegreat1 avatar Apr 03 '25 04:04 kevinthegreat1

Can I ask for a thing? Make it show arrow to where player is looking iirc custom fancy maps often overlook that despite this. It may help tell where players are headed and it is a thing normal vanilla map can do

also it can (and probably should) be toggleable

Fluboxer avatar Apr 03 '25 08:04 Fluboxer

The game freezes when starting. The avatars won't be displayed if teammates are too far. Do I need to set the render distance and simulation distance higher?

AC19970 avatar Apr 03 '25 13:04 AC19970

Fixed the lag spike when starting the dungeon and added a little direction indicator. The problem with players going too far is a little more complicated, and I will look into it later.

kevinthegreat1 avatar Apr 03 '25 18:04 kevinthegreat1

Got some ideas too. It would be nice if you could consider them. :)

  1. An option to not render head of myself. Pretty neat and makes it easier for me to find my direction.
// src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMap.java
@@ -153,6 +153,7 @@
 		for (Map.Entry<String, MapDecoration> mapDecoration : ((MapStateAccessor) state).getDecorations().entrySet()) {
 			PlayerRenderState player = PlayerRenderState.of(mapDecoration);
 			if (player == null) continue;
+			if (player.uuid().equals(MinecraftClient.getInstance().player.getUuid())) continue;
 			DungeonClass dungeonClass = DungeonPlayerManager.getClassFromPlayer(player.name());
  1. Not render the map and center the leap overlay when in boss fight. Might be useful for leaping by just move mouse to different directions and do subconscious clicking.
// src/main/java/de/hysky/skyblocker/skyblock/dungeon/LeapOverlay.java
@@ -68,7 +69,11 @@
 		}
 
 		gridWidget.refreshPositions();
-		SimplePositioningWidget.setPos(gridWidget, 0, 0, this.width, this.height, 0.5f, 0.75f);
+		float relativeY = 0.5f;
+		if (DungeonManager.isClearingDungeon()) {
+			relativeY = 0.75f;
+		}
+		SimplePositioningWidget.setPos(gridWidget, 0, 0, this.width, this.height, 0.5f, relativeY);
 		gridWidget.forEachChild(this::addDrawableChild);
 	}
 
@@ -109,10 +114,12 @@
 	public void render(DrawContext context, int mouseX, int mouseY, float delta) {
 		super.render(context, mouseX, mouseY, delta);
 
-		int x = (width >> 1) - 64;
-		int y = (height >> 2) - 64;
-		hovered = DungeonMap.render(context, x, y, 1, true, mouseX - x, mouseY - y, hoveredElement(mouseX, mouseY).filter(PlayerButton.class::isInstance).map(PlayerButton.class::cast).map(p -> p.reference.uuid()).orElse(null));
-		context.drawBorder(x, y, 128, 128, -1);
+		if (DungeonManager.isClearingDungeon()) {
+			int x = (width >> 1) - 64;
+			int y = (height >> 2) - 64;
+			hovered = DungeonMap.render(context, x, y, 1, true, mouseX - x, mouseY - y, hoveredElement(mouseX, mouseY).filter(PlayerButton.class::isInstance).map(PlayerButton.class::cast).map(p -> p.reference.uuid()).orElse(null));
+			context.drawBorder(x, y, 128, 128, -1);
+		}
 	}
  1. And by the way, pressing E (inventory key) currently does not close the leap overlay. Would make sense to implement it.
// src/main/java/de/hysky/skyblocker/skyblock/dungeon/LeapOverlay.java
@@ -142,6 +149,19 @@
 		}
 	}
 
+	@Override
+	public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
+		boolean handled = super.keyPressed(keyCode, scanCode, modifiers);
+		if (handled) {
+			return true;
+		}
+		if (MinecraftClient.getInstance().options.inventoryKey.matchesKey(keyCode, scanCode)) {
+			this.close();
+			return true;
+		}
+		return false;
+	}
+

layou233 avatar Apr 06 '25 17:04 layou233

Note to self: one more bug, the tracking gets messed up when a player dyes. The solution should be to limit matches to the previous 100 or something.

kevinthegreat1 avatar Apr 07 '25 21:04 kevinthegreat1

Map<String, Table<Pair<UUID, String>, Long, MutableInt>> to sort by timestamp as well?

kevinthegreat1 avatar Apr 07 '25 22:04 kevinthegreat1

All bugs should have been fixed.

This could benefit from a dfu. This currently resets dungeons config.

kevinthegreat1 avatar Apr 08 '25 20:04 kevinthegreat1

All bugs should have been fixed.

This could benefit from a dfu. This currently resets dungeons config.

There is no point, I doubt many people would ever be turning off the leap overlay to begin with.

AzureAaron avatar Apr 09 '25 03:04 AzureAaron

There is no point, I doubt many people would ever be turning off the leap overlay to begin with.

The problem is this reset all dungeons config, unless we can think of a different name for the spiritLeapOverlay field.

kevinthegreat1 avatar Apr 10 '25 14:04 kevinthegreat1

517fb25b363f42ca3853f5199683507e7ba3c375 hides all arrows on the map and breaks the intended purpose of "Show Self Head" option. 😢

layou233 avatar Apr 28 '25 19:04 layou233

@kevinthegreat1 I was doing some research on how to implement puzzle names maybe? From what I gathered hypixel names them from tab goint left to rigth-top to bottom having the first one more priority so ig that might be useful

Teyxos avatar Jul 01 '25 08:07 Teyxos

image In a map like these image And these three puzzles top one would be three weirdos, below that is water board and the most rigth one is creeper

Teyxos avatar Jul 01 '25 08:07 Teyxos

If not more than 1 puzzle room gets updated from tab at the same time just apply it to the one thats discovered this was something I was thinking if you wanna implement it when multiple rooms get discovered at the same time

Teyxos avatar Jul 01 '25 08:07 Teyxos

I just tried to move my HUD midrun because of this: изображение

Opened config, looked up HUD, clicked on edit and at moment I clicked 2nd tab it crashed Crash log: https://mclo.gs/DCsMFB0 here's a part of log when it crashed (its a bit different from crash log)

Fluboxer avatar Jul 12 '25 13:07 Fluboxer

@Fluboxer were you playing with aaron? It can't find AzureAaron's uuid for some reason. I have fixed the crash.

kevinthegreat1 avatar Jul 13 '25 06:07 kevinthegreat1

Seems to be tab hud stuff messing with the player list. I'll leave that for tab hud to fix.

kevinthegreat1 avatar Jul 13 '25 06:07 kevinthegreat1

@Fluboxer were you playing with aaron? It can't find AzureAaron's uuid for some reason. I have fixed the crash.

nope. Hence why I included it as it tried to look for a player that was never here

Fluboxer avatar Jul 13 '25 11:07 Fluboxer

When nick is enabled, the avatar cannot be displayed properly.

AC19970 avatar Jul 19 '25 02:07 AC19970

When nick is enabled, the avatar cannot be displayed properly.

I checked the code, and DungeonPlayerManager seems to never worked with nicks. I think we need some way of getting the current player's nick.

kevinthegreat1 avatar Jul 26 '25 14:07 kevinthegreat1