mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-03 09:10:50 +00:00
fix
This commit is contained in:
+2
-1
@@ -23,6 +23,7 @@ import { NewsModal } from "./NewsModal";
|
||||
import "./PublicLobby";
|
||||
import { PublicLobby } from "./PublicLobby";
|
||||
import { SinglePlayerModal } from "./SinglePlayerModal";
|
||||
import { TerritoryPatternStorage } from "./TerritoryPatterns";
|
||||
import { territoryPatternsModal } from "./TerritoryPatternsModal";
|
||||
import { UserSettingModal } from "./UserSettingModal";
|
||||
import "./UsernameInput";
|
||||
@@ -298,7 +299,7 @@ class Client {
|
||||
{
|
||||
gameID: lobby.gameID,
|
||||
serverConfig: config,
|
||||
pattern: localStorage.getItem("territoryPattern") ?? "",
|
||||
pattern: TerritoryPatternStorage.getSelectedPatternBase64() || "",
|
||||
flag:
|
||||
this.flagInput === null || this.flagInput.getCurrentFlag() === "xx"
|
||||
? ""
|
||||
|
||||
@@ -20,6 +20,7 @@ import { DifficultyDescription } from "./components/Difficulties";
|
||||
import "./components/Maps";
|
||||
import { FlagInput } from "./FlagInput";
|
||||
import { JoinLobbyEvent } from "./Main";
|
||||
import { TerritoryPatternStorage } from "./TerritoryPatterns";
|
||||
import { UsernameInput } from "./UsernameInput";
|
||||
|
||||
@customElement("single-player-modal")
|
||||
@@ -441,7 +442,7 @@ export class SinglePlayerModal extends LitElement {
|
||||
flagInput.getCurrentFlag() === "xx"
|
||||
? ""
|
||||
: flagInput.getCurrentFlag(),
|
||||
pattern: localStorage.getItem("territoryPattern") ?? undefined,
|
||||
pattern: TerritoryPatternStorage.getSelectedPatternBase64(),
|
||||
},
|
||||
],
|
||||
config: {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||
import { PseudoRandom } from "../../../core/PseudoRandom";
|
||||
import { AlternateViewEvent, DragEvent } from "../../InputHandler";
|
||||
import { PatternDecoder, territoryPatterns } from "../../TerritoryPatterns";
|
||||
import { PatternDecoder } from "../../TerritoryPatterns";
|
||||
import { Layer } from "./Layer";
|
||||
|
||||
export class TerritoryLayer implements Layer {
|
||||
@@ -299,9 +299,8 @@ export class TerritoryLayer implements Layer {
|
||||
const x = this.game.x(tile);
|
||||
const y = this.game.y(tile);
|
||||
const baseColor = this.theme.territoryColor(owner);
|
||||
const patternBase64 = territoryPatterns[patternName];
|
||||
|
||||
const decoder = new PatternDecoder(patternBase64 ?? "");
|
||||
const decoder = new PatternDecoder(patternName ?? "");
|
||||
const bit = decoder.isSet(x, y) ? 1 : 0;
|
||||
const colorToUse = bit ? baseColor.darken(0.2) : baseColor;
|
||||
this.paintCell(x, y, colorToUse, 150);
|
||||
|
||||
+4
-1
@@ -187,7 +187,10 @@ export const AttackIntentSchema = BaseIntentSchema.extend({
|
||||
|
||||
export const SpawnIntentSchema = BaseIntentSchema.extend({
|
||||
flag: z.string().optional(),
|
||||
pattern: z.string().optional(),
|
||||
pattern: z
|
||||
.string()
|
||||
.regex(/^[A-Za-z0-9+/=]*$/)
|
||||
.optional(),
|
||||
type: z.literal("spawn"),
|
||||
name: SafeString,
|
||||
playerType: PlayerTypeSchema,
|
||||
|
||||
Reference in New Issue
Block a user