mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 05:38:09 -05:00
Add Mahi-Mahi Resort water down images to map planner
This commit is contained in:
@@ -38,7 +38,7 @@ import { getWeaponRange } from "~/features/comp-analyzer/core/weapon-range";
|
||||
import { useTheme } from "~/features/theme/core/provider";
|
||||
import type { LanguageCode } from "~/modules/i18n/config";
|
||||
import { modesShort } from "~/modules/in-game-lists/modes";
|
||||
import { stageIds } from "~/modules/in-game-lists/stage-ids";
|
||||
import { stageIds, stagesObj } from "~/modules/in-game-lists/stage-ids";
|
||||
import type {
|
||||
MainWeaponId,
|
||||
ModeShort,
|
||||
@@ -63,6 +63,7 @@ import {
|
||||
} from "~/utils/urls";
|
||||
import { LinkButton, SendouButton } from "../../../components/elements/Button";
|
||||
import { Image } from "../../../components/Image";
|
||||
import type { StageWaterLevel } from "../plans-types";
|
||||
import styles from "./Planner.module.css";
|
||||
|
||||
const DROPPED_IMAGE_SIZE_PX = 45;
|
||||
@@ -317,6 +318,7 @@ export default function Planner() {
|
||||
stageId: StageId;
|
||||
mode: ModeShort;
|
||||
style: "MINI" | "OVER";
|
||||
waterLevel: StageWaterLevel;
|
||||
}) => {
|
||||
if (!editor) return;
|
||||
|
||||
@@ -672,6 +674,7 @@ function StageBackgroundSelector({
|
||||
stageId: StageId;
|
||||
mode: ModeShort;
|
||||
style: "MINI" | "OVER";
|
||||
waterLevel: StageWaterLevel;
|
||||
}) => void;
|
||||
}) {
|
||||
const { t } = useTranslation(["game-misc", "common"]);
|
||||
@@ -680,9 +683,13 @@ function StageBackgroundSelector({
|
||||
const [backgroundStyle, setBackgroundStyle] = React.useState<"MINI" | "OVER">(
|
||||
"MINI",
|
||||
);
|
||||
const [waterLevel, setWaterLevel] = React.useState<StageWaterLevel>("up");
|
||||
|
||||
const handleStageIdChange = (stageId: StageId) => {
|
||||
setStageId(stageId);
|
||||
if (stageId !== stagesObj.MAHI_MAHI_RESORT) {
|
||||
setWaterLevel("up");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -729,9 +736,24 @@ function StageBackgroundSelector({
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
{stageId === stagesObj.MAHI_MAHI_RESORT ? (
|
||||
<select
|
||||
className="w-max"
|
||||
value={waterLevel}
|
||||
onChange={(e) => setWaterLevel(e.target.value as StageWaterLevel)}
|
||||
>
|
||||
{(["up", "down"] as const).map((level) => {
|
||||
return (
|
||||
<option key={level} value={level}>
|
||||
{t(`common:plans.waterLevel.${level}`)}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
) : null}
|
||||
<SendouButton
|
||||
onPress={() =>
|
||||
onAddBackground({ style: backgroundStyle, stageId, mode })
|
||||
onAddBackground({ style: backgroundStyle, stageId, mode, waterLevel })
|
||||
}
|
||||
className="w-max"
|
||||
>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export type { StageBackgroundStyle } from "./plans-types";
|
||||
@@ -1 +1,3 @@
|
||||
export type StageBackgroundStyle = "OVER" | "MINI" | "ITEMS";
|
||||
|
||||
export type StageWaterLevel = "up" | "down";
|
||||
|
||||
@@ -20,7 +20,10 @@ import { leaderboardsSearchParams } from "~/features/leaderboards/leaderboards-s
|
||||
import { lfgNewSearchParams } from "~/features/lfg/lfg-search-params";
|
||||
import type { MapPool } from "~/features/map-list-generator/core/map-pool";
|
||||
import { mapListGeneratorSearchParams } from "~/features/map-list-generator/map-list-generator-search-params";
|
||||
import type { StageBackgroundStyle } from "~/features/map-planner";
|
||||
import type {
|
||||
StageBackgroundStyle,
|
||||
StageWaterLevel,
|
||||
} from "~/features/map-planner/plans-types";
|
||||
import type { TierName } from "~/features/mmr/mmr-constants";
|
||||
import { calculatorSearchParams } from "~/features/object-damage-calculator/calculator-search-params";
|
||||
import {
|
||||
@@ -653,11 +656,16 @@ export const stageMinimapImageUrlWithEnding = ({
|
||||
stageId,
|
||||
mode,
|
||||
style,
|
||||
waterLevel,
|
||||
}: {
|
||||
stageId: StageId;
|
||||
mode: ModeShort;
|
||||
style: StageBackgroundStyle;
|
||||
}) => `${STATIC_ASSETS_URL}/planner-maps/${stageId}-${mode}-${style}.png`;
|
||||
waterLevel?: StageWaterLevel;
|
||||
}) =>
|
||||
`${STATIC_ASSETS_URL}/planner-maps/${stageId}-${mode}-${style}${
|
||||
waterLevel === "down" ? "-DOWN" : ""
|
||||
}.png`;
|
||||
|
||||
export function resolveBaseUrl(url: string) {
|
||||
return new URL(url).host;
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "af {{author}}",
|
||||
"theme.light": "Lyst",
|
||||
"theme.dark": "Mørkt",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "von {{author}}",
|
||||
"theme.light": "Hell",
|
||||
"theme.dark": "Dunkel",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "Minimap",
|
||||
"plans.adder.objective": "Objective",
|
||||
"plans.ranges": "Ranges",
|
||||
"plans.waterLevel.up": "Water up",
|
||||
"plans.waterLevel.down": "Water down",
|
||||
"articles.by": "by {{author}}",
|
||||
"theme.light": "Light",
|
||||
"theme.dark": "Dark",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "Minimapa",
|
||||
"plans.adder.objective": "Objetivo",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "por {{author}}",
|
||||
"theme.light": "Claro",
|
||||
"theme.dark": "Oscuro",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "por {{author}}",
|
||||
"theme.light": "Claro",
|
||||
"theme.dark": "Oscuro",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "par {{author}}",
|
||||
"theme.light": "Clair",
|
||||
"theme.dark": "Sombre",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "Minimap",
|
||||
"plans.adder.objective": "Objectif",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "par {{author}}",
|
||||
"theme.light": "Clair",
|
||||
"theme.dark": "Sombre",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "מאת {{author}}",
|
||||
"theme.light": "בהיר",
|
||||
"theme.dark": "חשוך",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "Minimappa",
|
||||
"plans.adder.objective": "Obiettivo",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "da {{author}}",
|
||||
"theme.light": "Light",
|
||||
"theme.dark": "Dark",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "ミニマップ",
|
||||
"plans.adder.objective": "ルール関与系",
|
||||
"plans.ranges": "射程",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "作者: {{author}}",
|
||||
"theme.light": "ライトモード",
|
||||
"theme.dark": "ダークモード",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "{{author}} 작성",
|
||||
"theme.light": "라이트",
|
||||
"theme.dark": "다크",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "",
|
||||
"theme.light": "",
|
||||
"theme.dark": "",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "napisane przez {{author}}",
|
||||
"theme.light": "Jasny",
|
||||
"theme.dark": "Ciemny",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "",
|
||||
"plans.adder.objective": "",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "por/pela {{author}}",
|
||||
"theme.light": "Claro",
|
||||
"theme.dark": "Escuro",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "Миникарта",
|
||||
"plans.adder.objective": "Цель",
|
||||
"plans.ranges": "",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "от {{author}}",
|
||||
"theme.light": "Светлая",
|
||||
"theme.dark": "Тёмная",
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
"plans.bgStyle.MINI": "小地图",
|
||||
"plans.adder.objective": "目标",
|
||||
"plans.ranges": "射程",
|
||||
"plans.waterLevel.up": "",
|
||||
"plans.waterLevel.down": "",
|
||||
"articles.by": "作者: {{author}}",
|
||||
"theme.light": "浅色",
|
||||
"theme.dark": "深色",
|
||||
|
||||
Reference in New Issue
Block a user