Files
OpenFrontIO/src/client/components/Maps.ts
T
Andrew Niziolek a18b5e418b Rev: Update "Japan and Neighbors" map to "East Asia" (#1007)
**Closes Issue #1001.**

_Will require updates to translations for each language but English is
in place as are pointers to relevant map files and thumbnails._

## Description:
All assets and references to the Japan and Neighbors map have been
updated to reflect East Asia.

**New Behavior**
![East Asia
Map](https://github.com/user-attachments/assets/64192590-bbb7-4408-a99b-7455de295d2b)

**Old Behavior**
![Japan and Neighbors named
map](https://github.com/user-attachments/assets/ba44dd56-1470-4c74-a70d-bd7fd8f3c795)

Game test is functioning. Other languages will need to be updated for
their displayed text to align.

## 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
- [x] 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:

ajaxburger
_My git name is included in my nickname on the server._

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-06-04 09:27:04 -07:00

112 lines
3.0 KiB
TypeScript

import { LitElement, css, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import { GameMapType } from "../../core/game/Game";
import { getMapsImage } from "../utilities/Maps";
// Add map descriptions
export const MapDescription: Record<keyof typeof GameMapType, string> = {
World: "World",
WorldMapGiant: "Giant World Map",
Europe: "Europe",
EuropeClassic: "Europe Classic",
Mena: "MENA",
NorthAmerica: "North America",
Oceania: "Oceania",
BlackSea: "Black Sea",
Africa: "Africa",
Pangaea: "Pangaea",
Asia: "Asia",
Mars: "Mars",
SouthAmerica: "South America",
Britannia: "Britannia",
GatewayToTheAtlantic: "Gateway to the Atlantic",
Australia: "Australia",
Iceland: "Iceland",
EastAsia: "East Asia",
BetweenTwoSeas: "Between Two Seas",
FaroeIslands: "Faroe Islands",
DeglaciatedAntarctica: "Deglaciated Antarctica",
FalklandIslands: "Falkland Islands",
Baikal: "Baikal",
Halkidiki: "Halkidiki",
};
@customElement("map-display")
export class MapDisplay extends LitElement {
@property({ type: String }) mapKey = "";
@property({ type: Boolean }) selected = false;
@property({ type: String }) translation: string = "";
static styles = css`
.option-card {
width: 100%;
min-width: 100px;
max-width: 120px;
padding: 4px 4px 0 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
background: rgba(30, 30, 30, 0.95);
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
cursor: pointer;
transition: all 0.2s ease-in-out;
}
.option-card:hover {
transform: translateY(-2px);
border-color: rgba(255, 255, 255, 0.3);
background: rgba(40, 40, 40, 0.95);
}
.option-card.selected {
border-color: #4a9eff;
background: rgba(74, 158, 255, 0.1);
}
.option-card-title {
font-size: 14px;
color: #aaa;
text-align: center;
margin: 0 0 4px 0;
}
.option-image {
width: 100%;
aspect-ratio: 4/2;
color: #aaa;
transition: transform 0.2s ease-in-out;
border-radius: 8px;
background-color: rgba(255, 255, 255, 0.1);
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
}
`;
render() {
const mapValue = GameMapType[this.mapKey as keyof typeof GameMapType];
return html`
<div class="option-card ${this.selected ? "selected" : ""}">
${getMapsImage(mapValue)
? html`<img
src="${getMapsImage(mapValue)}"
alt="${this.mapKey}"
class="option-image"
/>`
: html`<div class="option-image">
<p>${this.mapKey}</p>
</div>`}
<div class="option-card-title">
<!-- ${MapDescription[this.mapKey as keyof typeof GameMapType]}-->
${this.translation ||
MapDescription[this.mapKey as keyof typeof GameMapType]}
</div>
</div>
`;
}
}