mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 18:20:40 +00:00
Move betrayal button, remove betrayal confirmation 🔧 (#3076)
## Description: - Move betrayal button to the boat-sending-button-location (you can't send boats to allies) to prevent missclicks - Remove betrayal confirmation <img width="260" height="248" alt="image" src="https://github.com/user-attachments/assets/0a25fc9c-c8a0-4ba9-a8c8-971d6a7a0511" /> ## 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: FloPinguin
This commit is contained in:
@@ -17,7 +17,6 @@ import allianceIcon from "/images/AllianceIconWhite.svg?url";
|
||||
import boatIcon from "/images/BoatIconWhite.svg?url";
|
||||
import buildIcon from "/images/BuildIconWhite.svg?url";
|
||||
import chatIcon from "/images/ChatIconWhite.svg?url";
|
||||
import checkmarkIcon from "/images/CheckmarkIconWhite.svg?url";
|
||||
import donateGoldIcon from "/images/DonateGoldIconWhite.svg?url";
|
||||
import donateTroopIcon from "/images/DonateTroopIconWhite.svg?url";
|
||||
import emojiIcon from "/images/EmojiIconWhite.svg?url";
|
||||
@@ -219,15 +218,6 @@ const allyBreakElement: MenuElement = {
|
||||
!!params.playerActions?.interaction?.canBreakAlliance,
|
||||
color: COLORS.breakAlly,
|
||||
icon: traitorIcon,
|
||||
subMenu: () => [allyBreakCancelElement, allyBreakConfirmElement],
|
||||
};
|
||||
|
||||
const allyBreakConfirmElement: MenuElement = {
|
||||
id: "ally_break_confirm",
|
||||
name: "confirm",
|
||||
disabled: () => false,
|
||||
color: COLORS.breakAlly,
|
||||
icon: checkmarkIcon,
|
||||
action: (params: MenuElementParams) => {
|
||||
params.playerActionHandler.handleBreakAlliance(
|
||||
params.myPlayer,
|
||||
@@ -237,17 +227,6 @@ const allyBreakConfirmElement: MenuElement = {
|
||||
},
|
||||
};
|
||||
|
||||
const allyBreakCancelElement: MenuElement = {
|
||||
id: "ally_break_cancel",
|
||||
name: "cancel",
|
||||
disabled: () => false,
|
||||
color: COLORS.info,
|
||||
icon: xIcon,
|
||||
action: (params: MenuElementParams) => {
|
||||
params.closeMenu();
|
||||
},
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const allyDonateGoldElement: MenuElement = {
|
||||
id: "ally_donate_gold",
|
||||
@@ -638,10 +617,7 @@ export const rootMenuElement: MenuElement = {
|
||||
icon: infoIcon,
|
||||
color: COLORS.info,
|
||||
subMenu: (params: MenuElementParams) => {
|
||||
let ally = allyRequestElement;
|
||||
if (params.selected?.isAlliedWith(params.myPlayer)) {
|
||||
ally = allyBreakElement;
|
||||
}
|
||||
const isAllied = params.selected?.isAlliedWith(params.myPlayer);
|
||||
|
||||
const tileOwner = params.game.owner(params.tile);
|
||||
const isOwnTerritory =
|
||||
@@ -651,10 +627,10 @@ export const rootMenuElement: MenuElement = {
|
||||
const menuItems: (MenuElement | null)[] = [
|
||||
infoMenuElement,
|
||||
...(isOwnTerritory
|
||||
? [deleteUnitElement, ally, buildMenuElement]
|
||||
? [deleteUnitElement, allyRequestElement, buildMenuElement]
|
||||
: [
|
||||
boatMenuElement,
|
||||
ally,
|
||||
isAllied ? allyBreakElement : boatMenuElement,
|
||||
allyRequestElement,
|
||||
isFriendlyTarget(params) && !isDisconnectedTarget(params)
|
||||
? donateGoldRadialElement
|
||||
: attackMenuElement,
|
||||
|
||||
Reference in New Issue
Block a user