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