From d68c61410c00148a4e78d65949ca40ec1e31876e Mon Sep 17 00:00:00 2001 From: msg-programs Date: Sun, 13 Aug 2023 21:54:53 +0200 Subject: Rework some dungeon screens from the rp, fix collideWith op to make them work correctly --- .../screenbuilder/pipeline/CollideStage.java | 8 ++-- .../assets/skyblocker/tabhud/screen_b/dungeon.json | 17 +++---- .../assets/skyblocker/tabhud/standard/dungeon.json | 52 +++++++++++++--------- 3 files changed, 45 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screenbuilder/pipeline/CollideStage.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screenbuilder/pipeline/CollideStage.java index 187dc9f9..5f4cb1c9 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screenbuilder/pipeline/CollideStage.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/screenbuilder/pipeline/CollideStage.java @@ -70,7 +70,7 @@ public class CollideStage extends PipelineStage { int yMin = w.getY(); int yMax = w.getY() + w.getHeight(); - int xCor = screenW / 2; + int xCor = screenW; for (Widget other : secondary) { if (other.getY() + other.getHeight() + ScreenConst.WIDGET_PAD < yMin) { @@ -93,7 +93,7 @@ public class CollideStage extends PipelineStage { int yMin = w.getY(); int yMax = w.getY() + w.getHeight(); - int xCor = screenW / 2; + int xCor = 0; for (Widget other : secondary) { if (other.getY() + other.getHeight() + ScreenConst.WIDGET_PAD < yMin) { @@ -116,7 +116,7 @@ public class CollideStage extends PipelineStage { int xMin = w.getX(); int xMax = w.getX() + w.getWidth(); - int yCor = screenH / 2; + int yCor = screenH; for (Widget other : secondary) { if (other.getX() + other.getWidth() + ScreenConst.WIDGET_PAD < xMin) { @@ -139,7 +139,7 @@ public class CollideStage extends PipelineStage { int xMin = w.getX(); int xMax = w.getX() + w.getWidth(); - int yCor = screenH / 2; + int yCor = 0; for (Widget other : secondary) { if (other.getX() + other.getWidth() + ScreenConst.WIDGET_PAD < xMin) { diff --git a/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/screen_b/dungeon.json b/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/screen_b/dungeon.json index 8bb6181b..78fb6a25 100644 --- a/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/screen_b/dungeon.json +++ b/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/screen_b/dungeon.json @@ -29,25 +29,26 @@ "layout": [ { "op": "stack", - "direction": "vertical", - "align": "top", + "direction": "horizontal", + "align": "center", "apply_to": ["dpw1", "dpw2", "dpw3"] }, { "op": "stack", - "direction": "vertical", - "align": "top", + "direction": "horizontal", + "align": "center", "apply_to": ["dpw4", "dpw5"] }, { "op": "align", - "reference": "leftOfCenter", + "reference": "top", "apply_to": ["dpw1", "dpw2", "dpw3"] }, { - "op": "align", - "reference": "rightOfCenter", - "apply_to": ["dpw4", "dpw5"] + "op": "collideAgainst", + "direction": "bot", + "widgets": ["dpw4", "dpw5"], + "colliders": ["dpw1", "dpw2", "dpw3"] } ] } \ No newline at end of file diff --git a/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/standard/dungeon.json b/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/standard/dungeon.json index c2c9ce60..ac34f22a 100644 --- a/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/standard/dungeon.json +++ b/src/main/resources/resourcepacks/default_top/assets/skyblocker/tabhud/standard/dungeon.json @@ -2,51 +2,63 @@ "widgets":[ { "name": "DungeonDownedWidget", - "alias": "ddow" + "alias": "downed" }, { "name": "DungeonDeathWidget", - "alias": "ddew" + "alias": "death" }, { "name": "DungeonSecretWidget", - "alias": "dscw" + "alias": "secret" }, { "name": "DungeonServerWidget", - "alias": "dsrw" + "alias": "server" }, { "name": "DungeonPuzzleWidget", - "alias": "dpuw" + "alias": "puzzle" }, { "name": "DungeonBuffWidget", - "alias": "dbw" + "alias": "buffs" } ], "layout": [ - { - "op": "stack", - "direction": "vertical", - "align": "top", - "apply_to": ["ddow", "ddew", "dbw"] - }, - { - "op": "stack", - "direction": "vertical", - "align": "top", - "apply_to": ["dsrw", "dpuw", "dscw"] - }, { "op": "align", "reference": "leftOfCenter", - "apply_to": ["ddow", "ddew", "dbw"] + "apply_to": ["death", "buffs"] }, { "op": "align", "reference": "rightOfCenter", - "apply_to": ["dsrw", "dpuw", "dscw"] + "apply_to": ["server", "puzzle"] + }, + { + "op": "collideAgainst", + "direction": "left", + "widgets": ["downed"], + "colliders": ["death"] + }, + { + "op": "collideAgainst", + "direction": "right", + "widgets": ["secret"], + "colliders": ["server"] + }, + { + "op": "collideAgainst", + "direction": "bot", + "widgets": ["buffs"], + "colliders": ["death", "downed"] + }, + { + "op": "collideAgainst", + "direction": "bot", + "widgets": ["puzzle"], + "colliders": ["secret", "server"] } ] } \ No newline at end of file -- cgit