Skip to content
Open
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 @@ -51,12 +51,15 @@ public interface ClientConfigAccess {

boolean alwaysShowListCommas();

boolean advancedTooltipsShowsIotaNBT();

boolean DEFAULT_CTRL_TOGGLES_OFF_STROKE_ORDER = false;
boolean DEFAULT_INVERT_SPELLBOOK_SCROLL = false;
boolean DEFAULT_INVERT_ABACUS_SCROLL = false;
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;
}

public interface ServerConfigAccess {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@
"": "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",
}
},

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

@Override
public void validatePostLoad() throws ValidationException {
Expand Down Expand Up @@ -173,6 +175,9 @@ public boolean clickingTogglesDrawing() {
public boolean alwaysShowListCommas() {
return alwaysShowListCommas;
}

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

@Config(name = "server")
Expand Down
16 changes: 12 additions & 4 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;

public Client(ForgeConfigSpec.Builder builder) {
ctrlTogglesOffStrokeOrder = builder.comment(
Expand All @@ -102,11 +103,15 @@ 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);
}

@Override
Expand Down Expand Up @@ -138,6 +143,9 @@ public boolean clickingTogglesDrawing() {
public boolean alwaysShowListCommas() {
return alwaysShowListCommas.get();
}

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

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