diff --git a/scripts/buildAssets/definitions.ts b/scripts/buildAssets/definitions.ts index 5635291fc..600fe0196 100644 --- a/scripts/buildAssets/definitions.ts +++ b/scripts/buildAssets/definitions.ts @@ -3,6 +3,7 @@ import { parse as parsePath } from 'path'; import { Vector3Tuple } from 'three'; import { parse as parseYaml } from 'yaml'; import { TankClass } from '../../src/components/Tanks'; +import { readStringDVPL } from '../../src/core/blitz/readStringDVPL'; import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL'; import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL'; import { toUniqueId } from '../../src/core/blitz/toUniqueId'; @@ -16,6 +17,7 @@ import { EquipmentPreset, EquipmentRow, } from '../../src/core/blitzkrieg/equipmentDefinitions'; +import { GameDefinitions } from '../../src/core/blitzkrieg/gameDefinitions'; import { ModelArmor, ModelDefinitions, @@ -336,6 +338,13 @@ const missingStrings: Record = { export async function definitions(production: boolean) { console.log('Building definitions...'); + const gameDefinitions: GameDefinitions = { + version: (await readStringDVPL(`${DATA}/version.txt.dvpl`)) + .split(' ')[0] + .split('.') + .slice(0, 3) + .join('.'), + }; const tankDefinitions: TankDefinitions = {}; const modelDefinitions: ModelDefinitions = {}; const equipmentDefinitions: EquipmentDefinitions = { @@ -1101,6 +1110,11 @@ export async function definitions(production: boolean) { await commitAssets( 'definitions', [ + { + content: superCompress(gameDefinitions), + encoding: 'base64', + path: 'definitions/game.cdon.lz4', + }, { content: superCompress(tankDefinitions), encoding: 'base64', diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4e9f6d44c..5e8dc00c0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,21 +1,27 @@ 'use client'; -import { CaretRightIcon } from '@radix-ui/react-icons'; -import { AlertDialog, Button, Flex, Text, Theme } from '@radix-ui/themes'; +import { + AlertDialog, + Button, + Card, + Flex, + ScrollArea, + Text, + Theme, +} from '@radix-ui/themes'; import '@radix-ui/themes/styles.css'; import { config } from 'dotenv'; import { Roboto_Flex } from 'next/font/google'; import { usePathname } from 'next/navigation'; -import { ReactNode, useEffect, useState } from 'react'; -import { SkyLine } from '../assets/art/SkyLine'; +import { ReactNode, use, useEffect, useState } from 'react'; +import packageJSON from '../../package.json'; import { Analytics } from '../components/Analytics'; import Navbar from '../components/Navbar'; -import PageWrapper from '../components/PageWrapper'; +import { gameDefinitions } from '../core/blitzkrieg/gameDefinitions'; import isDev from '../core/blitzkrieg/isDev'; import { isLocalhost } from '../core/blitzkrieg/isLocalhost'; import { useFullScreen } from '../hooks/useFullScreen'; import { useApp } from '../stores/app'; -import { mintTheme } from '../themes/mint'; config(); @@ -31,6 +37,7 @@ const robotoFlex = Roboto_Flex({ }); export default function RootLayout({ children }: RootLayoutProps) { + const awaitedGameDefinitions = use(gameDefinitions); const pathname = usePathname(); const isEmbed = pathname.split('/')[1] === 'embeds'; const [showDevBuildAlert, setShowDevBuildAlert] = useState(false); @@ -59,7 +66,7 @@ export default function RootLayout({ children }: RootLayoutProps) { @@ -70,93 +77,72 @@ export default function RootLayout({ children }: RootLayoutProps) { suppressHydrationWarning suppressContentEditableWarning > - {!isEmbed && } - - - Experimental version! - - This version may have a lot of issues. Report issues to{' '} - - the official Discord server - - . Also consider using{' '} - - the more stable release version - - . You will be asked again in 8 days. - + + + {!isEmbed && } + + + Experimental version! + + This version may have a lot of issues. Report issues to{' '} + + the official Discord server + + . Also consider using{' '} + + the more stable release version + + . You will be asked again in 8 days. + - - - - - - - {children} - - {!isEmbed && !isFullScreen && ( - - - - - - Blitzkrieg. Free forever. For everyone. - - - Consider supporting today 🍀 - + + + + - - - - - + {children} - - - - - )} + {!isEmbed && !isFullScreen && ( + <> +
+ + + + + + + Blitzkrieg {packageJSON.version} for WoTB 10.7 + + + Free forever, for everyone. + + + + + + )} + + diff --git a/src/core/blitzkrieg/gameDefinitions.ts b/src/core/blitzkrieg/gameDefinitions.ts new file mode 100644 index 000000000..e5e2e45f1 --- /dev/null +++ b/src/core/blitzkrieg/gameDefinitions.ts @@ -0,0 +1,10 @@ +import { asset } from './asset'; +import { fetchCdonLz4 } from './fetchCdonLz4'; + +export interface GameDefinitions { + version: string; +} + +export const gameDefinitions = fetchCdonLz4( + asset('definitions/game.cdon.lz4'), +);