Repository navigation
Conversation
gniftygnome
left a comment
There was a problem hiding this comment.
Seems pretty good, really (less ugly than I suspected). If we do end up using the extra map, it should go up top with the other class constants.
|
|
||
| private static Map<String, String> getLinksForDisplay(Map<String, String> modMenuLinks, Map<String, String> fabricApiLinks) { | ||
| LinkedHashMap<String, String> links = new LinkedHashMap<>(); | ||
| fabricApiLinks.entrySet().stream().filter(entry -> !entry.getKey().equals("homepage") && !entry.getKey().equals("issues") && !entry.getKey().equals("sources") /* TODO before merging, should sources have its special case removed? */) |
There was a problem hiding this comment.
If I'm understanding correctly, we should continue to support the existing API (i.e. not rename any modmenu or custom JSON field names). But if this is just a matter of renaming the translation key from modmenu.source to modmenu.sources without any user impact, then I'm fine with that.
There was a problem hiding this comment.
I've left the modmenu.source special case as currently Mod Menu always orders it first and I'm not sure what to do with it
There was a problem hiding this comment.
Also, I have not figured out yet what to do if we don't already have a translation key for a contact, so that's something else that needs to be figured out
| fabricApiLinks.entrySet().stream().filter(entry -> !entry.getKey().equals("homepage") && !entry.getKey().equals("issues") && !entry.getKey().equals("sources") /* TODO before merging, should sources have its special case removed? */) | ||
| .forEach(entry -> | ||
| links.put(/*IDS_TO_TRANSLATION_KEYS.getOrDefault(entry.getKey(), */"modmenu." + entry.getKey()/*)*/, entry.getValue())); | ||
| modMenuLinks.entrySet().stream().filter(entry -> !links.containsKey(entry.getKey())) |
There was a problem hiding this comment.
I'm trying to figure out how I feel about this. I guess the official FMJ versions should take precedence, but will folks be frustrated by us retroactively changing it in older versions? I kind of feel like the 26.3 and earlier versions should prefer the custom value over the FMJ value.
There was a problem hiding this comment.
I will check before marking as ready how many mods use any contacts other than sources, homepage, and issues
| links.putAll(getLinksForDisplay(CustomValueUtil.getStringMap("links", modMenuObject).orElse(new HashMap<>()), metadata.getContact().asMap())); | ||
| allowsUpdateChecks = CustomValueUtil.getBoolean("update_checker", modMenuObject).orElse(true); | ||
| } else { | ||
| links.putAll(getLinksForDisplay(Map.of(), metadata.getContact().asMap())); |
There was a problem hiding this comment.
I'd like to try to consolidate these and maybe get rid of the else but it's a weak preference. It might be worth using local variables for both of the input maps just to make the code clearer.
|
I'll move it there later if it's still needed |
|
I intend to backport this as far back as possible too, maybe possibly to 1.16 or 1.14.4 if it's not too difficult |
|
Building for 1.14 requires some acrobatics. I've done it before but didn't intend to again. :P |
|
There still needs to figured out whether or not the it should be like |
No description provided.