Skip to content
Merged
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 @@ -20,6 +20,7 @@
import net.minecraft.client.gui.screens.CreditsAndAttributionScreen;
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.util.FormattedCharSequence;

import java.net.URI;
Expand Down Expand Up @@ -243,13 +244,36 @@ private void rebuildUI() {
for (var contributor : role.getValue()) {
indent = 16;

for (var line : textRenderer.split(Component.literal(contributor), wrapWidth - 24)) {
ContactInformation contact = mod.getContact(contributor);
if (contact != null && contact.get("email").isPresent()) {
this.addEntry(new MailableContactEntry(line, contact.get("email").get(), indent));
boolean hasLink = false;
ContactInformation contact = mod.getContact(contributor);

if (contact != null) {
hasLink = contact.get("email").isPresent() || contact.get("homepage").isPresent();
}

MutableComponent name = Component.literal(contributor);

if (hasLink) {
name = name.withStyle(ChatFormatting.BLUE).withStyle(ChatFormatting.UNDERLINE);
}

for (var line : textRenderer.split(name, wrapWidth - 24)) {
DescriptionEntry entry = null;

if (hasLink) {
if (contact.get("email").isPresent()) {
entry = new MailableContactEntry(line, contact.get("email").get(), indent);
} else if (contact.get("homepage").isPresent()) {
entry = new LinkEntry(line, contact.get("homepage").get(), indent);
}
}

if (entry != null) {
this.addEntry(entry);
} else {
this.addEntry(new DescriptionEntry(line, indent));
}

indent = 24;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"tnoctua",
"litetex",
"Starmoe(Celestia)",
"Coredex"
"Coredex",
"LostLuma"
],
"description": "Adds a mod menu to view the list of mods you have installed.",
"mixins": [
Expand Down