mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-28 07:55:50 +00:00
Fixed regexp to include comma separated String arguments to the renderer call
This commit is contained in:
1 parent
eae1de6698
commit
6bba5f1e7e
3 files changed
+7
-3
No files matched your search
@@ -46,10 +46,10 @@ public class SpecialChars {
|
||||
|
||||
public static final Pattern patternMinecraft = Pattern.compile("(?i)" + MCStyle + "[0-9A-FK-OR]");
|
||||
public static final Pattern patternWaila = Pattern.compile("(?i)(" + WailaStyle + "(?<type>..))");
|
||||
public static final Pattern patternRender = Pattern.compile("(?i)(" + RENDER + "\\{(?<name>.+?)\\})");
|
||||
public static final Pattern patternRender = Pattern.compile("(?i)(" + RENDER + "\\{(?<name>[^,}]*),?(?<args>[^}]*)\\})");
|
||||
public static final Pattern patternTab = Pattern.compile("(?i)" + TAB);
|
||||
public static final Pattern patternRight = Pattern.compile("(?i)" + ALIGNRIGHT);
|
||||
public static final Pattern patternCenter = Pattern.compile("(?i)" + ALIGNCENTER);
|
||||
public static final Pattern patternIcon = Pattern.compile("(?i)(" + WailaStyle + WailaIcon + "(?<type>[0-9A-Z]))");
|
||||
public static final Pattern patternLineSplit = Pattern.compile("(?i)(" + WailaStyle + WailaStyle + "[^" + WailaStyle + "]+|" + WailaStyle + WailaRenderer + "a\\{.+?\\}|[^" + WailaStyle + "]+)");
|
||||
public static final Pattern patternLineSplit = Pattern.compile("(?i)(" + WailaStyle + WailaStyle + "[^" + WailaStyle + "]+|" + WailaStyle + WailaRenderer + "a\\{([^,}]*),?([^}]*)\\}|[^" + WailaStyle + "]+)");
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop}");
|
||||
currenttip.add(RENDER + "{Plip}" + RENDER + "{Plop,thisisatest,222,333}");
|
||||
|
||||
String modName = ModIdentification.nameFromStack(itemStack);
|
||||
if (modName != null && !modName.equals("")){
|
||||
|
||||
@@ -134,6 +134,10 @@ public class Tooltip {
|
||||
|
||||
if (renderMatcher.find()){
|
||||
String renderName = renderMatcher.group("name");
|
||||
String renderArgs = renderMatcher.group("args");
|
||||
|
||||
System.out.printf("%s [ %s ]\n", renderName, renderArgs);
|
||||
|
||||
IWailaTooltipRenderer renderer = ModuleRegistrar.instance().getTooltipRenderer(renderName);
|
||||
if (renderer != null)
|
||||
renderable = new Renderable(renderer, new Point(offsetX, offsetY));
|
||||
|
||||
Reference in new issue
Block a user