mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 13:26:10 +00:00
Added notifcation when a player wants to renew (#2391)
## Description: Describe the PR. Added a new chat message from the server once player wants to renew the alliance, to the other player. ## Please complete the following: - [x] I have added screenshots for all UI updates <img width="572" height="256" alt="image" src="https://github.com/user-attachments/assets/7feec21f-fff5-4544-8992-caf99c45913d" /> - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: DISCORD_USERNAME notifxy (1379678982676676639)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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() },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user