25 public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
28 String category =
"illustrations";
31 if (params.size() <= 1) {
32 key = params.get(0).string;
34 category = params.get(0).string;
35 key = params.get(1).string;
39 dialog.getVisualPanel().showImagePortion(category, key, sprite.getWidth(), sprite.getHeight(), 0, 0, 480, 300);
44 protected void showFleetInfo(InteractionDialogAPI dialog, CampaignFleetAPI player, CampaignFleetAPI other) {
45 BattleAPI b = player.getBattle();
46 if (b ==
null) b = other.getBattle();
47 if (b !=
null && b.isPlayerInvolved()) {
48 String titleOne =
"Your forces";
49 if (b.isPlayerInvolved() && b.getPlayerSide().size() > 1) {
50 titleOne +=
", with allies";
53 titleOne =
"Allied forces";
55 String titleTwo =
null;
56 if (b.getPrimary(b.getNonPlayerSide()) !=
null) {
57 titleTwo = b.getPrimary(b.getNonPlayerSide()).getNameWithFactionKeepCase();
59 if (b.getNonPlayerSide().size() > 1) titleTwo +=
", with allies";
60 dialog.getVisualPanel().showFleetInfo(titleOne, b.getPlayerCombined(), Misc.ucFirst(titleTwo), b.getNonPlayerCombined(),
null);
63 String titleOne = b.getPrimary(b.getSideOne()).getNameWithFactionKeepCase();
64 if (b.getSideOne().size() > 1) titleOne +=
", with allies";
65 String titleTwo = b.getPrimary(b.getSideTwo()).getNameWithFactionKeepCase();
66 if (b.getSideTwo().size() > 1) titleTwo +=
", with allies";
70 dialog.getVisualPanel().showPreBattleJoinInfo(
null, player, Misc.ucFirst(titleOne), Misc.ucFirst(titleTwo), fake);
72 dialog.getVisualPanel().showFleetInfo((String)
null, player, (String)
null, other,
null);