Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
viciscat committed Apr 2, 2024
1 parent 1efc405 commit a0590e5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public static class General {
@SerialEntry
public boolean betterPartyFinder = true;

@SerialEntry
public boolean fancyCraftingUi = true;

@SerialEntry
public boolean backpackPreviewWithoutShift = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
newValue -> config.general.compactorDeletorPreview = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.fancyCraftingUi"))
.binding(defaults.general.fancyCraftingUi,
() -> config.general.fancyCraftingUi,
newValue -> config.general.fancyCraftingUi = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.hideEmptyTooltips"))
.binding(defaults.general.hideEmptyTooltips,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
public interface HandledScreenProviderMixin<T extends ScreenHandler> {
@Inject(method = "open", at = @At("HEAD"), cancellable = true)
default void skyblocker$open(Text name, ScreenHandlerType<T> type, MinecraftClient client, int id, CallbackInfo ci) {
if (!SkyblockerConfigManager.get().general.betterPartyFinder) return;
ClientPlayerEntity player = client.player;
if (player == null) return;
if (!Utils.isOnSkyblock()) return;
T screenHandler = type.create(id, player.getInventory());
if (screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && PartyFinderScreen.possibleInventoryNames.contains(name.getString().toLowerCase())) {
if (SkyblockerConfigManager.get().general.betterPartyFinder && screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && PartyFinderScreen.possibleInventoryNames.contains(name.getString().toLowerCase())) {
if (client.currentScreen != null) {
String lowerCase = client.currentScreen.getTitle().getString().toLowerCase();
if (lowerCase.contains("group builder")) return;
Expand All @@ -45,7 +45,7 @@ public interface HandledScreenProviderMixin<T extends ScreenHandler> {
}

ci.cancel();
} else if (Utils.isOnSkyblock() && screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && name.getString().toLowerCase().contains("craft item")) {
} else if (SkyblockerConfigManager.get().general.fancyCraftingUi && screenHandler instanceof GenericContainerScreenHandler containerScreenHandler && name.getString().toLowerCase().contains("craft item")) {
SkyblockCraftingTableScreenHandler skyblockCraftingTableScreenHandler = new SkyblockCraftingTableScreenHandler(containerScreenHandler, player.getInventory());
client.player.currentScreenHandler = skyblockCraftingTableScreenHandler;
client.setScreen(new SkyblockCraftingTableScreen(skyblockCraftingTableScreenHandler, player.getInventory(), Text.literal("Craft Item")));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"text.autoconfig.skyblocker.option.general.searchOverlay.enableCommands.@Tooltip": "Opens the bazaar search with \"/bzs\" and auction house with \"/ahs\". A re-log is required for this setting to be updated.",
"text.autoconfig.skyblocker.option.general.searchOverlay.historyLabel": "History:",
"text.autoconfig.skyblocker.option.general.betterPartyFinder": "Better Party Finder",
"text.autoconfig.skyblocker.option.general.fancyCraftingUi": "Fancy Crafting UI",
"skyblocker.itemTooltip.nullMessage": "§cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log",
"skyblocker.itemTooltip.noData": "§cNo Data",

Expand Down

0 comments on commit a0590e5

Please sign in to comment.