-
+
- opt && setWeaponId(Number(opt.value) as MainWeaponId)
+ opt && setMainWeaponId(Number(opt.value) as MainWeaponId)
}
+ className="w-full-important"
/>
+
@@ -58,6 +63,33 @@ export default function BuildAnalyzerPage() {
);
}
+function KitCards({ analyzed }: { analyzed: AnalyzedBuild }) {
+ const { t } = useTranslation("weapons");
+
+ return (
+
+
+
+ {t(`SUB_${analyzed.weapon.subWeaponSplId}`)}
+
+
+
+ {t(`SPECIAL_${analyzed.weapon.specialWeaponSplId}`)}
+
+
+ );
+}
+
function StatCategory({
title,
children,
diff --git a/app/routes/u.$identifier/builds/new.tsx b/app/routes/u.$identifier/builds/new.tsx
index 3c996c3a9..55858e9fb 100644
--- a/app/routes/u.$identifier/builds/new.tsx
+++ b/app/routes/u.$identifier/builds/new.tsx
@@ -28,6 +28,7 @@ import {
import type {
BuildAbilitiesTuple,
BuildAbilitiesTupleWithUnknown,
+ MainWeaponId,
} from "~/modules/in-game-lists/types";
import { parseRequestFormData } from "~/utils/remix";
import { modeImageUrl, userBuildsPage } from "~/utils/urls";
@@ -141,7 +142,7 @@ export const action: ActionFunction = async ({ request }) => {
clothesGearSplId: data["CLOTHES[value]"],
shoesGearSplId: data["SHOES[value]"],
modes: modesShort.filter((mode) => data[mode]),
- weaponSplIds: data["weapon[value]"],
+ weaponSplIds: data["weapon[value]"] as Array
,
ownerId: user.id,
};
if (data.buildToEditId) {
diff --git a/app/styles/analyzer.css b/app/styles/analyzer.css
index 924cd78e8..c2d3e883a 100644
--- a/app/styles/analyzer.css
+++ b/app/styles/analyzer.css
@@ -4,6 +4,26 @@
grid-template-columns: 1fr 2fr;
}
+.analyzer__kit-cards {
+ display: grid;
+ color: var(--text-lighter);
+ font-size: var(--fonts-xxs);
+ font-weight: var(--semi-bold);
+ gap: var(--s-2);
+ grid-template-columns: 1fr 1fr;
+}
+
+.analyzer__kit-card {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: var(--theme-transparent);
+ border-radius: var(--rounded);
+ gap: var(--s-1-5);
+ padding-block: var(--s-1);
+ padding-inline: var(--s-1-5);
+}
+
.analyzer__summary {
background-color: var(--bg-lighter);
border-radius: var(--rounded);
diff --git a/app/styles/utils.css b/app/styles/utils.css
index 87f891bfe..905c21cc4 100644
--- a/app/styles/utils.css
+++ b/app/styles/utils.css
@@ -38,6 +38,10 @@
width: 100%;
}
+.w-full-important {
+ width: 100% !important;
+}
+
.w-24 {
width: var(--s-24);
}
diff --git a/app/utils/urls.ts b/app/utils/urls.ts
index 81e3d5c79..95c3bf684 100644
--- a/app/utils/urls.ts
+++ b/app/utils/urls.ts
@@ -1,6 +1,11 @@
import type { Badge, GearType } from "~/db/types";
import type { ModeShort } from "~/modules/in-game-lists";
-import type { AbilityWithUnknown } from "~/modules/in-game-lists/types";
+import type {
+ AbilityWithUnknown,
+ MainWeaponId,
+ SpecialWeaponId,
+ SubWeaponId,
+} from "~/modules/in-game-lists/types";
export const PLUS_SERVER_DISCORD_URL = "https://discord.gg/FW4dKrY";
export const SENDOU_INK_DISCORD_URL = "https://discord.gg/sendou";
@@ -51,8 +56,12 @@ export const articlePreviewUrl = (slug: string) =>
export const navIconUrl = (navItem: string) => `/img/layout/${navItem}`;
export const gearImageUrl = (gearType: GearType, gearSplId: number) =>
`/img/gear/${gearType.toLowerCase()}/${gearSplId}`;
-export const weaponImageUrl = (weaponSplId: number) =>
- `/img/main-weapons/${weaponSplId}`;
+export const mainWeaponImageUrl = (mainWeaponSplId: MainWeaponId) =>
+ `/img/main-weapons/${mainWeaponSplId}`;
+export const subWeaponImageUrl = (subWeaponSplId: SubWeaponId) =>
+ `/img/sub-weapons/${subWeaponSplId}`;
+export const specialWeaponImageUrl = (specialWeaponSplId: SpecialWeaponId) =>
+ `/img/special-weapons/${specialWeaponSplId}`;
export const abilityImageUrl = (ability: AbilityWithUnknown) =>
`/img/abilities/${ability}`;
export const modeImageUrl = (mode: ModeShort) => `/img/modes/${mode}`;
diff --git a/scripts/create-analyzer-json.ts b/scripts/create-analyzer-json.ts
index 7cb979f45..9db60dda8 100644
--- a/scripts/create-analyzer-json.ts
+++ b/scripts/create-analyzer-json.ts
@@ -6,6 +6,7 @@
// xxx: internal name can be deleted when to prod
// xxx: finish merging with create-weapon-json
+import type { SpecialWeaponId } from "~/modules/in-game-lists";
import {
type SubWeaponId,
subWeaponIds,
@@ -200,7 +201,7 @@ function resolveSpecialWeaponId(weapon: MainWeapon) {
`Could not find special weapon for '${codeName}'`
);
- return specialWeaponObj.Id;
+ return specialWeaponObj.Id as SpecialWeaponId;
}
const overwriteSchema = z.object({