From 3d837a95fe64fc73ee3f3e0c4050a3afa779f929 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 10 Sep 2022 23:16:44 +0300 Subject: [PATCH] Rename variable --- app/components/Combobox.tsx | 10 +++++----- app/db/seed.ts | 4 ++-- app/modules/in-game-lists/index.ts | 2 +- app/modules/in-game-lists/types.ts | 4 ++-- app/modules/in-game-lists/weapon-ids.ts | 3 +-- app/routes/u.$identifier/builds/new.tsx | 4 ++-- scripts/create-analyzer-json.ts | 4 ++-- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/components/Combobox.tsx b/app/components/Combobox.tsx index b1c48472a..a1b9dc01f 100644 --- a/app/components/Combobox.tsx +++ b/app/components/Combobox.tsx @@ -10,7 +10,7 @@ import { clothesGearIds, headGearIds, shoesGearIds, - weaponIds, + mainWeaponIds, } from "~/modules/in-game-lists"; import { gearImageUrl, weaponImageUrl } from "~/utils/urls"; import { Image } from "./Image"; @@ -195,10 +195,10 @@ export function WeaponCombobox({ }: Pick< ComboboxProps, "inputName" | "onChange" | "className" | "id" | "required" -> & { initialWeaponId?: typeof weaponIds[number] }) { +> & { initialWeaponId?: typeof mainWeaponIds[number] }) { const { t } = useTranslation("weapons"); - const idToWeapon = (id: typeof weaponIds[number]) => ({ + const idToWeapon = (id: typeof mainWeaponIds[number]) => ({ value: String(id), label: t(`${id}`), imgPath: weaponImageUrl(id), @@ -207,9 +207,9 @@ export function WeaponCombobox({ return ( { const randomOrderAbilities = shuffle([...abilities]); diff --git a/app/modules/in-game-lists/index.ts b/app/modules/in-game-lists/index.ts index d3022b447..782233964 100644 --- a/app/modules/in-game-lists/index.ts +++ b/app/modules/in-game-lists/index.ts @@ -1,6 +1,6 @@ export { stages } from "./stages"; export { modes, modesShort } from "./modes"; -export { weaponIds, subWeaponIds } from "./weapon-ids"; +export { mainWeaponIds, subWeaponIds } from "./weapon-ids"; export { headGearIds, clothesGearIds, shoesGearIds } from "./gear-ids"; export { abilitiesShort, abilities } from "./abilities"; export type { diff --git a/app/modules/in-game-lists/types.ts b/app/modules/in-game-lists/types.ts index 76802ab4b..9e6d062f7 100644 --- a/app/modules/in-game-lists/types.ts +++ b/app/modules/in-game-lists/types.ts @@ -1,7 +1,7 @@ import type { abilities } from "./abilities"; import type { modes } from "./modes"; import type { stages } from "./stages"; -import type { subWeaponIds, weaponIds } from "./weapon-ids"; +import type { subWeaponIds, mainWeaponIds } from "./weapon-ids"; export type ModeShort = typeof modes[number]["short"]; @@ -11,7 +11,7 @@ export type Ability = typeof abilities[number]["name"]; export type AbilityWithUnknown = typeof abilities[number]["name"] | "UNKNOWN"; export type AbilityType = typeof abilities[number]["type"]; -export type MainWeaponId = typeof weaponIds[number]; +export type MainWeaponId = typeof mainWeaponIds[number]; export type SubWeaponId = typeof subWeaponIds[number]; export type BuildAbilitiesTuple = [ diff --git a/app/modules/in-game-lists/weapon-ids.ts b/app/modules/in-game-lists/weapon-ids.ts index 937d9a52f..3f9b47a1d 100644 --- a/app/modules/in-game-lists/weapon-ids.ts +++ b/app/modules/in-game-lists/weapon-ids.ts @@ -1,5 +1,4 @@ -// xxx: rename to mainWeaponIds -export const weaponIds = [ +export const mainWeaponIds = [ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 200, 210, 220, 230, 240, 250, 300, 310, 400, 1000, 1010, 1020, 1030, 1100, 1110, 2000, 2010, 2020, 2030, 2040, 2050, 2060, 3000, 3010, 3020, 3030, 3040, 4000, 4010, 4020, 4030, 4040, 5000, 5010, diff --git a/app/routes/u.$identifier/builds/new.tsx b/app/routes/u.$identifier/builds/new.tsx index 694a0a9b6..3c996c3a9 100644 --- a/app/routes/u.$identifier/builds/new.tsx +++ b/app/routes/u.$identifier/builds/new.tsx @@ -23,7 +23,7 @@ import { headGearIds, modesShort, shoesGearIds, - weaponIds, + mainWeaponIds, } from "~/modules/in-game-lists"; import type { BuildAbilitiesTuple, @@ -67,7 +67,7 @@ const newBuildActionSchema = z.object({ z .number() .refine((val) => - weaponIds.includes(val as typeof weaponIds[number]) + mainWeaponIds.includes(val as typeof mainWeaponIds[number]) ) ) ) diff --git a/scripts/create-analyzer-json.ts b/scripts/create-analyzer-json.ts index ec739a4f1..62ede1e8a 100644 --- a/scripts/create-analyzer-json.ts +++ b/scripts/create-analyzer-json.ts @@ -8,7 +8,7 @@ import { type SubWeaponId, subWeaponIds, - weaponIds, + mainWeaponIds, } from "~/modules/in-game-lists"; // xxx: missing id 8010 import weapons from "./dicts/WeaponInfoMain.json"; @@ -206,7 +206,7 @@ function resolveOverwrites(params: any) { } function mainWeaponShouldBeSkipped(weapon: MainWeapon) { - if (!weaponIds.includes(weapon.Id as any)) return true; + if (!mainWeaponIds.includes(weapon.Id as any)) return true; if (weapon.Season > CURRENT_SEASON) return true; return false;