Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix scope render, increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
homchom committed Dec 15, 2023
1 parent a0244e2 commit 8f102ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ org.gradle.jvmargs = -Xmx1G

# https://fabricmc.net/develop/

# the minimum version of Fabric Loader required by recode. update only as needed
loaderVersion = 0.14.21

# the mod version, without metadata
modVersion = 0.1.0-beta.8
modVersion = 0.1.0-beta.9

# the current supported Minecraft version
minecraftVersion = 1.20.2

# the minimum version of Fabric Loader required by recode. update only as needed
loaderVersion = 0.14.21

# every version below this should be changed every Minecraft update
# ideally, pick versions without bugs but not versions with unused features (for compatibility)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.github.homchom.recode.mixin.game.ItemStackAccessor
import io.github.homchom.recode.ui.text.mergeStyle
import io.github.homchom.recode.ui.text.toAdventure
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.Style
import net.kyori.adventure.text.serializer.json.JSONComponentSerializer
import net.minecraft.nbt.Tag
import net.minecraft.world.item.ItemStack
Expand All @@ -23,7 +24,7 @@ fun ItemStack.lore(): List<Component> {
for (index in 0..<loreTag.size) {
val text = JSONComponentSerializer.json().deserializeOrNull(loreTag.getString(index)) ?: continue
val style = ItemStackAccessor.getLoreVanillaStyle().toAdventure()
add(text.mergeStyle(style))
add(text.mergeStyle(style, strategy = Style.Merge.Strategy.IF_ABSENT_ON_TARGET))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MHeldItemTooltip {
@Shadow
private ItemStack lastToolHighlight;

// TODO: remove redundant code and improve performance (e.g. don't highlight every iteration)
// TODO: remove redundant code and improve performance
@Inject(method = "renderSelectedItemName", at = @At("HEAD"), cancellable = true)
public void renderSelectedItemName(GuiGraphics guiGraphics, CallbackInfo callbackInfo) {
var renderVarScope = Config.getBoolean("variableScopeView");
Expand Down Expand Up @@ -68,6 +68,7 @@ public void renderSelectedItemName(GuiGraphics guiGraphics, CallbackInfo callbac
}

// render highlighting
// TODO: re-evaluate
/*if (highlightVarSyntax) {
var formatted = VarSyntaxHighlighter.highlight(name.getAsString());
Expand Down

0 comments on commit 8f102ba

Please sign in to comment.