mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-29 04:44:23 +01:00
remove prefixed /
This commit is contained in:
43 files changed
+92
-93
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { environmentConfig } from "@blitzkit/core";
|
||||
|
||||
// TODO: remove the need for a `/ in the front of all paths
|
||||
export function alias(alias: string, path: string) {
|
||||
const environment = environmentConfig();
|
||||
|
||||
@@ -8,7 +7,7 @@ export function alias(alias: string, path: string) {
|
||||
throw new Error(`Invalid alias "${alias}"`);
|
||||
}
|
||||
|
||||
const base = environment.aliases[alias];
|
||||
const base = environment.aliases[alias].replace(/\/$/, "");
|
||||
|
||||
return `${base}${path}`;
|
||||
return `${base}/${path}`;
|
||||
}
|
||||
@@ -21,26 +21,26 @@ import { Cache } from "./cache";
|
||||
export class ClientBlitzKitAPI extends AbstractBlitzKitAPI {
|
||||
@Cache()
|
||||
game() {
|
||||
return fetchPB(alias("api", "/definitions/game.pb"), GameDefinitions);
|
||||
return fetchPB(alias("api", "definitions/game.pb"), GameDefinitions);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
consumables() {
|
||||
return fetchPB(
|
||||
alias("api", "/definitions/consumables.pb"),
|
||||
alias("api", "definitions/consumables.pb"),
|
||||
ConsumableDefinitions,
|
||||
);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
tanks() {
|
||||
return fetchPB(alias("api", "/definitions/tanks.pb"), TankDefinitions);
|
||||
return fetchPB(alias("api", "definitions/tanks.pb"), TankDefinitions);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
camouflages() {
|
||||
return fetchPB(
|
||||
alias("api", "/definitions/camouflage.pb"),
|
||||
alias("api", "definitions/camouflage.pb"),
|
||||
CamouflageDefinitions,
|
||||
);
|
||||
}
|
||||
@@ -48,46 +48,46 @@ export class ClientBlitzKitAPI extends AbstractBlitzKitAPI {
|
||||
@Cache()
|
||||
provisions() {
|
||||
return fetchPB(
|
||||
alias("api", "/definitions/provisions.pb"),
|
||||
alias("api", "definitions/provisions.pb"),
|
||||
ProvisionDefinitions,
|
||||
);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
models() {
|
||||
return fetchPB(alias("api", "/definitions/models.pb"), ModelDefinitions);
|
||||
return fetchPB(alias("api", "definitions/models.pb"), ModelDefinitions);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
skills() {
|
||||
return fetchPB(alias("api", "/definitions/skills.pb"), SkillDefinitions);
|
||||
return fetchPB(alias("api", "definitions/skills.pb"), SkillDefinitions);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
equipment() {
|
||||
return fetchPB(
|
||||
alias("api", "/definitions/equipment.pb"),
|
||||
alias("api", "definitions/equipment.pb"),
|
||||
EquipmentDefinitions,
|
||||
);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
gallery() {
|
||||
return fetchPB(alias("api", "/definitions/gallery.pb"), Gallery);
|
||||
return fetchPB(alias("api", "definitions/gallery.pb"), Gallery);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
maps() {
|
||||
return fetchPB(alias("api", "/definitions/maps.pb"), MapDefinitions);
|
||||
return fetchPB(alias("api", "definitions/maps.pb"), MapDefinitions);
|
||||
}
|
||||
|
||||
@Cache()
|
||||
scripts() {
|
||||
return fetchJSON<BlitzScripts>(alias("api", "/definitions/scripts.json"));
|
||||
return fetchJSON<BlitzScripts>(alias("api", "definitions/scripts.json"));
|
||||
}
|
||||
|
||||
@Cache()
|
||||
strings(locale: string) {
|
||||
return fetchJSON<Strings>(alias("api", `/strings/${locale}.json`));
|
||||
return fetchJSON<Strings>(alias("api", `strings/${locale}.json`));
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,5 @@ import { alias } from "@blitzkit/core";
|
||||
export const BLITZKIT_TANK_ICON_SIZE = { width: 40 * 16, height: 30 * 16 };
|
||||
|
||||
export function tankIcon(id: number, size: "big" | "small" = "big") {
|
||||
return alias("api", `/tanks/${id}/icons/${size}.webp`);
|
||||
return alias("api", `tanks/${id}/icons/${size}.webp`);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ type GalleryCardProps = MaybeSkeletonComponentProps<{
|
||||
export function AvatarCard(props: GalleryCardProps) {
|
||||
const src = alias(
|
||||
"api",
|
||||
`/gallery/avatars/${
|
||||
`gallery/avatars/${
|
||||
!props.skeleton && `${props.avatar.id}${props.avatar.extension}`
|
||||
}`
|
||||
);
|
||||
|
||||
@@ -114,7 +114,7 @@ function Camouflage({ index }: SectionProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={strings.tanks.loadout.camouflage}
|
||||
src={alias("api", "/icons/camo.webp")}
|
||||
src={alias("api", "icons/camo.webp")}
|
||||
/>
|
||||
</IconButton>
|
||||
);
|
||||
@@ -133,7 +133,7 @@ function ModulesSummary(props: SummaryProps) {
|
||||
key={module}
|
||||
alt={strings.tanks.loadout.module_types[module]}
|
||||
className={styles["summary-module"]}
|
||||
src={alias("api", `/icons/modules/${module}.webp`)}
|
||||
src={alias("api", `icons/modules/${module}.webp`)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@ function ItemsSummary({ index, kind, ...props }: ItemsSummaryProps) {
|
||||
: consumables.consumables[id].name,
|
||||
)}
|
||||
className={styles["summary-item"]}
|
||||
src={alias("api", `/icons/${kind}/${id}.webp`)}
|
||||
src={alias("api", `icons/${kind}/${id}.webp`)}
|
||||
/>
|
||||
))}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ function ShellSwitcher({ member, index }: ShellSwitcherProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", `/icons/shells/${candidate.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${candidate.icon}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -198,7 +198,7 @@ export function CustomShellButton() {
|
||||
alt={strings.common.shells[label]}
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/shells/${label}.webp`,
|
||||
`icons/shells/${label}.webp`,
|
||||
)}
|
||||
/>
|
||||
</Select.ItemText>
|
||||
|
||||
@@ -124,7 +124,7 @@ export function Guesser() {
|
||||
text={unwrap(result.name!)}
|
||||
prefix={
|
||||
<LazyImage
|
||||
src={alias("api", `/nations/${result.nation}/flags/circle.webp`)}
|
||||
src={alias("api", `nations/${result.nation}/flags/circle.webp`)}
|
||||
/>
|
||||
}
|
||||
discriminator={
|
||||
|
||||
@@ -76,7 +76,7 @@ const season = SEASONS[Math.floor(((month + 2) % 12) / 3)];
|
||||
class="wrapper"
|
||||
style={{
|
||||
backgroundPosition: season.position,
|
||||
backgroundImage: `url(${alias("api", `/hero/${season.name}.webp`)})`,
|
||||
backgroundImage: `url(${alias("api", `hero/${season.name}.webp`)})`,
|
||||
}}
|
||||
>
|
||||
<div class="blur"></div>
|
||||
|
||||
@@ -34,7 +34,7 @@ function AugmentIcon({ icon, isCommon }: AugmentIconProps) {
|
||||
return (
|
||||
<LazyImage
|
||||
alt=""
|
||||
src={alias("api", `/icons/augments/${icon}.webp`)}
|
||||
src={alias("api", `icons/augments/${icon}.webp`)}
|
||||
className={shared.icon}
|
||||
/>
|
||||
);
|
||||
@@ -59,7 +59,7 @@ function Price({ xp }: PriceProps) {
|
||||
return (
|
||||
<div className={shared.price}>
|
||||
<Text size="minor">{formatCompact(locale, xp)}</Text>
|
||||
<LazyImage alt="xp" src={alias("api", "/icons/currencies/xp.webp")} />
|
||||
<LazyImage alt="xp" src={alias("api", "icons/currencies/xp.webp")} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ function Content({ tank, gun, selected, onToggle }: ContentProps) {
|
||||
onClick={() => onToggle(consumable.id)}
|
||||
>
|
||||
<LazyImage
|
||||
src={alias("api", `/icons/consumables/${consumable.id}.webp`)}
|
||||
src={alias("api", `icons/consumables/${consumable.id}.webp`)}
|
||||
/>
|
||||
<div className={styles.info}>
|
||||
{duration > 0 && (
|
||||
|
||||
@@ -73,7 +73,7 @@ function Slot({ slot, slotIndex, selected, onToggle }: SlotProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", `/icons/equipment/${id}.webp`)}
|
||||
src={alias("api", `icons/equipment/${id}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -228,7 +228,7 @@ function ModuleNode({
|
||||
? tankIcon(unlock.id)
|
||||
: alias(
|
||||
"api",
|
||||
`/icons/modules/${moduleIconNames[unlock.type]}.webp`,
|
||||
`icons/modules/${moduleIconNames[unlock.type]}.webp`,
|
||||
)
|
||||
}
|
||||
/>
|
||||
@@ -240,7 +240,7 @@ function ModuleNode({
|
||||
<Text size="minor">{formatCompact(locale, unlock.cost!.value)}</Text>
|
||||
<LazyImage
|
||||
alt={unlock.cost!.type}
|
||||
src={alias("api", `/icons/currencies/${unlock.cost!.type}.webp`)}
|
||||
src={alias("api", `icons/currencies/${unlock.cost!.type}.webp`)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -57,7 +57,7 @@ function Content({
|
||||
onClick={() => onToggle(provision.id)}
|
||||
>
|
||||
<LazyImage
|
||||
src={alias("api", `/icons/provisions/${provision.id}.webp`)}
|
||||
src={alias("api", `icons/provisions/${provision.id}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -37,7 +37,7 @@ export function LoadoutShells({ gun, selected, onSelect }: LoadoutShellsProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", `/icons/shells/${candidate.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${candidate.icon}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -50,7 +50,7 @@ function Content({ selected, onChange }: ContentProps) {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<LazyImage src={alias("api", `/icons/skills/${skill}.webp`)} />
|
||||
<LazyImage src={alias("api", `icons/skills/${skill}.webp`)} />
|
||||
{level > 0 && (
|
||||
<Discriminator inset="small">{romanize(level)}</Discriminator>
|
||||
)}
|
||||
|
||||
@@ -63,7 +63,7 @@ export function MixerModuleChooser({
|
||||
style={{
|
||||
backgroundImage: `url(${alias(
|
||||
"api",
|
||||
`/tanks/${tank}/icons/big.webp`,
|
||||
`tanks/${tank}/icons/big.webp`,
|
||||
)})`,
|
||||
}}
|
||||
/>
|
||||
@@ -105,7 +105,7 @@ export function MixerModuleChooser({
|
||||
>
|
||||
<LazyImage
|
||||
alt="turret"
|
||||
src={alias("api", "/icons/modules/turret.webp")}
|
||||
src={alias("api", "icons/modules/turret.webp")}
|
||||
/>
|
||||
|
||||
<Discriminator corner="top-left">
|
||||
@@ -140,7 +140,7 @@ export function MixerModuleChooser({
|
||||
>
|
||||
<LazyImage
|
||||
alt="gun"
|
||||
src={alias("api", "/icons/modules/gun.webp")}
|
||||
src={alias("api", "icons/modules/gun.webp")}
|
||||
/>
|
||||
|
||||
<Discriminator corner="top-left">
|
||||
|
||||
@@ -361,7 +361,7 @@ const groups = toolGroups.map((group) => {
|
||||
class="thumbnail"
|
||||
style={`background-image: url(${alias(
|
||||
"api",
|
||||
`/tools/${tool.id}/banners/thumbnail.webp`,
|
||||
`tools/${tool.id}/banners/thumbnail.webp`,
|
||||
)})`}
|
||||
/>
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ const filtered = Object.values(tools).filter(
|
||||
<div
|
||||
style={`background-image: url(${alias(
|
||||
"api",
|
||||
`/tools/${tool.id}/banners/thumbnail.webp`,
|
||||
`tools/${tool.id}/banners/thumbnail.webp`,
|
||||
)})`}
|
||||
class="logo"
|
||||
/>
|
||||
@@ -254,7 +254,7 @@ const filtered = Object.values(tools).filter(
|
||||
<div
|
||||
style={`background-image: url(${alias(
|
||||
"api",
|
||||
`/tools/${tool.id}/banners/thumbnail.webp`,
|
||||
`tools/${tool.id}/banners/thumbnail.webp`,
|
||||
)})`}
|
||||
class="logo"
|
||||
/>
|
||||
|
||||
@@ -20,7 +20,7 @@ export function SmallTankIcon({ id, size = HEIGHT }: SmallTankIconProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={`Tank ${id}`}
|
||||
src={alias("api", `/tanks/${id}/icons/small.webp`)}
|
||||
src={alias("api", `tanks/${id}/icons/small.webp`)}
|
||||
style={{
|
||||
transform: `scale(${(size / HEIGHT) * 100}%)`,
|
||||
transformOrigin: "top left",
|
||||
|
||||
@@ -68,13 +68,13 @@ export const TankCard = (props: MaybeSkeletonComponentProps<TankCardProps>) => {
|
||||
justifyContent: "flex-end",
|
||||
backgroundImage: `url(${alias(
|
||||
"api",
|
||||
`/nations/${props.tank.nation}/flags/scratched.webp`,
|
||||
`nations/${props.tank.nation}/flags/scratched.webp`,
|
||||
)})`,
|
||||
}}
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", `/tanks/${props.tank.id}/icons/big.webp`)}
|
||||
src={alias("api", `tanks/${props.tank.id}/icons/big.webp`)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export function TankSandboxLoader() {
|
||||
<div className={styles.loader} data-visible={isVisible}>
|
||||
<img
|
||||
className={styles.icon}
|
||||
src={alias("api", `/tanks/${tank}/icons/big.webp`)}
|
||||
src={alias("api", `tanks/${tank}/icons/big.webp`)}
|
||||
/>
|
||||
<Progress value={data.progress} />
|
||||
</div>
|
||||
|
||||
@@ -279,7 +279,7 @@ function NationsFilter() {
|
||||
<LazyImage
|
||||
className={styles.icon}
|
||||
key={nation}
|
||||
src={alias("api", `/nations/${nation}/flags/circle.webp`)}
|
||||
src={alias("api", `nations/${nation}/flags/circle.webp`)}
|
||||
/>
|
||||
))}
|
||||
</Button>
|
||||
@@ -315,7 +315,7 @@ function NationsFilter() {
|
||||
style={{
|
||||
backgroundImage: `url(${alias(
|
||||
"api",
|
||||
`/nations/${nation}/flags/scratched.webp`,
|
||||
`nations/${nation}/flags/scratched.webp`,
|
||||
)})`,
|
||||
}}
|
||||
/>
|
||||
@@ -615,7 +615,7 @@ function IndividualShellFilter({
|
||||
<LazyImage
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/shells/${shellTypeIcons[shells[index]]}${
|
||||
`icons/shells/${shellTypeIcons[shells[index]]}${
|
||||
premium ? "_premium" : ""
|
||||
}.webp`,
|
||||
)}
|
||||
@@ -663,7 +663,7 @@ function IndividualShellFilter({
|
||||
<LazyImage
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/shells/${shellTypeIcons[shellType]}${
|
||||
`icons/shells/${shellTypeIcons[shellType]}${
|
||||
premium ? "_premium" : ""
|
||||
}.webp`,
|
||||
)}
|
||||
@@ -811,7 +811,7 @@ function ConsumablesFilter() {
|
||||
<LazyImage
|
||||
key={consumable}
|
||||
className={styles.icon}
|
||||
src={alias("api", `/icons/consumables/${consumable}.webp`)}
|
||||
src={alias("api", `icons/consumables/${consumable}.webp`)}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -856,7 +856,7 @@ function ConsumablesFilter() {
|
||||
{unwrap(consumableDefinition.name!)}
|
||||
|
||||
<LazyImage
|
||||
src={alias("api", `/icons/consumables/${consumable}.webp`)}
|
||||
src={alias("api", `icons/consumables/${consumable}.webp`)}
|
||||
/>
|
||||
</DropdownMenu.CheckboxItem>
|
||||
);
|
||||
@@ -898,7 +898,7 @@ function ProvisionsFilter() {
|
||||
<LazyImage
|
||||
key={provision}
|
||||
className={styles.icon}
|
||||
src={alias("api", `/icons/provisions/${provision}.webp`)}
|
||||
src={alias("api", `icons/provisions/${provision}.webp`)}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -943,7 +943,7 @@ function ProvisionsFilter() {
|
||||
{unwrap(provisionDefinition.name!)}
|
||||
|
||||
<LazyImage
|
||||
src={alias("api", `/icons/provisions/${provision}.webp`)}
|
||||
src={alias("api", `icons/provisions/${provision}.webp`)}
|
||||
/>
|
||||
</DropdownMenu.CheckboxItem>
|
||||
);
|
||||
@@ -987,9 +987,9 @@ function GameModeAbilitiesFilter() {
|
||||
|
||||
const icons = [
|
||||
...abilities.map((ability) =>
|
||||
alias("api", `/icons/consumables/${ability}.webp`),
|
||||
alias("api", `icons/consumables/${ability}.webp`),
|
||||
),
|
||||
...powers.map((power) => alias("api", `/icons/provisions/${power}.webp`)),
|
||||
...powers.map((power) => alias("api", `icons/provisions/${power}.webp`)),
|
||||
];
|
||||
|
||||
return (
|
||||
@@ -1065,7 +1065,7 @@ function GameModeAbilitiesFilter() {
|
||||
<LazyImage
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/consumables/${consumable}.webp`,
|
||||
`icons/consumables/${consumable}.webp`,
|
||||
)}
|
||||
/>
|
||||
</DropdownMenu.CheckboxItem>
|
||||
@@ -1116,7 +1116,7 @@ function GameModeAbilitiesFilter() {
|
||||
<LazyImage
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/provisions/${provision}.webp`,
|
||||
`icons/provisions/${provision}.webp`,
|
||||
)}
|
||||
/>
|
||||
</DropdownMenu.CheckboxItem>
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ export function Firepower({
|
||||
alt={unwrap(thisShell.name!)}
|
||||
width={16}
|
||||
height={16}
|
||||
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${thisShell.icon}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ export function ShellSwitcher() {
|
||||
<LazyImage
|
||||
alt={unwrap(thisShell.name!)}
|
||||
style={{ width: "1.125rem", height: "1.125rem" }}
|
||||
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${thisShell.icon}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ export function RicochetVisualizer({ stats }: StatsAcceptorProps) {
|
||||
/>
|
||||
|
||||
<LazyImage
|
||||
src={alias("api", `/icons/shells/${shell.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${shell.icon}.webp`)}
|
||||
style={{
|
||||
objectFit: "contain",
|
||||
transform: "translate(-50%, -50%) rotate(-45deg)",
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ export function Equalizer() {
|
||||
borderRadius: "var(--radius-3) 0 0 var(--radius-3)",
|
||||
backgroundImage: `
|
||||
linear-gradient(90deg, var(--black-a3), var(--gray-1)),
|
||||
url(${alias("api", `/gamemodes/Insanity/banner.webp`)})
|
||||
url(${alias("api", `gamemodes/Insanity/banner.webp`)})
|
||||
`,
|
||||
backgroundSize: "auto, fit",
|
||||
backgroundPosition: "50% 25%",
|
||||
|
||||
@@ -37,7 +37,7 @@ export function MetaSection() {
|
||||
>
|
||||
<Box
|
||||
style={{
|
||||
background: `url(${alias("api", `/nations/${protagonist.nation}/flags/scratched.webp`)})`,
|
||||
background: `url(${alias("api", `nations/${protagonist.nation}/flags/scratched.webp`)})`,
|
||||
backgroundRepeat: "no-repeat",
|
||||
backgroundSize: "min(53rem, 80vw)",
|
||||
backgroundPosition: "-8rem 50%",
|
||||
@@ -64,7 +64,7 @@ export function MetaSection() {
|
||||
alt={protagonist.nation}
|
||||
src={alias(
|
||||
"api",
|
||||
`/nations/${protagonist.nation}/flags/circle.webp`,
|
||||
`nations/${protagonist.nation}/flags/circle.webp`,
|
||||
)}
|
||||
/>
|
||||
{
|
||||
@@ -135,7 +135,7 @@ export function MetaSection() {
|
||||
<LazyImage
|
||||
style={{ width: "1em", height: "1em" }}
|
||||
alt="gold"
|
||||
src={alias("api", "/icons/currencies/gold.webp")}
|
||||
src={alias("api", "icons/currencies/gold.webp")}
|
||||
/>
|
||||
</Flex>
|
||||
</Listing>
|
||||
@@ -154,7 +154,7 @@ export function MetaSection() {
|
||||
alt={TankPriceType[protagonist.price!.type]}
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/currencies/${
|
||||
`icons/currencies/${
|
||||
protagonist.price!.type ===
|
||||
TankPriceType.TANK_PRICE_TYPE_GOLD
|
||||
? "gold"
|
||||
@@ -172,7 +172,7 @@ export function MetaSection() {
|
||||
alt={TankPriceType[protagonist.price!.type]}
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/currencies/${
|
||||
`icons/currencies/${
|
||||
protagonist.price!.type ===
|
||||
TankPriceType.TANK_PRICE_TYPE_GOLD
|
||||
? "gold"
|
||||
@@ -194,7 +194,7 @@ export function MetaSection() {
|
||||
<LazyImage
|
||||
style={{ width: "1em", height: "1em" }}
|
||||
alt="xp"
|
||||
src={alias("api", "/icons/currencies/xp.webp")}
|
||||
src={alias("api", "icons/currencies/xp.webp")}
|
||||
/>
|
||||
</Flex>
|
||||
</Listing>
|
||||
|
||||
@@ -59,7 +59,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
|
||||
mx={highlight ? "2" : "0"}
|
||||
style={{
|
||||
background: highlight
|
||||
? `url(${alias("api", `/nations/${tank.nation}/flags/fade.webp`)})`
|
||||
? `url(${alias("api", `nations/${tank.nation}/flags/fade.webp`)})`
|
||||
: undefined,
|
||||
backgroundPosition: "center",
|
||||
backgroundSize: "cover",
|
||||
@@ -80,7 +80,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
|
||||
>
|
||||
<LazyImage
|
||||
alt={unwrap(tank.name!)}
|
||||
src={alias("api", `/tanks/${id}/icons/big.webp`)}
|
||||
src={alias("api", `tanks/${id}/icons/big.webp`)}
|
||||
width={64}
|
||||
height={64}
|
||||
style={{
|
||||
@@ -100,7 +100,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
|
||||
<Flex gap="1" align="center">
|
||||
<LazyImage
|
||||
alt="XP"
|
||||
src={alias("api", "/icons/currencies/xp.webp")}
|
||||
src={alias("api", "icons/currencies/xp.webp")}
|
||||
style={{
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
@@ -115,7 +115,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) {
|
||||
<Flex gap="1" align="center">
|
||||
<LazyImage
|
||||
alt="Silver"
|
||||
src={alias("api", "/icons/currencies/silver.webp")}
|
||||
src={alias("api", "icons/currencies/silver.webp")}
|
||||
style={{
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
|
||||
@@ -107,7 +107,7 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
<Flex gap="1" align="center">
|
||||
<LazyImage
|
||||
alt="XP"
|
||||
src={alias("api", "/icons/currencies/xp.webp")}
|
||||
src={alias("api", "icons/currencies/xp.webp")}
|
||||
style={{
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
@@ -123,7 +123,7 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) {
|
||||
<Flex gap="1" align="center">
|
||||
<LazyImage
|
||||
alt="Silver"
|
||||
src={alias("api", "/icons/currencies/silver.webp")}
|
||||
src={alias("api", "icons/currencies/silver.webp")}
|
||||
style={{
|
||||
width: "1em",
|
||||
height: "1em",
|
||||
|
||||
@@ -71,7 +71,7 @@ export function TankopediaAntagonistControl({
|
||||
<IconButton variant="soft" color="gray" size="major">
|
||||
<LazyImage
|
||||
alt={unwrap(protagonist.tank.name)}
|
||||
src={alias("api", `/tanks/${protagonist.tank.id}/icons/big.webp`)}
|
||||
src={alias("api", `tanks/${protagonist.tank.id}/icons/big.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</TankSearchDialog>
|
||||
@@ -103,7 +103,7 @@ export function TankopediaAntagonistControl({
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", "/icons/modules/gun.webp")}
|
||||
src={alias("api", "icons/modules/gun.webp")}
|
||||
/>
|
||||
|
||||
<Discriminator>{romanize(entry.gun.tier)}</Discriminator>
|
||||
@@ -138,7 +138,7 @@ export function TankopediaAntagonistControl({
|
||||
>
|
||||
<LazyImage
|
||||
alt={name}
|
||||
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${thisShell.icon}.webp`)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
@@ -173,7 +173,7 @@ export function TankopediaAntagonistControl({
|
||||
>
|
||||
<LazyImage
|
||||
alt={strings.tanks.antagonist_control.calibrated_shells}
|
||||
src={alias("api", "/icons/equipment/103.webp")}
|
||||
src={alias("api", "icons/equipment/103.webp")}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
@@ -202,7 +202,7 @@ export function TankopediaAntagonistControl({
|
||||
>
|
||||
<LazyImage
|
||||
alt={strings.tanks.antagonist_control.enhanced_armor}
|
||||
src={alias("api", "/icons/equipment/110.webp")}
|
||||
src={alias("api", "icons/equipment/110.webp")}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -100,13 +100,13 @@ const roles = Object.entries(tank.roles);
|
||||
{roles.map(([id, value]) => {
|
||||
const gameMode = gameDefinitions.gameModes[id];
|
||||
const role = gameDefinitions.roles[value];
|
||||
const banner = alias("api", `/gamemodes/${id}/banner.webp`);
|
||||
const banner = alias("api", `gamemodes/${id}/banner.webp`);
|
||||
const provisions = role.provisions.map((id) => ({
|
||||
icon: alias("api", `/icons/provisions/${id}.webp`),
|
||||
icon: alias("api", `icons/provisions/${id}.webp`),
|
||||
name: unwrap(provisionDefinitions.provisions[id].name!),
|
||||
}));
|
||||
const consumables = role.consumables.map((id) => ({
|
||||
icon: alias("api", `/icons/consumables/${id}.webp`),
|
||||
icon: alias("api", `icons/consumables/${id}.webp`),
|
||||
name: unwrap(consumableDefinitions.consumables[id].name!),
|
||||
}));
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ export function DynamicArmorSwitcher() {
|
||||
>
|
||||
<LazyImage
|
||||
alt="Dynamic Armor"
|
||||
src={alias("api", "/icons/consumables/73.webp")}
|
||||
src={alias("api", "icons/consumables/73.webp")}
|
||||
style={{
|
||||
width: "50%",
|
||||
height: "50%",
|
||||
|
||||
@@ -67,7 +67,7 @@ export function SpallLinerSwitcher() {
|
||||
alt={unwrap(
|
||||
provisionDefinitions.provisions[SPALL_LINER_PROVISION_ID].name!,
|
||||
)}
|
||||
src={alias("api", `/icons/provisions/${SPALL_LINER_PROVISION_ID}.webp`)}
|
||||
src={alias("api", `icons/provisions/${SPALL_LINER_PROVISION_ID}.webp`)}
|
||||
style={{
|
||||
width: "50%",
|
||||
height: "50%",
|
||||
@@ -90,7 +90,7 @@ export function SpallLinerSwitcher() {
|
||||
)}
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/provisions/${SPALL_LINER_PROVISION_ID}.webp`,
|
||||
`icons/provisions/${SPALL_LINER_PROVISION_ID}.webp`,
|
||||
)}
|
||||
style={{
|
||||
width: "1.25em",
|
||||
@@ -112,7 +112,7 @@ export function SpallLinerSwitcher() {
|
||||
>
|
||||
<LazyImage
|
||||
alt={unwrap(provisionDefinitions.provisions[id].name!)}
|
||||
src={alias("api", `/icons/provisions/${id}.webp`)}
|
||||
src={alias("api", `icons/provisions/${id}.webp`)}
|
||||
style={{
|
||||
width: "50%",
|
||||
height: "50%",
|
||||
|
||||
@@ -85,7 +85,7 @@ export function TankopediaSkinSwitcher() {
|
||||
alt={name}
|
||||
src={alias(
|
||||
"api",
|
||||
`/icons/camouflages/${camouflage.id}.webp`,
|
||||
`icons/camouflages/${camouflage.id}.webp`,
|
||||
)}
|
||||
/>
|
||||
</IconButton>
|
||||
|
||||
@@ -73,7 +73,7 @@ const compareState = stringify([id]);
|
||||
<div
|
||||
class="tankopedia-title"
|
||||
style={{
|
||||
backgroundImage: `url(${alias("api", `/nations/${tank.nation}/flags/fade.webp`)})`,
|
||||
backgroundImage: `url(${alias("api", `nations/${tank.nation}/flags/fade.webp`)})`,
|
||||
}}
|
||||
>
|
||||
<div class="gradient">
|
||||
|
||||
@@ -104,7 +104,7 @@ export function RicochetToy({ characteristics }: ToyProps) {
|
||||
<div className={styles.line} />
|
||||
<LazyImage
|
||||
className={styles.shell}
|
||||
src={alias("api", `/icons/shells/${protagonist.shell.icon}.webp`)}
|
||||
src={alias("api", `icons/shells/${protagonist.shell.icon}.webp`)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ const name = strings.tools[tool.id as keyof typeof strings.tools];
|
||||
<div
|
||||
class="tool-banner"
|
||||
style={{
|
||||
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/thumbnail.webp`)})`,
|
||||
backgroundImage: `url(${alias("api", `tools/${tool.id}/banners/thumbnail.webp`)})`,
|
||||
backgroundPosition: tool.banner_background_position ?? "top",
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -81,7 +81,7 @@ const name = strings.tools[tool.id as keyof typeof strings.tools];
|
||||
|
||||
<div
|
||||
style={{
|
||||
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/poster.webp`)})`,
|
||||
backgroundImage: `url(${alias("api", `tools/${tool.id}/banners/poster.webp`)})`,
|
||||
}}
|
||||
class="container"
|
||||
data-disabled={String(tool.disabled ?? false)}
|
||||
@@ -96,7 +96,7 @@ const name = strings.tools[tool.id as keyof typeof strings.tools];
|
||||
<div
|
||||
class="background"
|
||||
style={{
|
||||
backgroundImage: `url(${alias("api", `/tools/${tool.id}/banners/poster.webp`)})`,
|
||||
backgroundImage: `url(${alias("api", `tools/${tool.id}/banners/poster.webp`)})`,
|
||||
}}
|
||||
></div>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export function docImageId(url: string) {
|
||||
}
|
||||
|
||||
export function docImageUrl(url: string) {
|
||||
return alias("api", `/docs/images/${docImageId(url)}.webp`);
|
||||
return alias("api", `docs/images/${docImageId(url)}.webp`);
|
||||
}
|
||||
|
||||
export function externalDocImages(markdown: string) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { GLTFLoader } from "three-stdlib";
|
||||
import { useDispose } from "./useDispose";
|
||||
|
||||
export function useArmor(id: number) {
|
||||
const path = alias("models_tanks", `/${id}/collision.glb`);
|
||||
const path = alias("models_tanks", `${id}/collision.glb`);
|
||||
const gltf = useLoader(GLTFLoader, path);
|
||||
|
||||
useDispose(gltf, path);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { GLTFLoader } from "three-stdlib";
|
||||
import { useDispose } from "./useDispose";
|
||||
|
||||
export function useModel(id: number) {
|
||||
const path = alias("models_tanks", `/${id}/model.glb`);
|
||||
const path = alias("models_tanks", `${id}/model.glb`);
|
||||
const gltf = useLoader(GLTFLoader, path);
|
||||
|
||||
useDispose(gltf, path);
|
||||
|
||||
@@ -76,7 +76,7 @@ function preparePart(part: Object3D) {
|
||||
}
|
||||
|
||||
function skinPath(id: number, skin: number) {
|
||||
return alias("models_legendary", `/${id}/skins/${skin}.glb`);
|
||||
return alias("models_legendary", `${id}/skins/${skin}.glb`);
|
||||
}
|
||||
|
||||
/** whether an already loaded skin of this tank has animations */
|
||||
|
||||
Reference in new issue
Block a user