mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: reorder stuff
This commit is contained in:
1 parent
ba97a9f28b
commit
b20bb97ea3
4 files changed
+63
-15
No files matched your search
@@ -294,7 +294,7 @@ export interface TankDefinition {
|
|||||||
crew: Crew[];
|
crew: Crew[];
|
||||||
health: number;
|
health: number;
|
||||||
nation: string;
|
nation: string;
|
||||||
name: I18nString;
|
name: I18nString | undefined;
|
||||||
type: TankType;
|
type: TankType;
|
||||||
max_consumables: number;
|
max_consumables: number;
|
||||||
max_provisions: number;
|
max_provisions: number;
|
||||||
@@ -437,6 +437,7 @@ export interface GunDefinitionBase {
|
|||||||
|
|
||||||
export interface AssaultRanges {
|
export interface AssaultRanges {
|
||||||
ranges: AssaultRange[];
|
ranges: AssaultRange[];
|
||||||
|
types: ShellType[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AssaultRange {
|
export interface AssaultRange {
|
||||||
@@ -446,7 +447,7 @@ export interface AssaultRange {
|
|||||||
|
|
||||||
export interface ShellDefinition {
|
export interface ShellDefinition {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString | undefined;
|
name: I18nString;
|
||||||
velocity: number;
|
velocity: number;
|
||||||
armor_damage: number;
|
armor_damage: number;
|
||||||
module_damage: number;
|
module_damage: number;
|
||||||
@@ -3615,7 +3616,7 @@ export const GunDefinitionBase: MessageFns<GunDefinitionBase> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function createBaseAssaultRanges(): AssaultRanges {
|
function createBaseAssaultRanges(): AssaultRanges {
|
||||||
return { ranges: [] };
|
return { ranges: [], types: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AssaultRanges: MessageFns<AssaultRanges> = {
|
export const AssaultRanges: MessageFns<AssaultRanges> = {
|
||||||
@@ -3626,6 +3627,11 @@ export const AssaultRanges: MessageFns<AssaultRanges> = {
|
|||||||
for (const v of message.ranges) {
|
for (const v of message.ranges) {
|
||||||
AssaultRange.encode(v!, writer.uint32(10).fork()).join();
|
AssaultRange.encode(v!, writer.uint32(10).fork()).join();
|
||||||
}
|
}
|
||||||
|
writer.uint32(18).fork();
|
||||||
|
for (const v of message.types) {
|
||||||
|
writer.int32(v);
|
||||||
|
}
|
||||||
|
writer.join();
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -3645,6 +3651,24 @@ export const AssaultRanges: MessageFns<AssaultRanges> = {
|
|||||||
message.ranges.push(AssaultRange.decode(reader, reader.uint32()));
|
message.ranges.push(AssaultRange.decode(reader, reader.uint32()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case 2: {
|
||||||
|
if (tag === 16) {
|
||||||
|
message.types.push(reader.int32() as any);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag === 18) {
|
||||||
|
const end2 = reader.uint32() + reader.pos;
|
||||||
|
while (reader.pos < end2) {
|
||||||
|
message.types.push(reader.int32() as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((tag & 7) === 4 || tag === 0) {
|
if ((tag & 7) === 4 || tag === 0) {
|
||||||
break;
|
break;
|
||||||
@@ -3659,6 +3683,9 @@ export const AssaultRanges: MessageFns<AssaultRanges> = {
|
|||||||
ranges: globalThis.Array.isArray(object?.ranges)
|
ranges: globalThis.Array.isArray(object?.ranges)
|
||||||
? object.ranges.map((e: any) => AssaultRange.fromJSON(e))
|
? object.ranges.map((e: any) => AssaultRange.fromJSON(e))
|
||||||
: [],
|
: [],
|
||||||
|
types: globalThis.Array.isArray(object?.types)
|
||||||
|
? object.types.map((e: any) => shellTypeFromJSON(e))
|
||||||
|
: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -3667,6 +3694,9 @@ export const AssaultRanges: MessageFns<AssaultRanges> = {
|
|||||||
if (message.ranges?.length) {
|
if (message.ranges?.length) {
|
||||||
obj.ranges = message.ranges.map((e) => AssaultRange.toJSON(e));
|
obj.ranges = message.ranges.map((e) => AssaultRange.toJSON(e));
|
||||||
}
|
}
|
||||||
|
if (message.types?.length) {
|
||||||
|
obj.types = message.types.map((e) => shellTypeToJSON(e));
|
||||||
|
}
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -3681,6 +3711,7 @@ export const AssaultRanges: MessageFns<AssaultRanges> = {
|
|||||||
const message = createBaseAssaultRanges();
|
const message = createBaseAssaultRanges();
|
||||||
message.ranges =
|
message.ranges =
|
||||||
object.ranges?.map((e) => AssaultRange.fromPartial(e)) || [];
|
object.ranges?.map((e) => AssaultRange.fromPartial(e)) || [];
|
||||||
|
message.types = object.types?.map((e) => e) || [];
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ export function Body({ stats }: BodyProps) {
|
|||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} value="dpm" decimals={0} />
|
<CompareRow stats={stats} value="dpm" decimals={0} />
|
||||||
|
<CompareRow stats={stats} value="damage" decimals={0} />
|
||||||
|
{hasNonRegularGun && (
|
||||||
|
<CompareRow stats={stats} indent value="clipDamage" decimals={0} />
|
||||||
|
)}
|
||||||
|
<CompareRow stats={stats} value="moduleDamage" decimals={0} />
|
||||||
|
<CompareRow stats={stats} value="penetration" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
stats={stats}
|
stats={stats}
|
||||||
name={strings.website.tools.tankopedia.characteristics.values.reload}
|
name={strings.website.tools.tankopedia.characteristics.values.reload}
|
||||||
@@ -105,12 +111,6 @@ export function Body({ stats }: BodyProps) {
|
|||||||
<CompareRow stats={stats} value="shells" decimals={0} />
|
<CompareRow stats={stats} value="shells" decimals={0} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<CompareRow stats={stats} value="penetration" decimals={0} />
|
|
||||||
<CompareRow stats={stats} value="damage" decimals={0} />
|
|
||||||
{hasNonRegularGun && (
|
|
||||||
<CompareRow stats={stats} indent value="clipDamage" decimals={0} />
|
|
||||||
)}
|
|
||||||
<CompareRow stats={stats} value="moduleDamage" decimals={0} />
|
|
||||||
<CompareRow stats={stats} value="caliber" decimals={0} />
|
<CompareRow stats={stats} value="caliber" decimals={0} />
|
||||||
<CompareRow stats={stats} value="shellNormalization" decimals={0} />
|
<CompareRow stats={stats} value="shellNormalization" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
import type { AssaultRanges } from '@blitzkit/core';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
ranges: AssaultRanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AssaultRangesVisualizer({ ranges }: Props) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
+14
-6
@@ -21,6 +21,7 @@ import { useEquipment } from '../../../../../../hooks/useEquipment';
|
|||||||
import { useLocale } from '../../../../../../hooks/useLocale';
|
import { useLocale } from '../../../../../../hooks/useLocale';
|
||||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||||
import { Duel } from '../../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
|
import { AssaultRangesVisualizer } from './AssaultRangesVisualizer';
|
||||||
import { Info } from './Info';
|
import { Info } from './Info';
|
||||||
import { InfoWithDelta } from './InfoWithDelta';
|
import { InfoWithDelta } from './InfoWithDelta';
|
||||||
import { RicochetVisualizer } from './RicochetVisualizer';
|
import { RicochetVisualizer } from './RicochetVisualizer';
|
||||||
@@ -112,6 +113,19 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
{strings.common.gun_types[gun.gun_type!.$case]}
|
{strings.common.gun_types[gun.gun_type!.$case]}
|
||||||
</Info>
|
</Info>
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
||||||
|
{gun.gun_type!.$case !== 'regular' && (
|
||||||
|
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
||||||
|
)}
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
||||||
|
|
||||||
|
{gun.gun_type!.value.base.assault_ranges && (
|
||||||
|
<AssaultRangesVisualizer
|
||||||
|
ranges={gun.gun_type!.value.base.assault_ranges}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{gun.gun_type!.$case === 'auto_reloader' && (
|
{gun.gun_type!.$case === 'auto_reloader' && (
|
||||||
<InfoWithDelta stats={stats} decimals={0} indent value="dpmEffective" />
|
<InfoWithDelta stats={stats} decimals={0} indent value="dpmEffective" />
|
||||||
)}
|
)}
|
||||||
@@ -172,7 +186,6 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
)}
|
)}
|
||||||
{/* <ReloadVisualizer stats={stats} /> */}
|
{/* <ReloadVisualizer stats={stats} /> */}
|
||||||
|
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
|
||||||
{typeof shell.penetration !== 'number' && (
|
{typeof shell.penetration !== 'number' && (
|
||||||
<>
|
<>
|
||||||
<InfoWithDelta
|
<InfoWithDelta
|
||||||
@@ -240,11 +253,6 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
|
||||||
{gun.gun_type!.$case !== 'regular' && (
|
|
||||||
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
|
||||||
)}
|
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
|
||||||
{isExplosive(shell.type) && (
|
{isExplosive(shell.type) && (
|
||||||
<InfoWithDelta
|
<InfoWithDelta
|
||||||
stats={stats}
|
stats={stats}
|
||||||
|
|||||||
Reference in new issue
Block a user