Revamped weapon display and agent display

This commit is contained in:
2026-09-11 00:03:38 +02:00
parent d72d635702
commit 8400ec7632
2 changed files with 24 additions and 11 deletions

View File

@@ -1,3 +1,13 @@
export function Agent({side}: {side: "T" | "CT"}) { import { Surface } from "@heroui/react";
return <>{side}</>
} export function Agent({ agent_id }: { agent_id: string }) {
return (
<Surface className="bg-[#1f2937] flex justify-center flex-1 min-h-0 p-4">
<img
src={`/skins/${agent_id}_big.png`}
className="pointer-events-none object-contain object-bottom h-full w-full"
alt="Agent image"
/>
</Surface>
);
}

View File

@@ -5,8 +5,8 @@ export function Weapon({
weapon_id, weapon_id,
color, color,
display = "Weapon", display = "Weapon",
float = 0, float,
pattern = 0, pattern,
paint_index = 0, paint_index = 0,
}: { }: {
weapon_id: string; weapon_id: string;
@@ -27,21 +27,24 @@ export function Weapon({
}} }}
> >
<img <img
src={`/skins/${weapon_id}_${paint_index}.png`} src={`/skins/${weapon_id}_${paint_index || 0}.png`}
className="pointer-events-none object-contain object-bottom h-full" className="pointer-events-none object-contain object-bottom h-full"
alt="Weapon image"
/> />
</div> </div>
<div <div
className={`h-1 w-full`} className={`h-1 w-full`}
style={{ background: `${color}` }} style={{ background: `${color}` }}
></div> ></div>
<Typography.Heading level={6} className="px-2 text-wrap"> <Typography.Heading level={6} className="px-2 py-1 text-wrap">
{display} {display}
</Typography.Heading> </Typography.Heading>
<Float float={float} /> {float !== undefined && <Float float={float} />}
<Typography.Paragraph className="px-2"> {pattern !== undefined && (
Pattern: {pattern} <Typography.Paragraph className="px-2">
</Typography.Paragraph> Pattern: {pattern}
</Typography.Paragraph>
)}
</div> </div>
</Button> </Button>
); );