mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-08 11:33:48 +00:00
Replace donate buttons with attack ones for AFK friendly players in radial menu (#2987)
Resolves #2986 ## Description: Shows donate actions in radial menu only when friendly player is NOT disconnected. This is needed in order to let mobile/touch users attack AFK teammates. Current behavior: <img width="525" height="514" alt="image" src="https://github.com/user-attachments/assets/78b95e27-443a-4dd5-934b-c8a841b4bf97" /> With this PR: <img width="545" height="457" alt="image" src="https://github.com/user-attachments/assets/e9792478-6ccd-415f-9199-cff7bfc9356f" /> ## 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: deshack_82603
This commit is contained in:
@@ -134,7 +134,9 @@ export class MainRadialMenu extends LitElement implements Layer {
|
||||
};
|
||||
|
||||
const isFriendlyTarget =
|
||||
recipient !== null && recipient.isFriendly(myPlayer);
|
||||
recipient !== null &&
|
||||
recipient.isFriendly(myPlayer) &&
|
||||
!recipient.isDisconnected();
|
||||
|
||||
this.radialMenu.setCenterButtonAppearance(
|
||||
isFriendlyTarget ? donateTroopIcon : swordIcon,
|
||||
|
||||
Reference in New Issue
Block a user