diff --git a/TODO.txt b/TODO.txt index 4ee09da42..2fe06560f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -156,8 +156,10 @@ * BUG: center button should be disabled select island DONE 10/2/2024 * BUG: boat icon appears when click inland DONE 10/2/2024 * Auto deploy to dev on commit DONE 10/2/2024 -* add emoji button -* make disabled icon crossed out icon +* add emoji button DONE 10/4/2024 +* make disabled icon crossed out icon DONE 10/6/2024 +* disable select on mobile +* disable double tap on mobile * donate troops button * Make fake humans spawn by their country * BUG: double tap zooms on mobile diff --git a/resources/countries.txt b/resources/countries.txt new file mode 100644 index 000000000..05add4056 --- /dev/null +++ b/resources/countries.txt @@ -0,0 +1,4 @@ +clicked cell Cell[375,272] USA +clicked cell Cell[372,136] Canada +clicked cell Cell[375,374] Mexico +clicked cell Cell[500,378] Cuba diff --git a/resources/images/DisabledIcon.png b/resources/images/DisabledIcon.png new file mode 100644 index 000000000..ebec69382 Binary files /dev/null and b/resources/images/DisabledIcon.png differ diff --git a/src/client/graphics/layers/RadialMenu.ts b/src/client/graphics/layers/RadialMenu.ts index ae0c7dce3..7f19f201e 100644 --- a/src/client/graphics/layers/RadialMenu.ts +++ b/src/client/graphics/layers/RadialMenu.ts @@ -14,6 +14,7 @@ import boatIcon from '../../../../resources/images/BoatIconWhite.png'; import swordIcon from '../../../../resources/images/SwordIconWhite.png'; import targetIcon from '../../../../resources/images/TargetIconWhite.png'; import emojiIcon from '../../../../resources/images/EmojiIconWhite.png'; +import disabledIcon from '../../../../resources/images/DisabledIcon.png'; enum Slot { @@ -29,10 +30,10 @@ export class RadialMenu implements Layer { private menuElement: d3.Selection; private isVisible: boolean = false; private readonly menuItems = new Map([ - [Slot.Alliance, {name: "alliance", disabled: true, action: () => { }, color: null, icon: null, defaultIcon: allianceIcon}], - [Slot.Boat, {name: "boat", disabled: true, action: () => { }, color: null, icon: null, defaultIcon: boatIcon}], - [Slot.Target, {name: "target", disabled: true, action: () => { }, defaultIcon: targetIcon}], - [Slot.Emoji, {name: "emoji", disabled: true, action: () => { }, defaultIcon: emojiIcon}], + [Slot.Alliance, {name: "alliance", disabled: true, action: () => { }, color: null, icon: null}], + [Slot.Boat, {name: "boat", disabled: true, action: () => { }, color: null, icon: null}], + [Slot.Target, {name: "target", disabled: true, action: () => { }}], + [Slot.Emoji, {name: "emoji", disabled: true, action: () => { }}], ]); private readonly menuSize = 190; @@ -243,7 +244,6 @@ export class RadialMenu implements Layer { this.renderCenterButton(false) for (const item of this.menuItems.values()) { item.disabled = true - item.icon = item.defaultIcon this.updateMenuItemState(item) } @@ -427,7 +427,7 @@ export class RadialMenu implements Layer { .style('opacity', item.disabled ? 0.5 : 1); this.menuElement.select(`image[data-name="${item.name}"]`) - .attr('xlink:href', item.icon || item.defaultIcon) + .attr('xlink:href', item.disabled ? disabledIcon : item.icon) .attr('fill', item.disabled ? '#999999' : 'white'); }