mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8a5f57787 | ||
|
|
13651650ab | ||
|
|
9644692084 | ||
|
|
b52c3c6c68 |
No files matched your search
Vendored
+1
@@ -24,6 +24,7 @@
|
|||||||
"fullstats",
|
"fullstats",
|
||||||
"fuzzysort",
|
"fuzzysort",
|
||||||
"gamemode",
|
"gamemode",
|
||||||
|
"haha",
|
||||||
"immer",
|
"immer",
|
||||||
"JOINTINDEX",
|
"JOINTINDEX",
|
||||||
"JOINTWEIGHT",
|
"JOINTWEIGHT",
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Blitzkrieg 1.15.12
|
||||||
|
|
||||||
|
Sometimes embeds need love too.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Session embeds are now translucent by default
|
||||||
|
- Session embed titles are now the username of the player by default
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Blitzkrieg 1.15.13
|
||||||
|
|
||||||
|
I have run out of things to say here. This patch fixes like 1 thing haha.
|
||||||
|
|
||||||
|
# Technical Fixes
|
||||||
|
|
||||||
|
- Tank deltas are now filtered by last battle time
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkrieg",
|
"name": "blitzkrieg",
|
||||||
"version": "1.15.11",
|
"version": "1.15.13",
|
||||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -14,14 +14,21 @@ import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
|||||||
import calculateWN8 from '../../../core/statistics/calculateWN8';
|
import calculateWN8 from '../../../core/statistics/calculateWN8';
|
||||||
import { deltaTankStats } from '../../../core/statistics/deltaTankStats';
|
import { deltaTankStats } from '../../../core/statistics/deltaTankStats';
|
||||||
import getWN8Percentile from '../../../core/statistics/getWN8Percentile';
|
import getWN8Percentile from '../../../core/statistics/getWN8Percentile';
|
||||||
import { resetSession, useSession } from '../../../stores/session';
|
import mutateSession, {
|
||||||
|
resetSession,
|
||||||
|
useSession,
|
||||||
|
} from '../../../stores/session';
|
||||||
import { IndividualTankStats, TanksStats } from '../../../types/tanksStats';
|
import { IndividualTankStats, TanksStats } from '../../../types/tanksStats';
|
||||||
import { CustomColumnDisplay } from '../../tools/session/components/CustomColumn';
|
import { CustomColumnDisplay } from '../../tools/session/components/CustomColumn';
|
||||||
import { Menu } from '../../tools/session/components/Menu';
|
import { Menu } from '../../tools/session/components/Menu';
|
||||||
|
|
||||||
const REFRESH_RATE = 1 / 5;
|
const REFRESH_RATE = 1 / 5;
|
||||||
|
|
||||||
export default function SessionPage() {
|
interface SessionPageProps {
|
||||||
|
naked?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SessionPage({ naked = true }: SessionPageProps) {
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const since = session.isTracking ? new Date(session.time) : undefined;
|
const since = session.isTracking ? new Date(session.time) : undefined;
|
||||||
const [diff, setDiff] = useState<
|
const [diff, setDiff] = useState<
|
||||||
@@ -72,6 +79,14 @@ export default function SessionPage() {
|
|||||||
0,
|
0,
|
||||||
) / careerBattles;
|
) / careerBattles;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (session.title === 'Untitled session') {
|
||||||
|
mutateSession((draft) => {
|
||||||
|
if (draft.isTracking) draft.title = draft.nickname;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [session.title]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function recalculateDiff() {
|
async function recalculateDiff() {
|
||||||
if (session.isTracking) {
|
if (session.isTracking) {
|
||||||
@@ -114,7 +129,7 @@ export default function SessionPage() {
|
|||||||
|
|
||||||
list: (
|
list: (
|
||||||
Object.values(
|
Object.values(
|
||||||
deltaTankStats(session.tankStats, career),
|
deltaTankStats(session.tankStats, career, session.time / 1000),
|
||||||
) as IndividualTankStats[]
|
) as IndividualTankStats[]
|
||||||
).map((stats) => {
|
).map((stats) => {
|
||||||
return {
|
return {
|
||||||
@@ -207,6 +222,7 @@ export default function SessionPage() {
|
|||||||
since !== undefined &&
|
since !== undefined &&
|
||||||
diff !== undefined && (
|
diff !== undefined && (
|
||||||
<Breakdown.Row
|
<Breakdown.Row
|
||||||
|
naked={naked}
|
||||||
color={session.color}
|
color={session.color}
|
||||||
minimized={!session.showCareer}
|
minimized={!session.showCareer}
|
||||||
title={session.title}
|
title={session.title}
|
||||||
@@ -288,6 +304,7 @@ export default function SessionPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Breakdown.Row
|
<Breakdown.Row
|
||||||
|
naked={naked}
|
||||||
color={session.color}
|
color={session.color}
|
||||||
key={stats.tank_id}
|
key={stats.tank_id}
|
||||||
minimized={!session.showCareer}
|
minimized={!session.showCareer}
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ export default function Page() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SessionPage />
|
<SessionPage naked={false} />
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ export interface RowStatItem {
|
|||||||
|
|
||||||
interface RowProps {
|
interface RowProps {
|
||||||
type?: 'tank' | 'summary';
|
type?: 'tank' | 'summary';
|
||||||
|
naked?: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
treeType?: TreeTypeEnum;
|
treeType?: TreeTypeEnum;
|
||||||
@@ -33,18 +34,23 @@ export function Row({
|
|||||||
minimized,
|
minimized,
|
||||||
tankType,
|
tankType,
|
||||||
treeType,
|
treeType,
|
||||||
|
naked = false,
|
||||||
type,
|
type,
|
||||||
}: RowProps) {
|
}: RowProps) {
|
||||||
const theme = createColors(PALETTES[`${color}Dark`]);
|
const palette = PALETTES[`${color}Dark`];
|
||||||
|
const theme = createColors(palette);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="session-tracker-row"
|
className="session-tracker-row"
|
||||||
style={{
|
style={{
|
||||||
|
maxWidth: naked ? 600 : undefined,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
backgroundColor: theme.appBackground2,
|
backgroundColor: naked
|
||||||
|
? `${theme.appBackground2}c0`
|
||||||
|
: theme.appBackground2,
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -55,7 +61,9 @@ export function Row({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
padding: 8,
|
padding: 8,
|
||||||
gap: 4,
|
gap: 4,
|
||||||
backgroundColor: theme.componentInteractive,
|
backgroundColor: naked
|
||||||
|
? `${theme.componentInteractive}c0`
|
||||||
|
: theme.componentInteractive,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{type === 'tank' && tankType !== undefined && (
|
{type === 'tank' && tankType !== undefined && (
|
||||||
|
|||||||
@@ -4,13 +4,17 @@ import {
|
|||||||
emptyIndividualTankStats,
|
emptyIndividualTankStats,
|
||||||
} from '../../types/tanksStats';
|
} from '../../types/tanksStats';
|
||||||
|
|
||||||
export function deltaTankStats(a: NormalizedTankStats, b: NormalizedTankStats) {
|
export function deltaTankStats(
|
||||||
|
a: NormalizedTankStats,
|
||||||
|
b: NormalizedTankStats,
|
||||||
|
time?: number,
|
||||||
|
) {
|
||||||
const bTanks = Object.keys(b);
|
const bTanks = Object.keys(b);
|
||||||
const changedTanks = bTanks.filter((id) => {
|
const changedTanks = bTanks.filter((id) => {
|
||||||
return (
|
return time === undefined
|
||||||
a[id as unknown as number]?.all.battles !==
|
? a[id as unknown as number]?.all.battles !==
|
||||||
b[id as unknown as number].all.battles
|
b[id as unknown as number].all.battles
|
||||||
);
|
: b[id as unknown as number].last_battle_time > time;
|
||||||
});
|
});
|
||||||
const diff = changedTanks.map((id) => {
|
const diff = changedTanks.map((id) => {
|
||||||
const aTank = a[id as unknown as number] ?? emptyIndividualTankStats;
|
const aTank = a[id as unknown as number] ?? emptyIndividualTankStats;
|
||||||
|
|||||||
Reference in new issue
Block a user