Implement send resources modal (#2146)

## Description:
Fixes https://github.com/openfrontio/OpenFrontIO/issues/2015
Implemented a new interactive modal component for sending troops/gold
between players, replacing the previous automatic troop donation system.

Screenshots
<img width="388" height="569" alt="s1"
src="https://github.com/user-attachments/assets/b5b5cfce-972e-474c-848a-4ea0dc7dde8f"
/>

<img width="383" height="534" alt="s2"
src="https://github.com/user-attachments/assets/4c467fa2-7631-4e7b-ab17-898778b08ea6"
/>

<img width="377" height="548" alt="s3"
src="https://github.com/user-attachments/assets/9359ee06-18af-48ea-a47c-586198e26f57"
/>

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [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:

abodcraft1

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
This commit is contained in:
Abdallah Bahrawi
2025-10-09 23:19:05 +03:00
committed by GitHub
parent d070c5810c
commit 0076996dce
4 changed files with 704 additions and 54 deletions
+10 -2
View File
@@ -576,7 +576,11 @@ export class PlayerImpl implements Player {
}
canDonateGold(recipient: Player): boolean {
if (!this.isFriendly(recipient)) {
if (
!this.isAlive() ||
!recipient.isAlive() ||
!this.isFriendly(recipient)
) {
return false;
}
if (
@@ -599,7 +603,11 @@ export class PlayerImpl implements Player {
}
canDonateTroops(recipient: Player): boolean {
if (!this.isFriendly(recipient)) {
if (
!this.isAlive() ||
!recipient.isAlive() ||
!this.isFriendly(recipient)
) {
return false;
}
if (