Compare commits

...
7 Commits
Author SHA1 Message Date
TrèsAbhi c8edd16eb3 feat: logs 2024-03-18 16:47:53 -05:00
TrèsAbhi b96ff2e239 New Crowdin updates (#101) 2024-03-18 16:36:55 -05:00
TrèsAbhi a575da3005 fix: move script to head 2024-03-18 10:09:46 -05:00
TrèsAbhi 3ca2dece3e feat: google analytics 2024-03-18 10:02:09 -05:00
TrèsAbhi 191d6133b2 feat: togglable spaced armor 2024-03-17 22:11:56 -05:00
TrèsAbhi b15e73e3a8 Update build.ts 2024-03-17 21:53:09 -05:00
TrèsAbhi 9a6b8ab979 Update cd-host.yml 2024-03-17 21:51:48 -05:00
14 changed files with 84 additions and 30 deletions

No files matched your search

+6
View File
@@ -23,6 +23,12 @@ jobs:
with:
node-version: 18
- name: Install Yarn
run: npm install --location=global yarn
- name: Add fixed sharp
run: yarn add [email protected] --ignore-engines
- name: Download release assets
run: |
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/tresabhi/blitzkrieg/releases/latest \
+13
View File
@@ -0,0 +1,13 @@
# Blitzkrieg 1.17.2
Introducing the new `/research` command!
## Features
- Added the `/research` command
- Type in the name of a tech tree tank you desire to research and this command will list all the expenses in researching all tanks in that line
- The starting tank is inferred automatically by the tanks you own
- This may be a bit inaccurate because of the lack of accurate information Wargaming provides about owned tanks
- You are also manually provide a starting tank and a user to see the progress on a line for
- Replaced Vercel Analytics (which collapsed under the insane amount of traffic on the website) with Google Analytics
- Spaced armor can now be toggled in the Tankopedia armor sandbox
-1
View File
@@ -43,7 +43,6 @@
"@resvg/resvg-js": "^2.4.1",
"@types/three": "^0.160.0",
"@vanilla-extract/css": "^1.13.0",
"@vercel/analytics": "^1.2.2",
"bepaint": "^0.1.0-beta.3",
"decompress": "^4.2.1",
"discord.js": "^14.13.0",
-5
View File
@@ -46,8 +46,3 @@ readdir('node_modules/prisma').then((files) =>
.filter((file) => file.endsWith('.node'))
.map((file) => cp(`node_modules/prisma/${file}`, `dist/bot/${file}`)),
);
// copy sharp as is
if (!isDev) {
cp('node_modules/sharp', 'dist/bot/node_modules/sharp', { recursive: true });
}
+2 -3
View File
@@ -3,12 +3,12 @@
import { CaretRightIcon } from '@radix-ui/react-icons';
import { AlertDialog, Button, Flex, Text, Theme } from '@radix-ui/themes';
import '@radix-ui/themes/styles.css';
import { Analytics } from '@vercel/analytics/react';
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 { Analytics } from '../components/Analytics';
import Navbar from '../components/Navbar';
import PageWrapper from '../components/PageWrapper';
import isDev from '../core/blitzkrieg/isDev';
@@ -51,6 +51,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
name="description"
content="🎉 Tools for everything World of Tanks Blitz"
/>
<Analytics />
</head>
<body
@@ -60,8 +61,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
backgroundColor: isEmbed ? 'transparent' : undefined,
}}
>
<Analytics />
<Theme
appearance="dark"
panelBackground="translucent"
@@ -8,6 +8,7 @@ import { Button, DropdownMenu, Flex } from '@radix-ui/themes';
import { RefObject } from 'react';
import { Pose, poseEvent } from '../../../../../../../core/blitzkrieg/pose';
import mutateTankopediaPersistent, {
mutateTankopediaTemporary,
useTankopediaPersistent,
} from '../../../../../../../stores/tankopedia';
import { ENVIRONMENTS } from '../../Lighting';
@@ -30,6 +31,9 @@ export function Options({ isFullScreen, canvasWrapper }: OptionsProps) {
const wireframe = useTankopediaPersistent(
(state) => state.model.visual.wireframe,
);
const showSpacedArmor = useTankopediaPersistent(
(state) => state.model.visual.showSpacedArmor,
);
const opaque = useTankopediaPersistent((state) => state.model.visual.opaque);
const fullScreenAvailable =
typeof document !== 'undefined' && document.fullscreenEnabled;
@@ -81,6 +85,20 @@ export function Options({ isFullScreen, canvasWrapper }: OptionsProps) {
<DropdownMenu.Content>
<DropdownMenu.Label>Armor</DropdownMenu.Label>
<DropdownMenu.CheckboxItem
checked={showSpacedArmor}
onCheckedChange={(checked) => {
mutateTankopediaPersistent((draft) => {
draft.model.visual.showSpacedArmor = checked;
});
mutateTankopediaTemporary((draft) => {
draft.shot = undefined;
});
}}
>
Spaced armor
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={greenPenetration}
onCheckedChange={(checked) => {
+3 -2
View File
@@ -17,6 +17,7 @@ import {
TIER_ROMAN_NUMERALS,
} from '../core/blitzkrieg/tankDefinitions/constants';
import { tankIconPng } from '../core/blitzkrieg/tankIconPng';
import addUsernameChoices from '../core/discord/addUsernameChoices';
import autocompleteTanks from '../core/discord/autocompleteTanks';
import { createLocalizedCommand } from '../core/discord/createLocalizedCommand';
import { localizationObject } from '../core/discord/localizationObject';
@@ -31,7 +32,6 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
resolve({
inProduction: true,
inPublic: true,
inPreview: true,
command: createLocalizedCommand('research')
.addStringOption((option) =>
@@ -67,7 +67,8 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
)
.setAutocomplete(true)
.setRequired(false),
),
)
.addStringOption(addUsernameChoices),
async handler(interaction) {
const { t, translate } = translator(interaction.locale);
+21
View File
@@ -0,0 +1,21 @@
export function Analytics() {
return (
<>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-98NTMRHRP9"
/>
<script
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-98NTMRHRP9');
`,
}}
/>
</>
);
}
@@ -48,6 +48,7 @@ export function CoreArmorSceneComponent({
explosionRadius: { value: null },
greenPenetration: { value: null },
opaque: { value: null },
useSpacedArmor: { value: null },
resolution: { value: new Vector2() },
spacedArmorBuffer: { value: null },
@@ -75,6 +76,7 @@ export function CoreArmorSceneComponent({
) {
material.uniforms.greenPenetration.value = visual.greenPenetration;
material.uniforms.opaque.value = visual.opaque || visual.wireframe;
material.uniforms.useSpacedArmor.value = visual.showSpacedArmor;
material.wireframe = visual.wireframe;
}
async function handleProtagonistEquipmentChange(
@@ -14,6 +14,7 @@ uniform float damage;
uniform float explosionRadius;
uniform bool greenPenetration;
uniform bool opaque;
uniform bool useSpacedArmor;
uniform highp sampler2D spacedArmorBuffer;
uniform highp sampler2D spacedArmorDepth;
@@ -49,7 +50,7 @@ void main() {
float coreArmorDistance = depthToDistance(gl_FragCoord.z);
float distanceFromSpacedArmor = coreArmorDistance - spacedArmorDistance;
if (isUnderSpacedArmor) {
if (useSpacedArmor && isUnderSpacedArmor) {
float spacedArmorThickness = spacedArmorBufferFragment.r * penetration;
remainingPenetration -= spacedArmorThickness;
@@ -18,6 +18,7 @@ import { useDuel } from '../../../../stores/duel';
import {
Shot,
ShotLayerBase,
useTankopediaPersistent,
useTankopediaTemporary,
} from '../../../../stores/tankopedia';
import { ArmorType } from '../SpacedArmorScene';
@@ -115,12 +116,20 @@ export function SpacedArmorSceneComponent({
pushLogs(shellNormal, filterIntersections(event.intersections), 0);
function filterIntersections(intersectionsRaw: Intersection[]) {
const intersectionsAll = intersectionsRaw.filter(
const showSpacedArmor =
useTankopediaPersistent.getState().model.visual.showSpacedArmor;
const intersectionsTyped = intersectionsRaw.filter(
({ object }) => object.userData.type !== undefined,
) as ArmorMeshIntersection[];
const intersectionsWithDuplicates = intersectionsAll.slice(
const intersectionsFiltered = intersectionsTyped.filter(
({ object }) =>
showSpacedArmor
? true
: object.userData.type === ArmorType.Core,
);
const intersectionsWithDuplicates = intersectionsFiltered.slice(
0,
intersectionsAll.findIndex(
intersectionsFiltered.findIndex(
({ object }) => object.userData.type === ArmorType.Core,
) + 1,
);
+3 -3
View File
@@ -193,7 +193,7 @@
"total": "Total",
"research": "Investigar: %s",
"upgrades": "Mejoras: %s",
"purchase": "Purchase: %s",
"purchase": "Comprar: %s",
"equipment": "Equipamiento: %s",
"estimation": "# ¡Esto es una estimación!\n\nEsta lista podría incluir tanques ya investigados debido a la información errónea que proporciona Wargaming. Si puedes, prueba proporcionando un `tanque-inicial` de la línea al usar el comando."
},
@@ -203,7 +203,7 @@
"already_researched": "# %s ya está investigado\n\nPrueba proporcionando un `tanque-inicial` al usar el comando para ver los totales para una línea que ya has investigado.",
"start_end_equal": "# %s fue proporcionado dos veces\n\nAsegúrate de que `tanque-inicial` y `tanque-objetivo` son diferentes.",
"tanks_not_on_line": "# %s y %s no están en la misma línea\n\nAsegúrate de que `tanque-inicial` y `tanque-objetivo` están en la misma línea del árbol tecnológico.",
"unordered": "# %s higher tiered to %s\n\nMake sure to provide %s as the `starting-tank` instead as it is the lower tiered tank."
"unordered": "# %s de nivel superior a %s\n\nAsegúrate de proporcionar %s como el `tanque-inicial` en su lugar ya que es el tanque de nivel inferior."
}
},
"about": {
@@ -403,7 +403,7 @@
"no_ongoing_season": "# No hay temporada en curso\n\nActualmente no hay ninguna temporada de clasificación.",
"deleted_player": "%s eliminado",
"neighbors": "Vecinos de clasificación",
"more": "+ %s más"
"more": "+%s más"
}
},
"today": {
+2
View File
@@ -23,6 +23,7 @@ export interface TankopediaPersistent {
showGrid: boolean;
greenPenetration: boolean;
showEnvironment: boolean;
showSpacedArmor: boolean;
};
};
sort: {
@@ -123,6 +124,7 @@ export const useTankopediaPersistent = create<TankopediaPersistent>()(
subscribeWithSelector<TankopediaPersistent>(() => ({
model: {
visual: {
showSpacedArmor: true,
wireframe: false,
opaque: false,
environment: ENVIRONMENTS[0],
-12
View File
@@ -2361,13 +2361,6 @@
debug "^4.3.1"
loader-utils "^2.0.0"
"@vercel/analytics@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-1.2.2.tgz#715d8f203a170c06ba36b363e03b048c03060d5d"
integrity sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==
dependencies:
server-only "^0.0.1"
"@vitejs/plugin-vue@^5.0.4":
version "5.0.4"
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.0.4.tgz#508d6a0f2440f86945835d903fcc0d95d1bb8a37"
@@ -5049,11 +5042,6 @@ [email protected]:
parseurl "~1.3.3"
send "0.18.0"
server-only@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e"
integrity sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==
set-function-length@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.1.tgz#47cc5945f2c771e2cf261c6737cf9684a2a5e425"