mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 16:50:15 +00:00
bugfix: gray out radial emoji option after sending emoji to all players
This commit is contained in:
@@ -259,7 +259,9 @@ export class RadialMenu implements Layer {
|
||||
this.activateMenuElement(Slot.Build, "#ebe250", buildIcon, () => {
|
||||
this.buildMenu.showMenu(myPlayer, this.clickedCell)
|
||||
})
|
||||
if (actions.interaction?.canSendEmoji) {
|
||||
const canSendEmojiToPlayer = this.g.hasOwner(tile) && this.g.ownerID(tile) != myPlayer.smallID() && actions.interaction?.canSendEmoji
|
||||
const canSendEmojiToAllPlayers = this.g.ownerID(tile) == myPlayer.smallID() && actions.canSendEmojiAllPlayers
|
||||
if (canSendEmojiToPlayer || canSendEmojiToAllPlayers) {
|
||||
this.activateMenuElement(Slot.Emoji, "#00a6a4", emojiIcon, () => {
|
||||
const target = this.g.owner(tile) == myPlayer ? AllPlayers : (this.g.owner(tile) as Player)
|
||||
this.emojiTable.onEmojiClicked = (emoji: string) => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getConfig } from "./configuration/Config";
|
||||
import { EventBus } from "./EventBus";
|
||||
import { Executor } from "./execution/ExecutionManager";
|
||||
import { WinCheckExecution } from "./execution/WinCheckExecution";
|
||||
import { Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, NameViewData, Player, PlayerActions, PlayerID, PlayerProfile, PlayerType, UnitType } from "./game/Game";
|
||||
import { AllPlayers, Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, NameViewData, Player, PlayerActions, PlayerID, PlayerProfile, PlayerType, UnitType } from "./game/Game";
|
||||
import { createGame } from "./game/GameImpl";
|
||||
import { loadTerrainMap as loadGameMap } from "./game/TerrainMapLoader";
|
||||
import { GameConfig, Turn } from "./Schemas";
|
||||
@@ -94,7 +94,8 @@ export class GameRunner {
|
||||
const actions = {
|
||||
canBoat: this.canBoat(player, tile),
|
||||
canAttack: this.canAttack(player, tile),
|
||||
buildableUnits: Object.values(UnitType).filter(ut => player.canBuild(ut, tile) != false)
|
||||
buildableUnits: Object.values(UnitType).filter(ut => player.canBuild(ut, tile) != false),
|
||||
canSendEmojiAllPlayers: player.canSendEmoji(AllPlayers)
|
||||
} as PlayerActions
|
||||
|
||||
if (this.game.hasOwner(tile)) {
|
||||
|
||||
@@ -357,6 +357,7 @@ export interface PlayerActions {
|
||||
canBoat: boolean
|
||||
canAttack: boolean
|
||||
buildableUnits: UnitType[]
|
||||
canSendEmojiAllPlayers: boolean
|
||||
interaction?: PlayerInteraction
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user