Skip to content

Commit

Permalink
fix entry navigator misreporting token types
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Dec 27, 2023
1 parent 6fea0c9 commit 87b783b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.quiltmc.enigma.gui.element;

import org.quiltmc.enigma.api.EnigmaProject;
import org.quiltmc.enigma.api.translation.mapping.ResolutionStrategy;
import org.quiltmc.enigma.gui.Gui;
import org.quiltmc.enigma.gui.util.GuiUtil;
import org.quiltmc.enigma.api.source.TokenType;
Expand Down Expand Up @@ -147,8 +148,11 @@ public void updateTokenType(Entry<?> target) {
}

private TokenType getTokenType(Entry<?> target) {
// make sure we're checking from the root of the inheritance tree
EnigmaProject project = this.gui.getController().getProject();
return project.getRemapper().getMapping(target).tokenType();
Entry<?> rootEntry = project.getRemapper().getObfResolver().resolveFirstEntry(target, ResolutionStrategy.RESOLVE_ROOT);

return project.getRemapper().getMapping(rootEntry).tokenType();
}

private void updateStatsLabel() {
Expand Down

0 comments on commit 87b783b

Please sign in to comment.