Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
45 changes: 33 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
"accept_alliance": "Accept",
"reject_alliance": "Reject",
"alliance_renewed": "Your alliance with {name} has been renewed",
"wants_to_renew_alliance": "{name} wants to renew your alliance",
"ignore": "Ignore",
"unit_voluntarily_deleted": "Unit voluntarily deleted"
},
Expand Down
13 changes: 13 additions & 0 deletions src/core/execution/alliance/AllianceExtensionExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export class AllianceExtensionExecution implements Execution {
return;
}

// Check if this is a new request (before adding it)
const wasOnlyOneAgreed = alliance.onlyOneAgreedToExtend();

// Mark this player's intent to extend
alliance.addExtensionRequest(this.from);

Expand All @@ -56,6 +59,16 @@ export class AllianceExtensionExecution implements Execution {
undefined,
{ name: this.from.displayName() },
);
} else if (alliance.onlyOneAgreedToExtend() && !wasOnlyOneAgreed) {
// Send message to the other player that someone wants to renew
// Only send if this is a new request (transition from "none" to "one")
mg.displayMessage(
"events_display.wants_to_renew_alliance",
MessageType.RENEW_ALLIANCE,
this.toID,
undefined,
{ name: this.from.displayName() },
);
}
}

Expand Down
Loading