Merge branch 'main' into bomb-confirmation

This commit is contained in:
Ryan
2026-01-08 09:26:56 +00:00
committed by GitHub
22 changed files with 571 additions and 115 deletions
+1
View File
@@ -23,6 +23,7 @@ export const MapDescription: Record<keyof typeof GameMapType, string> = {
Asia: "Asia",
Mars: "Mars",
SouthAmerica: "South America",
BritanniaClassic: "Britannia Classic",
Britannia: "Britannia",
GatewayToTheAtlantic: "Gateway to the Atlantic",
Australia: "Australia",
@@ -73,6 +73,12 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
@state()
private unit: UnitView | null = null;
@state()
private isWilderness: boolean = false;
@state()
private isIrradiatedWilderness: boolean = false;
@state()
private _isInfoVisible: boolean = false;
@@ -106,6 +112,8 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
this.setVisible(false);
this.unit = null;
this.player = null;
this.isWilderness = false;
this.isIrradiatedWilderness = false;
}
public maybeShow(x: number, y: number) {
@@ -126,6 +134,13 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
this.playerProfile = p;
});
this.setVisible(true);
} else if (owner && !owner.isPlayer() && this.game.isLand(tile)) {
if (this.game.hasFallout(tile)) {
this.isIrradiatedWilderness = true;
} else {
this.isWilderness = true;
}
this.setVisible(true);
} else if (!this.game.isLand(tile)) {
const units = this.game
.units(UnitType.Warship, UnitType.TradeShip, UnitType.TransportShip)
@@ -520,6 +535,15 @@ export class PlayerInfoOverlay extends LitElement implements Layer {
<div
class="bg-gray-800/70 backdrop-blur-xs shadow-xs rounded-lg shadow-lg transition-all duration-300 text-white text-lg md:text-base ${containerClasses}"
>
${this.isWilderness || this.isIrradiatedWilderness
? html`<div class="p-2 font-bold">
${translateText(
this.isIrradiatedWilderness
? "player_info_overlay.irradiated_wilderness_title"
: "player_info_overlay.wilderness_title",
)}
</div>`
: ""}
${this.player !== null ? this.renderPlayerInfo(this.player) : ""}
${this.unit !== null ? this.renderUnitInfo(this.unit) : ""}
</div>
+7
View File
@@ -16,6 +16,13 @@
border-color: var(--color-gray-200, currentColor);
}
input,
textarea,
select {
background-color: #fff;
color: #000;
}
input::placeholder,
textarea::placeholder {
color: var(--color-gray-400);
+2 -2
View File
@@ -309,13 +309,13 @@ export const EmbargoAllIntentSchema = BaseIntentSchema.extend({
export const DonateGoldIntentSchema = BaseIntentSchema.extend({
type: z.literal("donate_gold"),
recipient: ID,
gold: z.number().nullable(),
gold: z.number().nonnegative().nullable(),
});
export const DonateTroopIntentSchema = BaseIntentSchema.extend({
type: z.literal("donate_troops"),
recipient: ID,
troops: z.number().nullable(),
troops: z.number().nonnegative().nullable(),
});
export const BuildUnitIntentSchema = BaseIntentSchema.extend({
+1
View File
@@ -57,6 +57,7 @@ const numPlayersConfig = {
[GameMapType.BetweenTwoSeas]: [70, 50, 40],
[GameMapType.BlackSea]: [50, 30, 30],
[GameMapType.Britannia]: [50, 30, 20],
[GameMapType.BritanniaClassic]: [50, 30, 20],
[GameMapType.DeglaciatedAntarctica]: [50, 40, 30],
[GameMapType.EastAsia]: [50, 30, 20],
[GameMapType.Europe]: [100, 70, 50],
+3 -1
View File
@@ -82,6 +82,7 @@ export enum GameMapType {
Pangaea = "Pangaea",
Asia = "Asia",
Mars = "Mars",
BritanniaClassic = "Britannia Classic",
Britannia = "Britannia",
GatewayToTheAtlantic = "Gateway to the Atlantic",
Australia = "Australia",
@@ -134,8 +135,9 @@ export const mapCategories: Record<string, GameMapType[]> = {
GameMapType.Oceania,
],
regional: [
GameMapType.BlackSea,
GameMapType.BritanniaClassic,
GameMapType.Britannia,
GameMapType.BlackSea,
GameMapType.GatewayToTheAtlantic,
GameMapType.BetweenTwoSeas,
GameMapType.Iceland,
+1
View File
@@ -30,6 +30,7 @@ const frequency: Partial<Record<GameMapName, number>> = {
BetweenTwoSeas: 5,
BlackSea: 6,
Britannia: 5,
BritanniaClassic: 4,
DeglaciatedAntarctica: 4,
EastAsia: 5,
Europe: 3,