Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import at.petrak.hexcasting.api.casting.iota.IotaType;
import at.petrak.hexcasting.api.utils.HexUtils;
import at.petrak.hexcasting.api.utils.NBTHelper;
import at.petrak.hexcasting.api.mod.HexConfig;
import at.petrak.hexcasting.client.ClientTickCounter;
import at.petrak.hexcasting.common.lib.hex.HexIotaTypes;
import net.minecraft.ChatFormatting;
Expand Down Expand Up @@ -107,7 +108,7 @@ static void appendHoverText(IotaHolderItem self, ItemStack stack, List<Component
var cmp = IotaType.getDisplay(datumTag);
components.add(Component.translatable("hexcasting.spelldata.onitem", cmp));

if (flag.isAdvanced()) {
if (flag.isAdvanced() && (HexConfig.client() == null || HexConfig.client().advancedTooltipsShowsIotaNBT())) {
components.add(Component.literal("").append(NbtUtils.toPrettyComponent(datumTag)));
}
} else if (NBTHelper.hasString(stack, IotaHolderItem.TAG_OVERRIDE_VISUALLY)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public interface ClientConfigAccess {

boolean alwaysShowListCommas();

boolean advancedTooltipsShowsIotaNBT();

boolean staticActiveSlates();

boolean DEFAULT_CTRL_TOGGLES_OFF_STROKE_ORDER = false;
Expand All @@ -62,6 +64,7 @@ public interface ClientConfigAccess {
double DEFAULT_GRID_SNAP_THRESHOLD = 0.5;
boolean DEFAULT_CLICKING_TOGGLES_DRAWING = false;
boolean DEFAULT_ALWAYS_SHOW_LIST_COMMAS = false;
boolean DEFAULT_ADVANCED_TOOLTIPS_SHOWS_IOTA_NBT = false;
boolean DEFAULT_STATIC_ACTIVE_SLATES = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,14 @@
"": "Always Show List Commas",
"@Tooltip": "Whether all iota types should be comma-separated when displayed in lists (by default, pattern iotas do not use commas)",
},
advancedTooltipsShowsIotaNBT: {
"": "Advanced Tooltips Shows Iota NBT",
"@Tooltip": "Whether enabling advanced tooltips (F3+H) should display the full NBT of iotas stored in items like foci and spellbooks",
},
staticActiveSlates: {
"": "Static Active Slates",
"@Tooltip": "Whether patterns on active slates should be rendered without wobble (improves performance with lots of active slates)",
}
},
},

server: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public static final class Client implements HexConfig.ClientConfigAccess, Config
@ConfigEntry.Gui.Tooltip
private boolean alwaysShowListCommas = DEFAULT_ALWAYS_SHOW_LIST_COMMAS;
@ConfigEntry.Gui.Tooltip
private boolean advancedTooltipsShowsIotaNBT = DEFAULT_ADVANCED_TOOLTIPS_SHOWS_IOTA_NBT;
@ConfigEntry.Gui.Tooltip
private boolean staticActiveSlates = DEFAULT_STATIC_ACTIVE_SLATES;

@Override
Expand Down Expand Up @@ -183,7 +185,14 @@ public boolean alwaysShowListCommas() {
}

@Override
public boolean staticActiveSlates() { return staticActiveSlates; }
public boolean advancedTooltipsShowsIotaNBT() {
return advancedTooltipsShowsIotaNBT;
}

@Override
public boolean staticActiveSlates() {
return staticActiveSlates;
}
}

@Config(name = "server")
Expand Down
26 changes: 19 additions & 7 deletions Forge/src/main/java/at/petrak/hexcasting/forge/ForgeHexConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static class Client implements HexConfig.ClientConfigAccess {
private static ForgeConfigSpec.DoubleValue gridSnapThreshold;
private static ForgeConfigSpec.BooleanValue clickingTogglesDrawing;
private static ForgeConfigSpec.BooleanValue alwaysShowListCommas;
private static ForgeConfigSpec.BooleanValue advancedTooltipsShowsIotaNBT;
private static ForgeConfigSpec.BooleanValue staticActiveSlates;

public Client(ForgeConfigSpec.Builder builder) {
Expand All @@ -106,14 +107,18 @@ public Client(ForgeConfigSpec.Builder builder) {
"means 50% of the way.")
.defineInRange("gridSnapThreshold", DEFAULT_GRID_SNAP_THRESHOLD, 0.5, 1.0);
clickingTogglesDrawing = builder.comment(
"Whether you click to start and stop drawing instead of clicking and dragging")
.define("clickingTogglesDrawing", DEFAULT_CLICKING_TOGGLES_DRAWING);
"Whether you click to start and stop drawing instead of clicking and dragging")
.define("clickingTogglesDrawing", DEFAULT_CLICKING_TOGGLES_DRAWING);
alwaysShowListCommas = builder.comment(
"Whether all iota types should be comma-separated in lists (by default, pattern iotas don't use commas)")
.define("alwaysShowListCommas", DEFAULT_ALWAYS_SHOW_LIST_COMMAS);
"Whether all iota types should be comma-separated in lists (by default, pattern iotas don't use commas)")
.define("alwaysShowListCommas", DEFAULT_ALWAYS_SHOW_LIST_COMMAS);
advancedTooltipsShowsIotaNBT = builder.comment(
"Whether enabling advanced tooltips (F3+H) should display the full NBT of iotas stored in items " +
"like foci and spellbooks")
.define("advancedTooltipsShowsIotaNBT", DEFAULT_ADVANCED_TOOLTIPS_SHOWS_IOTA_NBT);
staticActiveSlates = builder.comment(
"Whether patterns on active slates should be rendered without wobble (improves performance with lots of active slates)")
.define("staticActiveSlates", DEFAULT_STATIC_ACTIVE_SLATES);
"Whether patterns on active slates should be rendered without wobble (improves performance with lots of active slates)")
.define("staticActiveSlates", DEFAULT_STATIC_ACTIVE_SLATES);
}

@Override
Expand Down Expand Up @@ -152,7 +157,14 @@ public boolean alwaysShowListCommas() {
}

@Override
public boolean staticActiveSlates() { return staticActiveSlates.get(); }
public boolean advancedTooltipsShowsIotaNBT() {
return advancedTooltipsShowsIotaNBT.get();
}

@Override
public boolean staticActiveSlates() {
return staticActiveSlates.get();
}
}

public static class Server implements HexConfig.ServerConfigAccess {
Expand Down
Loading