Skip to content
Open
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ loader_version=0.19.3
fabric_version=0.141.4+1.21.11
loom_version=1.17.8

mod_version=1.6.6
mod_version=1.6.7-beta.3
maven_group=tel.eden
archives_base_name=edenmod
modmenu_version=17.0.0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
347 changes: 343 additions & 4 deletions src/tel/eden/mod/EdenModClient.java

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions src/tel/eden/mod/chat/DiscordChatFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,51 @@ public static Component updateAvailable(String version, String pageUrl) {
return line;
}

/** "The promotion cycle has concluded! [Print] [View]" for in-game guild members only. */
public static Component cycleConcluded(String cycleCode) {
String arg = (cycleCode != null && !cycleCode.isBlank()) ? " " + cycleCode.trim() : "";
Style print = Style.EMPTY.withColor(ChatFormatting.AQUA).withUnderlined(true).withClickEvent(new ClickEvent.RunCommand("/eden cycle print" + arg)).withHoverEvent(new HoverEvent.ShowText(Component.literal("Print top cycle results to chat")));
Style view = Style.EMPTY.withColor(ChatFormatting.GREEN).withUnderlined(true).withClickEvent(new ClickEvent.RunCommand("/eden cycle view" + arg)).withHoverEvent(new HoverEvent.ShowText(Component.literal("Open the promotion cycle leaderboard")));
return Component.empty().append(prefix(SHIELD)).append(Component.literal("The promotion cycle has concluded! ").withStyle(ChatFormatting.GOLD)).append(Component.literal("[Print]").setStyle(print)).append(Component.literal(" ")).append(Component.literal("[View]").setStyle(view));
}

/** Format concluded cycle summary (top 3 raids, top 1 wars, top 3 raffle, totals) for [Print]. */
public static Component formatCyclePrint(tel.eden.mod.net.CycleLeaderboardData.ConcludedCycleSummary summary) {
MutableComponent out = Component.empty().append(prefix(SHIELD));
String title = (summary.cycleCode() != null && !summary.cycleCode().isBlank()) ? "Promotion Cycle " + summary.cycleCode() + " Results:" : "Promotion Cycle Results:";
out.append(Component.literal(title).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD));
out.append(Component.literal("\n Top 3 Raids:").withStyle(ChatFormatting.AQUA));
List<tel.eden.mod.net.CycleLeaderboardData.LeaderboardEntry> topRaids = summary.topRaids().stream().filter(e -> e.count() > 0 && e.rank() <= 3).limit(3).toList();
if (topRaids.isEmpty()) {
out.append(Component.literal("\n None").withStyle(ChatFormatting.GRAY));
} else {
for (tel.eden.mod.net.CycleLeaderboardData.LeaderboardEntry e : topRaids) {
out.append(Component.literal("\n #" + e.rank() + " " + e.name()).withStyle(ChatFormatting.WHITE)).append(Component.literal(" — " + e.count() + " raids").withStyle(ChatFormatting.GRAY));
}
}
out.append(Component.literal("\n Top 1 Wars:").withStyle(ChatFormatting.RED));
List<tel.eden.mod.net.CycleLeaderboardData.LeaderboardEntry> topWars = summary.topWars().stream().filter(e -> e.count() > 0 && e.rank() == 1).limit(3).toList();
if (topWars.isEmpty()) {
out.append(Component.literal("\n None").withStyle(ChatFormatting.GRAY));
} else {
for (tel.eden.mod.net.CycleLeaderboardData.LeaderboardEntry e : topWars) {
out.append(Component.literal("\n #" + e.rank() + " " + e.name()).withStyle(ChatFormatting.WHITE)).append(Component.literal(" — " + e.count() + " wars").withStyle(ChatFormatting.GRAY));
}
}
out.append(Component.literal("\n Top 3 Raffle:").withStyle(ChatFormatting.LIGHT_PURPLE));
List<tel.eden.mod.net.CycleLeaderboardData.RaffleWinner> winners = summary.raffleWinners().subList(0, Math.min(3, summary.raffleWinners().size()));
if (winners.isEmpty()) {
out.append(Component.literal("\n None").withStyle(ChatFormatting.GRAY));
} else {
for (int i = 0; i < winners.size(); i++) {
tel.eden.mod.net.CycleLeaderboardData.RaffleWinner w = winners.get(i);
out.append(Component.literal("\n #" + (i + 1) + " " + w.name()).withStyle(ChatFormatting.WHITE)).append(Component.literal(" — " + w.tickets() + " tickets (" + w.raids() + " raids)").withStyle(ChatFormatting.GRAY));
}
}
out.append(Component.literal("\n Totals: ").withStyle(ChatFormatting.GOLD)).append(Component.literal(summary.totalRaids() + " raids | " + summary.totalWars() + " wars | " + summary.totalTickets() + " tickets").withStyle(ChatFormatting.YELLOW));
return out;
}

/** A green/gold/red client-side notice line with the guild shield prefix. */
public static Component systemLine(String text, ChatFormatting color) {
return Component.empty().append(prefix(SHIELD)).append(Component.literal(text).withStyle(color));
Expand Down
4 changes: 4 additions & 0 deletions src/tel/eden/mod/gui/BridgeConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ protected void init() {
if (!traveler) {
addToggleRow(Category.GENERAL, "Discord Bridge Messages", () -> config.discordBridgeMessages, v -> config.discordBridgeMessages = v, "On", "Off", true);
}
if (mod.isFullMember()) {
addButtonRow(Category.GENERAL, "Promotion cycle", () -> Component.literal("Open..."), () -> this.minecraft.setScreen(new PromotionCycleScreen(this, mod)), () -> {
});
}
addToggleRow(Category.GENERAL, "Traveler chat", () -> config.travelerChat, v -> {
config.travelerChat = v;
EdenModClient.syncTravelerPrefs(config);
Expand Down
11 changes: 6 additions & 5 deletions src/tel/eden/mod/gui/EdenMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class EdenMenuScreen extends EdenScreen {
private static final int BASE_CONTENT_WIDTH = 200;
private static final int BUTTON_HEIGHT = 20;
private static final int BUTTON_SPACING = 24;
private static final int BUTTON_COUNT = 8;
// Event and Payouts are guild-only.
private static final int TRAVELER_HIDDEN_BUTTONS = 2;
private static final int BUTTON_COUNT = 9;
// Event, Promotion cycle, and Payouts are hidden from travelers.
private static final int TRAVELER_HIDDEN_BUTTONS = 3;
private static final int LOGO_WIDTH = 128;
private static final int LOGO_GAP = 20;
private static final int CONTENT_MARGIN = 12;
Expand Down Expand Up @@ -67,6 +67,7 @@ protected void init() {
}
this.minecraft.setScreen(new LongEventScreen(this, mod));
}).bounds(metrics.buttonX, metrics.startY + (metrics.buttonPitch * slot++), metrics.buttonWidth, metrics.buttonHeight).build());
this.addRenderableWidget(Button.builder(Component.literal("Promotion cycle"), button -> this.minecraft.setScreen(new PromotionCycleScreen(this, EdenModClient.instance()))).bounds(metrics.buttonX, metrics.startY + (metrics.buttonPitch * slot++), metrics.buttonWidth, metrics.buttonHeight).build());
}

this.addRenderableWidget(Button.builder(Component.literal("Create Party"), button -> {
Expand Down Expand Up @@ -213,8 +214,8 @@ private static boolean isMember() {

private static int buttonCount() {
int count = isTraveler() ? BUTTON_COUNT - TRAVELER_HIDDEN_BUTTONS : BUTTON_COUNT;
// Event is member-only; a traveler already has it counted in TRAVELER_HIDDEN_BUTTONS.
return !isTraveler() && !isMember() ? count - 1 : count;
// Event and Promotion cycle are full-member-only; observers lack both as well.
return !isTraveler() && !isMember() ? count - 2 : count;
}

private int bottomSafeMargin() {
Expand Down
Loading
Loading