mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-26 03:59:53 +01:00
fix: invalidate frame on shell switch
This commit is contained in:
1 parent
e6b29a4ab8
commit
679bd2956b
2 files changed
+7
-1
No files matched your search
@@ -17,6 +17,7 @@ import {
|
|||||||
Tabs,
|
Tabs,
|
||||||
Text,
|
Text,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
|
import { invalidate } from '@react-three/fiber';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { ModuleButton } from '../../../../../../../components/ModuleButtons/ModuleButton';
|
import { ModuleButton } from '../../../../../../../components/ModuleButtons/ModuleButton';
|
||||||
import { SmallTankIcon } from '../../../../../../../components/SmallTankIcon';
|
import { SmallTankIcon } from '../../../../../../../components/SmallTankIcon';
|
||||||
@@ -216,6 +217,7 @@ export function Options({ thicknessRange }: OptionsProps) {
|
|||||||
marginTop: shellIndex === 0 ? 0 : -1,
|
marginTop: shellIndex === 0 ? 0 : -1,
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
invalidate();
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
draft.antagonist.shell = thisShell;
|
draft.antagonist.shell = thisShell;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { invalidate } from '@react-three/fiber';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { AdMidSectionResponsive } from '../../../../components/AdMidSectionResponsive';
|
import { AdMidSectionResponsive } from '../../../../components/AdMidSectionResponsive';
|
||||||
import PageWrapper from '../../../../components/PageWrapper';
|
import PageWrapper from '../../../../components/PageWrapper';
|
||||||
@@ -8,9 +9,9 @@ import * as Duel from '../../../../stores/duel';
|
|||||||
import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral';
|
import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral';
|
||||||
import { HistorySection } from './components/HistorySection';
|
import { HistorySection } from './components/HistorySection';
|
||||||
import { CharacteristicsSection } from './components/Model/CharacteristicsSection';
|
import { CharacteristicsSection } from './components/Model/CharacteristicsSection';
|
||||||
import { MetaSection } from './components/Model/MetaSection';
|
|
||||||
import { GameModeSection } from './components/Model/GameModeSection';
|
import { GameModeSection } from './components/Model/GameModeSection';
|
||||||
import { HeroSection } from './components/Model/HeroSection';
|
import { HeroSection } from './components/Model/HeroSection';
|
||||||
|
import { MetaSection } from './components/Model/MetaSection';
|
||||||
import { TechTreeSection } from './components/Model/TechTreeSection';
|
import { TechTreeSection } from './components/Model/TechTreeSection';
|
||||||
import { ShotDisplaySection } from './components/ShotDisplaySection';
|
import { ShotDisplaySection } from './components/ShotDisplaySection';
|
||||||
import { TestingSection } from './components/TestingSection';
|
import { TestingSection } from './components/TestingSection';
|
||||||
@@ -34,11 +35,13 @@ export default function Page({ params }: { params: { id: string } }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.key === '1') {
|
if (event.key === '1') {
|
||||||
|
invalidate();
|
||||||
wipeShot();
|
wipeShot();
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
draft.antagonist.shell = draft.antagonist.gun.shells[0];
|
draft.antagonist.shell = draft.antagonist.gun.shells[0];
|
||||||
});
|
});
|
||||||
} else if (event.key === '2') {
|
} else if (event.key === '2') {
|
||||||
|
invalidate();
|
||||||
wipeShot();
|
wipeShot();
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
if (draft.antagonist.gun.shells[1]) {
|
if (draft.antagonist.gun.shells[1]) {
|
||||||
@@ -46,6 +49,7 @@ export default function Page({ params }: { params: { id: string } }) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (event.key === '3') {
|
} else if (event.key === '3') {
|
||||||
|
invalidate();
|
||||||
wipeShot();
|
wipeShot();
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
if (draft.antagonist.gun.shells[2]) {
|
if (draft.antagonist.gun.shells[2]) {
|
||||||
|
|||||||
Reference in new issue
Block a user