mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: synx quick equipment
This commit is contained in:
1 parent
b8beb6e8be
commit
0b12f65949
19 files changed
+69
-61
No files matched your search
@@ -3,7 +3,7 @@ import { use } from 'react';
|
|||||||
import { ConsumableButton } from '../../../../../../../components/ModuleButtons/ConsumableButton';
|
import { ConsumableButton } from '../../../../../../../components/ModuleButtons/ConsumableButton';
|
||||||
import { checkConsumableProvisionInclusivity } from '../../../../../../../core/blitzkrieg/checkConsumableProvisionInclusivity';
|
import { checkConsumableProvisionInclusivity } from '../../../../../../../core/blitzkrieg/checkConsumableProvisionInclusivity';
|
||||||
import { consumableDefinitions } from '../../../../../../../core/blitzkrieg/consumableDefinitions';
|
import { consumableDefinitions } from '../../../../../../../core/blitzkrieg/consumableDefinitions';
|
||||||
import { useEquipment } from '../../../../../../../core/blitzkrieg/useEquipment';
|
import { useEquipment } from '../../../../../../../hooks/useEquipment';
|
||||||
import { useDuel } from '../../../../../../../stores/duel';
|
import { useDuel } from '../../../../../../../stores/duel';
|
||||||
import {
|
import {
|
||||||
mutateTankopediaTemporary,
|
mutateTankopediaTemporary,
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ import {
|
|||||||
GUN_TYPE_NAMES,
|
GUN_TYPE_NAMES,
|
||||||
} from '../../../../../../core/blitzkrieg/tankDefinitions';
|
} from '../../../../../../core/blitzkrieg/tankDefinitions';
|
||||||
import { unionBoundingBox } from '../../../../../../core/blitzkrieg/unionBoundingBox';
|
import { unionBoundingBox } from '../../../../../../core/blitzkrieg/unionBoundingBox';
|
||||||
import { useConsumable } from '../../../../../../core/blitzkrieg/useConsumable';
|
import { useConsumable } from '../../../../../../hooks/useConsumable';
|
||||||
import { useEquipment } from '../../../../../../core/blitzkrieg/useEquipment';
|
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||||
import { useProvision } from '../../../../../../core/blitzkrieg/useProvision';
|
import { useProvision } from '../../../../../../hooks/useProvision';
|
||||||
import { useProvisions } from '../../../../../../core/blitzkrieg/useProvisions';
|
import { useProvisions } from '../../../../../../hooks/useProvisions';
|
||||||
import { useDuel } from '../../../../../../stores/duel';
|
import { useDuel } from '../../../../../../stores/duel';
|
||||||
import { useTankopediaTemporary } from '../../../../../../stores/tankopedia';
|
import { useTankopediaTemporary } from '../../../../../../stores/tankopedia';
|
||||||
import { Info } from './components/Info';
|
import { Info } from './components/Info';
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import { use, useEffect, useRef } from 'react';
|
|||||||
import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawLimits';
|
import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawLimits';
|
||||||
import { modelDefinitions } from '../../../../../../core/blitzkrieg/modelDefinitions';
|
import { modelDefinitions } from '../../../../../../core/blitzkrieg/modelDefinitions';
|
||||||
import { modelTransformEvent } from '../../../../../../core/blitzkrieg/modelTransform';
|
import { modelTransformEvent } from '../../../../../../core/blitzkrieg/modelTransform';
|
||||||
|
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||||
import { useDuel } from '../../../../../../stores/duel';
|
import { useDuel } from '../../../../../../stores/duel';
|
||||||
import mutateTankopediaPersistent, {
|
import {
|
||||||
mutateTankopediaTemporary,
|
mutateTankopediaTemporary,
|
||||||
useTankopediaPersistent,
|
|
||||||
useTankopediaTemporary,
|
useTankopediaTemporary,
|
||||||
} from '../../../../../../stores/tankopedia';
|
} from '../../../../../../stores/tankopedia';
|
||||||
import { QuickEquipmentButton } from './components/QuickEquipmentButton';
|
import { QuickEquipmentButton } from './components/QuickEquipmentButton';
|
||||||
@@ -17,8 +17,9 @@ export function RotationInputs() {
|
|||||||
const awaitedModelDefinitions = use(modelDefinitions);
|
const awaitedModelDefinitions = use(modelDefinitions);
|
||||||
const turretYawInput = useRef<HTMLInputElement>(null);
|
const turretYawInput = useRef<HTMLInputElement>(null);
|
||||||
const gunPitchInput = useRef<HTMLInputElement>(null);
|
const gunPitchInput = useRef<HTMLInputElement>(null);
|
||||||
const equipment = useTankopediaPersistent((state) => state.model.equipment);
|
|
||||||
const mode = useTankopediaTemporary((state) => state.mode);
|
const mode = useTankopediaTemporary((state) => state.mode);
|
||||||
|
const hasCalibratedShells = useEquipment(103);
|
||||||
|
const hasEnhancedArmor = useEquipment(110);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
turretYawInput.current!.value = `${-Math.round(
|
turretYawInput.current!.value = `${-Math.round(
|
||||||
@@ -155,21 +156,19 @@ export function RotationInputs() {
|
|||||||
<Flex gap="4">
|
<Flex gap="4">
|
||||||
<QuickEquipmentButton
|
<QuickEquipmentButton
|
||||||
equipment={103}
|
equipment={103}
|
||||||
active={equipment.calibratedShells}
|
active={hasCalibratedShells}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateTankopediaPersistent((draft) => {
|
mutateTankopediaTemporary((draft) => {
|
||||||
draft.model.equipment.calibratedShells =
|
draft.equipmentMatrix[0][0] = hasCalibratedShells ? 0 : 1;
|
||||||
!draft.model.equipment.calibratedShells;
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<QuickEquipmentButton
|
<QuickEquipmentButton
|
||||||
equipment={110}
|
equipment={110}
|
||||||
active={equipment.enhancedArmor}
|
active={hasEnhancedArmor}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateTankopediaPersistent((draft) => {
|
mutateTankopediaTemporary((draft) => {
|
||||||
draft.model.equipment.enhancedArmor =
|
draft.equipmentMatrix[1][1] = hasEnhancedArmor ? 0 : -1;
|
||||||
!draft.model.equipment.enhancedArmor;
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ import { getArchivedLatestSeasonNumber } from '../core/blitzkrieg/getArchivedLat
|
|||||||
import getArchivedRatingsInfo from '../core/blitzkrieg/getArchivedRatingsInfo';
|
import getArchivedRatingsInfo from '../core/blitzkrieg/getArchivedRatingsInfo';
|
||||||
import { getArchivedRatingsLeaderboard } from '../core/blitzkrieg/getArchivedRatingsLeaderboard';
|
import { getArchivedRatingsLeaderboard } from '../core/blitzkrieg/getArchivedRatingsLeaderboard';
|
||||||
import getArchivedRatingsMidnightLeaderboard from '../core/blitzkrieg/getArchivedRatingsMidnightLeaderboard';
|
import getArchivedRatingsMidnightLeaderboard from '../core/blitzkrieg/getArchivedRatingsMidnightLeaderboard';
|
||||||
import { UserError } from '../core/blitzkrieg/userError';
|
|
||||||
import addRegionChoices from '../core/discord/addRegionChoices';
|
import addRegionChoices from '../core/discord/addRegionChoices';
|
||||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||||
import embedNegative from '../core/discord/embedNegative';
|
import embedNegative from '../core/discord/embedNegative';
|
||||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||||
import { CommandRegistryRaw } from '../events/interactionCreate';
|
import { CommandRegistryRaw } from '../events/interactionCreate';
|
||||||
|
import { UserError } from '../hooks/userError';
|
||||||
|
|
||||||
export interface RatingsPlayer {
|
export interface RatingsPlayer {
|
||||||
spa_id: number;
|
spa_id: number;
|
||||||
|
|||||||
@@ -14,12 +14,15 @@ import { canRicochet } from '../../../../core/blitz/canRicochet';
|
|||||||
import { canSplash } from '../../../../core/blitz/canSplash';
|
import { canSplash } from '../../../../core/blitz/canSplash';
|
||||||
import { isExplosive } from '../../../../core/blitz/isExplosive';
|
import { isExplosive } from '../../../../core/blitz/isExplosive';
|
||||||
import { resolveNearPenetration } from '../../../../core/blitz/resolveNearPenetration';
|
import { resolveNearPenetration } from '../../../../core/blitz/resolveNearPenetration';
|
||||||
|
import { hasEquipment } from '../../../../core/blitzkrieg/hasEquipment';
|
||||||
|
import { useAwait } from '../../../../hooks/useAwait';
|
||||||
import { useDuel } from '../../../../stores/duel';
|
import { useDuel } from '../../../../stores/duel';
|
||||||
import {
|
import {
|
||||||
ArmorPiercingLayer,
|
ArmorPiercingLayer,
|
||||||
Shot,
|
Shot,
|
||||||
mutateTankopediaTemporary,
|
mutateTankopediaTemporary,
|
||||||
useTankopediaPersistent,
|
useTankopediaPersistent,
|
||||||
|
useTankopediaTemporary,
|
||||||
} from '../../../../stores/tankopedia';
|
} from '../../../../stores/tankopedia';
|
||||||
import { externalModuleMaskRenderTarget } from '../ExternalModuleMask';
|
import { externalModuleMaskRenderTarget } from '../ExternalModuleMask';
|
||||||
import { spacedArmorDepthRenderTarget } from '../SpacedArmorDepth';
|
import { spacedArmorDepthRenderTarget } from '../SpacedArmorDepth';
|
||||||
@@ -52,19 +55,22 @@ export function ArmorMesh({
|
|||||||
const surfaceNormal = new Vector3();
|
const surfaceNormal = new Vector3();
|
||||||
const mesh = useRef<Mesh>(null);
|
const mesh = useRef<Mesh>(null);
|
||||||
const scene = useThree((state) => state.scene);
|
const scene = useThree((state) => state.scene);
|
||||||
|
const hasCalibratedShells = useAwait(hasEquipment(103));
|
||||||
|
const hasEnhancedArmor = useAwait(hasEquipment(110));
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function updateQuickEquipments() {
|
async function updateQuickEquipments() {
|
||||||
const equipment = useTankopediaPersistent.getState().model.equipment;
|
|
||||||
const shell = useDuel.getState().antagonist!.shell;
|
const shell = useDuel.getState().antagonist!.shell;
|
||||||
const nearPenetration = resolveNearPenetration(shell.penetration);
|
const nearPenetration = resolveNearPenetration(shell.penetration);
|
||||||
|
const hasCalibratedShells = await hasEquipment(103);
|
||||||
|
const hasEnhancedArmor = await hasEquipment(110);
|
||||||
|
|
||||||
if (material.current) {
|
if (material.current) {
|
||||||
material.current.uniforms.thickness.value =
|
material.current.uniforms.thickness.value =
|
||||||
thickness * (equipment.enhancedArmor ? 1.04 : 1);
|
thickness * (hasEnhancedArmor ? 1.04 : 1);
|
||||||
material.current.uniforms.penetration.value =
|
material.current.uniforms.penetration.value =
|
||||||
nearPenetration *
|
nearPenetration *
|
||||||
(equipment.calibratedShells ? (explosionCapable ? 1.1 : 1.05) : 1);
|
(hasCalibratedShells ? (isExplosive(shell.type) ? 1.1 : 1.05) : 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +93,8 @@ export function ArmorMesh({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
useTankopediaPersistent.subscribe(
|
useTankopediaTemporary.subscribe(
|
||||||
(state) => state.model.equipment,
|
(state) => state.equipmentMatrix,
|
||||||
updateQuickEquipments,
|
updateQuickEquipments,
|
||||||
),
|
),
|
||||||
useDuel.subscribe(
|
useDuel.subscribe(
|
||||||
@@ -145,7 +151,7 @@ export function ArmorMesh({
|
|||||||
} satisfies ArmorMeshUserData
|
} satisfies ArmorMeshUserData
|
||||||
}
|
}
|
||||||
ref={mesh}
|
ref={mesh}
|
||||||
onClick={(event) => {
|
onClick={async (event) => {
|
||||||
// if (useTankopediaTemporary.getState().mode !== 'armor') return;
|
// if (useTankopediaTemporary.getState().mode !== 'armor') return;
|
||||||
|
|
||||||
shellNormal.copy(
|
shellNormal.copy(
|
||||||
@@ -154,16 +160,12 @@ export function ArmorMesh({
|
|||||||
surfaceNormal
|
surfaceNormal
|
||||||
.copy(event.normal!)
|
.copy(event.normal!)
|
||||||
.applyQuaternion(event.object.getWorldQuaternion(new Quaternion()));
|
.applyQuaternion(event.object.getWorldQuaternion(new Quaternion()));
|
||||||
const equipment = useTankopediaPersistent.getState().model.equipment;
|
|
||||||
const angle = Math.acos(surfaceNormal.dot(shellNormal));
|
const angle = Math.acos(surfaceNormal.dot(shellNormal));
|
||||||
const shell = useDuel.getState().antagonist!.shell;
|
const shell = useDuel.getState().antagonist!.shell;
|
||||||
|
const hasCalibratedShells = await hasEquipment(103);
|
||||||
const resolvedPenetration =
|
const resolvedPenetration =
|
||||||
resolveNearPenetration(shell.penetration) *
|
resolveNearPenetration(shell.penetration) *
|
||||||
(equipment.calibratedShells
|
(hasCalibratedShells ? (isExplosive(shell.type) ? 1.1 : 1.05) : 1);
|
||||||
? isExplosive(shell.type)
|
|
||||||
? 1.1
|
|
||||||
: 1.05
|
|
||||||
: 1);
|
|
||||||
const indexedObjects = new Set<ArmorMeshUserData['type']>();
|
const indexedObjects = new Set<ArmorMeshUserData['type']>();
|
||||||
const intersections = event.intersections
|
const intersections = event.intersections
|
||||||
.filter(({ object }) => Boolean(object.userData.type))
|
.filter(({ object }) => Boolean(object.userData.type))
|
||||||
@@ -188,7 +190,8 @@ export function ArmorMesh({
|
|||||||
) + 1,
|
) + 1,
|
||||||
);
|
);
|
||||||
const coreArmorMesh = intersectionsTillFirstCoreArmor.at(-1)!.object;
|
const coreArmorMesh = intersectionsTillFirstCoreArmor.at(-1)!.object;
|
||||||
const thicknessCoefficient = equipment.enhancedArmor ? 1.04 : 1;
|
const hasEnhancedArmor = await hasEquipment(110);
|
||||||
|
const thicknessCoefficient = hasEnhancedArmor ? 1.04 : 1;
|
||||||
|
|
||||||
if (mesh.current !== (coreArmorMesh as unknown as Mesh)) return;
|
if (mesh.current !== (coreArmorMesh as unknown as Mesh)) return;
|
||||||
|
|
||||||
@@ -405,18 +408,12 @@ export function ArmorMesh({
|
|||||||
canRicochet: { value: ricochetCapable },
|
canRicochet: { value: ricochetCapable },
|
||||||
canSplash: { value: canSplash(initialShell.type) },
|
canSplash: { value: canSplash(initialShell.type) },
|
||||||
thickness: {
|
thickness: {
|
||||||
value:
|
value: thickness * (hasEnhancedArmor ? 1.04 : 1),
|
||||||
thickness *
|
|
||||||
(initialTankopedia.model.equipment.enhancedArmor ? 1.04 : 1),
|
|
||||||
},
|
},
|
||||||
penetration: {
|
penetration: {
|
||||||
value:
|
value:
|
||||||
resolveNearPenetration(initialShell.penetration) *
|
resolveNearPenetration(initialShell.penetration) *
|
||||||
(initialTankopedia.model.equipment.calibratedShells
|
(hasCalibratedShells ? (explosionCapable ? 1.1 : 1.05) : 1),
|
||||||
? explosionCapable
|
|
||||||
? 1.1
|
|
||||||
: 1.05
|
|
||||||
: 1),
|
|
||||||
},
|
},
|
||||||
caliber: { value: initialShell.caliber },
|
caliber: { value: initialShell.caliber },
|
||||||
ricochetAngle: { value: degToRad(initialShell.ricochet ?? 90) },
|
ricochetAngle: { value: degToRad(initialShell.ricochet ?? 90) },
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Region } from '../../constants/regions';
|
import { Region } from '../../constants/regions';
|
||||||
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
import { WARGAMING_APPLICATION_ID } from '../../constants/wargamingApplicationID';
|
||||||
|
import { UserError } from '../../hooks/userError';
|
||||||
import { TanksStats } from '../../types/tanksStats';
|
import { TanksStats } from '../../types/tanksStats';
|
||||||
import { UserError } from '../blitzkrieg/userError';
|
|
||||||
import fetchBlitz from './fetchBlitz';
|
import fetchBlitz from './fetchBlitz';
|
||||||
|
|
||||||
export default async function getTankStats(region: Region, id: number) {
|
export default async function getTankStats(region: Region, id: number) {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { go } from 'fuzzysort';
|
import { go } from 'fuzzysort';
|
||||||
|
import { UserError } from '../../hooks/userError';
|
||||||
import {
|
import {
|
||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
tanksDefinitionsArray,
|
tanksDefinitionsArray,
|
||||||
} from '../blitzkrieg/tankDefinitions';
|
} from '../blitzkrieg/tankDefinitions';
|
||||||
import { UserError } from '../blitzkrieg/userError';
|
|
||||||
|
|
||||||
export default async function resolveTankId(tank: string | number) {
|
export default async function resolveTankId(tank: string | number) {
|
||||||
const number = typeof tank === 'string' ? parseInt(tank) : tank;
|
const number = typeof tank === 'string' ? parseInt(tank) : tank;
|
||||||
|
|||||||
@@ -25,3 +25,5 @@ export interface EquipmentDefinitions {
|
|||||||
export const equipmentDefinitions = fetchCdonLz4<EquipmentDefinitions>(
|
export const equipmentDefinitions = fetchCdonLz4<EquipmentDefinitions>(
|
||||||
asset('definitions/equipment.cdon.lz4'),
|
asset('definitions/equipment.cdon.lz4'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
equipmentDefinitions.then(console.log);
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { useDuel } from '../../stores/duel';
|
||||||
|
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
||||||
|
import { equipmentDefinitions } from './equipmentDefinitions';
|
||||||
|
|
||||||
|
export async function hasEquipment(id: number) {
|
||||||
|
const awaitedEquipmentDefinitions = await equipmentDefinitions;
|
||||||
|
const protagonist = useDuel.getState().protagonist!;
|
||||||
|
const equipmentRows =
|
||||||
|
awaitedEquipmentDefinitions.presets[protagonist.tank.equipment];
|
||||||
|
const equipmentMatrix = useTankopediaTemporary.getState().equipmentMatrix;
|
||||||
|
|
||||||
|
return equipmentRows.some((equipmentRow, rowIndex) => {
|
||||||
|
return equipmentRow.some((equipment, columnIndex) => {
|
||||||
|
const choice = equipmentMatrix[rowIndex][columnIndex];
|
||||||
|
if (choice === 0) return false;
|
||||||
|
const equipped = equipment[choice === -1 ? 0 : 1];
|
||||||
|
return equipped === id;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -17,5 +17,3 @@ export interface ProvisionDefinitions {
|
|||||||
export const provisionDefinitions = fetchCdonLz4<ProvisionDefinitions>(
|
export const provisionDefinitions = fetchCdonLz4<ProvisionDefinitions>(
|
||||||
asset('definitions/provisions.cdon.lz4'),
|
asset('definitions/provisions.cdon.lz4'),
|
||||||
);
|
);
|
||||||
|
|
||||||
provisionDefinitions.then(console.log);
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ChatInputCommandInteraction } from 'discord.js';
|
import { ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { Region } from '../../constants/regions';
|
import { Region } from '../../constants/regions';
|
||||||
|
import { UserError } from '../../hooks/userError';
|
||||||
import searchClansAcrossRegions from '../blitz/searchClansAcrossRegions';
|
import searchClansAcrossRegions from '../blitz/searchClansAcrossRegions';
|
||||||
import { UserError } from '../blitzkrieg/userError';
|
|
||||||
import { serverAndIdPattern } from './resolvePlayerFromCommand';
|
import { serverAndIdPattern } from './resolvePlayerFromCommand';
|
||||||
|
|
||||||
export default async function resolveClanFromCommand(
|
export default async function resolveClanFromCommand(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { Region } from '../../constants/regions';
|
import { Region } from '../../constants/regions';
|
||||||
|
import { UserError } from '../../hooks/userError';
|
||||||
import searchPlayersAcrossRegions from '../blitz/searchPlayersAcrossRegions';
|
import searchPlayersAcrossRegions from '../blitz/searchPlayersAcrossRegions';
|
||||||
import { getBlitzFromDiscord } from '../blitzkrieg/discordBlitz';
|
import { getBlitzFromDiscord } from '../blitzkrieg/discordBlitz';
|
||||||
import { UserError } from '../blitzkrieg/userError';
|
|
||||||
|
|
||||||
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ import {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { commands } from '..';
|
import { commands } from '..';
|
||||||
import discord from '../../../../discord.json' assert { type: 'json' };
|
import discord from '../../../../discord.json' assert { type: 'json' };
|
||||||
import { UserError } from '../../../core/blitzkrieg/userError';
|
|
||||||
import buttonLink from '../../../core/discord/buttonLink';
|
import buttonLink from '../../../core/discord/buttonLink';
|
||||||
import embedNegative from '../../../core/discord/embedNegative';
|
import embedNegative from '../../../core/discord/embedNegative';
|
||||||
import embedWarning from '../../../core/discord/embedWarning';
|
import embedWarning from '../../../core/discord/embedWarning';
|
||||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
|
||||||
import { psa } from '../../../core/discord/psa';
|
import { psa } from '../../../core/discord/psa';
|
||||||
|
import { UserError } from '../../../hooks/userError';
|
||||||
|
|
||||||
export default async function handleChatInputCommand(
|
export default async function handleChatInputCommand(
|
||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
import { useTankopediaTemporary } from '../stores/tankopedia';
|
||||||
|
|
||||||
export function useConsumable(id: number) {
|
export function useConsumable(id: number) {
|
||||||
const consumables = useTankopediaTemporary((state) => state.consumables);
|
const consumables = useTankopediaTemporary((state) => state.consumables);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { use, useMemo } from 'react';
|
import { use, useMemo } from 'react';
|
||||||
import { useDuel } from '../../stores/duel';
|
import { equipmentDefinitions } from '../core/blitzkrieg/equipmentDefinitions';
|
||||||
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
import { useDuel } from '../stores/duel';
|
||||||
import { equipmentDefinitions } from './equipmentDefinitions';
|
import { useTankopediaTemporary } from '../stores/tankopedia';
|
||||||
|
|
||||||
export function useEquipment(id: number) {
|
export function useEquipment(id: number) {
|
||||||
const awaitedEquipmentDefinitions = use(equipmentDefinitions);
|
const awaitedEquipmentDefinitions = use(equipmentDefinitions);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
import { useTankopediaTemporary } from '../stores/tankopedia';
|
||||||
|
|
||||||
export function useProvision(id: number) {
|
export function useProvision(id: number) {
|
||||||
const provisions = useTankopediaTemporary((state) => state.provisions);
|
const provisions = useTankopediaTemporary((state) => state.provisions);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { use } from 'react';
|
import { use } from 'react';
|
||||||
import { useTankopediaTemporary } from '../../stores/tankopedia';
|
import { provisionDefinitions } from '../core/blitzkrieg/provisionDefinitions';
|
||||||
import { provisionDefinitions } from './provisionDefinitions';
|
import { useTankopediaTemporary } from '../stores/tankopedia';
|
||||||
|
|
||||||
export function useProvisions() {
|
export function useProvisions() {
|
||||||
const provisions = useTankopediaTemporary((state) => state.provisions);
|
const provisions = useTankopediaTemporary((state) => state.provisions);
|
||||||
File renamed without changes.
@@ -29,10 +29,6 @@ export interface DuelMember {
|
|||||||
}
|
}
|
||||||
interface TankopediaPersistent {
|
interface TankopediaPersistent {
|
||||||
model: {
|
model: {
|
||||||
equipment: {
|
|
||||||
enhancedArmor: boolean;
|
|
||||||
calibratedShells: boolean;
|
|
||||||
};
|
|
||||||
visual: {
|
visual: {
|
||||||
environment: (typeof ENVIRONMENTS)[number];
|
environment: (typeof ENVIRONMENTS)[number];
|
||||||
controlsEnabled: boolean;
|
controlsEnabled: boolean;
|
||||||
@@ -134,10 +130,6 @@ export const useTankopediaPersistent = create<TankopediaPersistent>()(
|
|||||||
persist(
|
persist(
|
||||||
subscribeWithSelector<TankopediaPersistent>(() => ({
|
subscribeWithSelector<TankopediaPersistent>(() => ({
|
||||||
model: {
|
model: {
|
||||||
equipment: {
|
|
||||||
enhancedArmor: false,
|
|
||||||
calibratedShells: false,
|
|
||||||
},
|
|
||||||
visual: {
|
visual: {
|
||||||
environment: 'warehouse',
|
environment: 'warehouse',
|
||||||
controlsEnabled: true,
|
controlsEnabled: true,
|
||||||
|
|||||||
Reference in new issue
Block a user