mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-08 02:10:37 +01:00
Fix: Hide unused states of legendary camouflage parts (fixes maus)
This commit is contained in:
1 parent
0632899ecf
commit
682f039c6c
4 files changed
+20
-8
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
CamouflageDefinitions,
|
||||
camouflagePreset,
|
||||
Sc2ReadStream,
|
||||
type TankParameters,
|
||||
} from "@blitzkit/core";
|
||||
@@ -88,10 +89,7 @@ export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 {
|
||||
);
|
||||
|
||||
const [nation, tankKey] = vehicle.split(":");
|
||||
// some unique camos only set the preset for their one tank
|
||||
const preset =
|
||||
yamlEntry.preset ??
|
||||
yamlEntry.override?.[nation]?.override?.[tankKey]?.preset;
|
||||
const preset = camouflagePreset(yamlEntry, nation, tankKey);
|
||||
let hasPreset = false;
|
||||
|
||||
if (preset !== undefined) {
|
||||
|
||||
@@ -12,3 +12,15 @@ export type CamouflagesYaml = Record<
|
||||
>;
|
||||
}
|
||||
>;
|
||||
|
||||
// some unique camos only set the preset for their one tank
|
||||
export function camouflagePreset(
|
||||
camouflage: CamouflagesYaml[string],
|
||||
nation: string,
|
||||
tankKey: string,
|
||||
) {
|
||||
return (
|
||||
camouflage.preset ??
|
||||
camouflage.override?.[nation]?.override?.[tankKey]?.preset
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
camouflagePreset,
|
||||
parseHierarchies,
|
||||
Sc2ReadStream,
|
||||
type CamouflagesXml,
|
||||
@@ -73,9 +74,7 @@ export async function GET({ props }: APIContext<{ skin: number }>) {
|
||||
include as { vehicle: { name: string } }
|
||||
).vehicle.name.split(":");
|
||||
const { customEntities } = camouflagesYaml[key];
|
||||
const preset =
|
||||
camouflagesYaml[key].preset ??
|
||||
camouflagesYaml[key].override?.[nation]?.override?.[tankKey]?.preset;
|
||||
const preset = camouflagePreset(camouflagesYaml[key], nation, tankKey);
|
||||
const parameters = await vfs.yaml<TankParameters>(
|
||||
`Data/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
||||
);
|
||||
|
||||
@@ -209,7 +209,10 @@ export async function extractModel(
|
||||
|
||||
case "StateSwitcherComponent":
|
||||
node.setExtras({
|
||||
state: component[`ssc.state${component["ssc.activeState"]}`],
|
||||
// a part's scenarios can pick its state as it loads
|
||||
state:
|
||||
component[`ssc.state${component["ssc.activeState"]}`] ??
|
||||
(isPart ? null : undefined),
|
||||
});
|
||||
break;
|
||||
|
||||
|
||||
Reference in new issue
Block a user