Skip to content

Commit

Permalink
Merge pull request #614 from viciscat/ah-gui-new
Browse files Browse the repository at this point in the history
Fancy Auctions Browser: The Sequel
  • Loading branch information
viciscat authored Apr 13, 2024
2 parents 5041bde + 27e9e7b commit ddd068b
Show file tree
Hide file tree
Showing 40 changed files with 1,665 additions and 157 deletions.
265 changes: 138 additions & 127 deletions src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ public static class General {
@SerialEntry
public SearchOverlay searchOverlay = new SearchOverlay();

@SerialEntry
public FancyAuctionHouse fancyAuctionHouse = new FancyAuctionHouse();

@SerialEntry
public List<Integer> lockedSlots = new ArrayList<>();

Expand Down Expand Up @@ -406,138 +409,11 @@ public static class QuiverWarning {
public boolean enableQuiverWarningAfterDungeon = true;
}

public static class Hitbox {
@SerialEntry
public boolean oldFarmlandHitbox = false;

@SerialEntry
public boolean oldLeverHitbox = false;
}

public static class TitleContainer {
@SerialEntry
public float titleContainerScale = 100;

@SerialEntry
public int x = 540;

@SerialEntry
public int y = 10;

@SerialEntry
public Direction direction = Direction.HORIZONTAL;

@SerialEntry
public Alignment alignment = Alignment.MIDDLE;
}

public enum Direction {
HORIZONTAL, VERTICAL;

@Override
public String toString() {
return switch (this) {
case HORIZONTAL -> "Horizontal";
case VERTICAL -> "Vertical";
};
}
}

public enum Alignment {
LEFT, RIGHT, MIDDLE;

@Override
public String toString() {
return switch (this) {
case LEFT -> "Left";
case RIGHT -> "Right";
case MIDDLE -> "Middle";
};
}
}

public static class TeleportOverlay {
@SerialEntry
public boolean enableTeleportOverlays = true;

@SerialEntry
public boolean enableWeirdTransmission = true;

@SerialEntry
public boolean enableInstantTransmission = true;

@SerialEntry
public boolean enableEtherTransmission = true;

@SerialEntry
public boolean enableSinrecallTransmission = true;

@SerialEntry
public boolean enableWitherImpact = true;
}

public static class FlameOverlay {
@SerialEntry
public int flameHeight = 100;

@SerialEntry
public int flameOpacity = 100;
}

public static class SearchOverlay {
@SerialEntry
public boolean enableBazaar = true;

@SerialEntry
public boolean enableAuctionHouse = true;

@SerialEntry
public boolean keepPreviousSearches = false;

@SerialEntry
public int maxSuggestions = 3;

@SerialEntry
public int historyLength = 3;

@SerialEntry
public boolean enableCommands = false;

@SerialEntry
public List<String> bazaarHistory = new ArrayList<>();

@SerialEntry
public List<String> auctionHistory = new ArrayList<>();
}

public static class RichPresence {
@SerialEntry
public boolean enableRichPresence = false;

@SerialEntry
public Info info = Info.LOCATION;

@SerialEntry
public boolean cycleMode = false;

@SerialEntry
public String customMessage = "Playing Skyblock";
}

public static class ItemList {
@SerialEntry
public boolean enableItemList = true;
}

public enum Average {
ONE_DAY, THREE_DAY, BOTH;

@Override
public String toString() {
return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name());
}
}

public static class ItemTooltip {
@SerialEntry
public boolean enableNPCPrice = true;
Expand Down Expand Up @@ -570,6 +446,15 @@ public static class ItemTooltip {
public boolean enableAccessoriesHelper = true;
}

public enum Average {
ONE_DAY, THREE_DAY, BOTH;

@Override
public String toString() {
return I18n.translate("text.autoconfig.skyblocker.option.general.itemTooltip.avg." + name());
}
}

public static class ItemInfoDisplay {
@SerialEntry
public boolean attributeShardInfo = true;
Expand Down Expand Up @@ -651,6 +536,118 @@ public static class SpecialEffects {
public boolean rareDungeonDropEffects = true;
}

public static class Hitbox {
@SerialEntry
public boolean oldFarmlandHitbox = false;

@SerialEntry
public boolean oldLeverHitbox = false;
}

public static class TitleContainer {
@SerialEntry
public float titleContainerScale = 100;

@SerialEntry
public int x = 540;

@SerialEntry
public int y = 10;

@SerialEntry
public Direction direction = Direction.HORIZONTAL;

@SerialEntry
public Alignment alignment = Alignment.MIDDLE;
}

public enum Direction {
HORIZONTAL, VERTICAL;

@Override
public String toString() {
return switch (this) {
case HORIZONTAL -> "Horizontal";
case VERTICAL -> "Vertical";
};
}
}

public enum Alignment {
LEFT, RIGHT, MIDDLE;

@Override
public String toString() {
return switch (this) {
case LEFT -> "Left";
case RIGHT -> "Right";
case MIDDLE -> "Middle";
};
}
}

public static class TeleportOverlay {
@SerialEntry
public boolean enableTeleportOverlays = true;

@SerialEntry
public boolean enableWeirdTransmission = true;

@SerialEntry
public boolean enableInstantTransmission = true;

@SerialEntry
public boolean enableEtherTransmission = true;

@SerialEntry
public boolean enableSinrecallTransmission = true;

@SerialEntry
public boolean enableWitherImpact = true;
}

public static class FlameOverlay {
@SerialEntry
public int flameHeight = 100;

@SerialEntry
public int flameOpacity = 100;
}

public static class SearchOverlay {
@SerialEntry
public boolean enableBazaar = true;

@SerialEntry
public boolean enableAuctionHouse = true;

@SerialEntry
public boolean keepPreviousSearches = false;

@SerialEntry
public int maxSuggestions = 3;

@SerialEntry
public int historyLength = 3;

@SerialEntry
public boolean enableCommands = false;

@SerialEntry
public List<String> bazaarHistory = new ArrayList<>();

@SerialEntry
public List<String> auctionHistory = new ArrayList<>();
}

public static class FancyAuctionHouse {
@SerialEntry
public boolean enabled = true;

@SerialEntry
public boolean highlightCheapBIN = true;
}

public static class Locations {
@SerialEntry
public Barn barn = new Barn();
Expand Down Expand Up @@ -1242,6 +1239,20 @@ public static class ChatRuleConfig {
public int announcementScale = 3;
}

public static class RichPresence {
@SerialEntry
public boolean enableRichPresence = false;

@SerialEntry
public Info info = Info.LOCATION;

@SerialEntry
public boolean cycleMode = false;

@SerialEntry
public String customMessage = "Playing Skyblock";
}

public enum Info {
PURSE, BITS, LOCATION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,26 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.controller(ConfigUtils::createBooleanController)
.build())
.build())

// Fancy Auction House
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse"))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse.enabled"))
.binding(defaults.general.fancyAuctionHouse.enabled,
() -> config.general.fancyAuctionHouse.enabled,
newValue -> config.general.fancyAuctionHouse.enabled = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.betterAuctionHouse.highlightUnderAvgPrice"))
.binding(defaults.general.fancyAuctionHouse.highlightCheapBIN,
() -> config.general.fancyAuctionHouse.highlightCheapBIN,
newValue -> config.general.fancyAuctionHouse.highlightCheapBIN = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.build())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.mojang.authlib.GameProfile;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.auction.AuctionViewScreen;
import de.hysky.skyblocker.skyblock.auction.EditBidPopup;
import de.hysky.skyblocker.skyblock.dungeon.partyfinder.PartyFinderScreen;
import de.hysky.skyblocker.skyblock.item.HotbarSlotLock;
import de.hysky.skyblocker.skyblock.item.ItemProtection;
Expand Down Expand Up @@ -58,6 +60,11 @@ public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile) {
return;
}

if (client.currentScreen instanceof AuctionViewScreen auctionViewScreen) {
this.client.setScreen(new EditBidPopup(auctionViewScreen, sign, front, auctionViewScreen.minBid));
callbackInfo.cancel();
}

// Search Overlay
if (client.currentScreen != null) {
if (SkyblockerConfigManager.get().general.searchOverlay.enableAuctionHouse && client.currentScreen.getTitle().getString().toLowerCase().contains("auction")) {
Expand Down
Loading

0 comments on commit ddd068b

Please sign in to comment.