refactor radial, fix boat on terra nullius not working fixes (#1095)

## Description:
refactor the MenuElements to be more decoupled by passing in MenuParams.

Fix boat not working on terra nullius.

fixes #1088

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
This commit is contained in:
evanpelle
2025-06-07 15:34:10 -07:00
committed by GitHub
parent 72bb78342e
commit dda9e26596
5 changed files with 288 additions and 335 deletions
@@ -3,7 +3,7 @@ import { GameView, PlayerView } from "../../../core/game/GameView";
import { SendQuickChatEvent } from "../../Transport";
import { translateText } from "../../Utils";
import { ChatModal, QuickChatPhrase, quickChatPhrases } from "./ChatModal";
import { COLORS, MenuElement } from "./RadialMenuElements";
import { COLORS, MenuElement, MenuElementParams } from "./RadialMenuElements";
export class ChatIntegration {
private ctModal: ChatModal;
@@ -51,7 +51,7 @@ export class ChatIntegration {
return {
id: `phrase-${category.id}-${phrase.key}`,
name: phraseText,
disabled: false,
disabled: () => false,
text: this.shortenText(phraseText),
fontSize: "10px",
color: categoryColor,
@@ -61,7 +61,7 @@ export class ChatIntegration {
className: "description",
},
],
action: () => {
action: (params: MenuElementParams) => {
if (phrase.requiresPlayer) {
this.ctModal.openWithSelection(
category.id,
@@ -86,7 +86,7 @@ export class ChatIntegration {
return {
id: `chat-category-${category.id}`,
name: categoryTranslation,
disabled: false,
disabled: () => false,
text: categoryTranslation,
color: categoryColor,
_action: () => {}, // Empty action placeholder for RadialMenu