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
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static List<Button> mapImageButtons(Game game) {
if (game != null && !game.isFowMode()) {
if (AsyncTi4WebsiteHelper.uploadsEnabled()) {
String url = "https://asyncti4.com/game/" + game.getName() + "/newui";
buttonsWeb.add(Button.link(url, "Website View"));
buttonsWeb.add(Button.link(url, "Web View"));
}
buttonsWeb.add(PLAYER_INFO);
}
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/ti4/helpers/ButtonHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
import ti4.service.unit.RemoveUnitService;
import ti4.spring.api.image.GameImageService;
import ti4.spring.context.SpringContext;
import ti4.website.AsyncTi4WebsiteHelper;

@UtilityClass
public class ButtonHelper {
Expand Down Expand Up @@ -2422,11 +2421,7 @@ public static void sendFileWithCorrectButtons(
List<Button> buttons,
Game game,
@Nullable Consumer<Message> onSuccess) {
if (!AsyncTi4WebsiteHelper.uploadsEnabled() || game.isFowMode()) {
MessageHelper.sendFileToChannelAndAddLinkToButtons(channel, fileUpload, message, buttons, onSuccess);
} else {
MessageHelper.sendFileToChannelWithButtonsAfter(channel, fileUpload, message, buttons, onSuccess);
}
MessageHelper.sendFileToChannelAndAddLinkToButtons(channel, fileUpload, message, buttons, onSuccess);
}

public static boolean canMoveOutOfLockedSystems(Player player, Game game) {
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/ti4/message/MessageHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,15 @@ public static void sendFileToChannelAndAddLinkToButtons(
onSuccess.accept(msg);
}
String link = msg.getAttachments().getFirst().getUrl();
realButtons.add(Button.link(link, "Open in browser"));
Button fullResButton = Button.link(link, "Full Res");
if (!buttons.isEmpty() && "Web View".equals(buttons.getFirst().getLabel())) {
realButtons.add(buttons.getFirst());
realButtons.add(fullResButton);
realButtons.addAll(buttons.subList(1, buttons.size()));
splitAndSent(message, channel, null, realButtons);
return;
}
realButtons.add(fullResButton);
realButtons.addAll(buttons);
splitAndSent(message, channel, null, realButtons);
},
Expand Down
Loading