fix: lint issues

This commit is contained in:
Calum H. authored and Alejandro González committed 2025-06-14 17:47:05 +02:00
1 parent fc929bfca3
commit b83eb10fa3
4 files changed
+17 -31

No files matched your search

@@ -70,7 +70,7 @@
<!-- eslint-disable-next-line vue/attribute-hyphenation -->
<TresPerspectiveCamera
:makeDefault="true"
:make-default="true"
:fov="fov"
:position="[0, 1.5, -3.25]"
:look-at="target"
@@ -96,7 +96,7 @@ import {
attachCapeToBody,
findBodyNode,
createTransparentTexture,
loadTexture as loadSkinTexture
loadTexture as loadSkinTexture,
} from '@modrinth/utils'
const props = withDefaults(
@@ -299,17 +299,14 @@ watch(
attachCapeToBodyWrapper()
}
},
{ immediate: true }
{ immediate: true },
)
watch(
capeScene,
(newCapeScene) => {
if (newCapeScene && bodyNode.value && isModelLoaded.value && !capeAttached.value) {
attachCapeToBodyWrapper()
}
watch(capeScene, (newCapeScene) => {
if (newCapeScene && bodyNode.value && isModelLoaded.value && !capeAttached.value) {
attachCapeToBodyWrapper()
}
)
})
watch(selectedModelSrc, (src) => loadModel(src))
watch(
@@ -358,7 +355,7 @@ onBeforeMount(async () => {
<style scoped lang="scss">
.nametag-bg {
background: linear-gradient(308.68deg, rgba(0, 0, 0, 0) -52.46%, rgba(100, 100, 100, 0.1) 94.75%),
rgba(0, 0, 0, 0.2);
rgba(0, 0, 0, 0.2);
box-shadow:
inset -0.5px -0.5px 0px rgba(0, 0, 0, 0.25),
inset 0.5px 0.5px 0px rgba(255, 255, 255, 0.05);
+5 -8
View File
@@ -40,7 +40,7 @@ export async function loadModel(modelUrl: string): Promise<GLTF> {
*/
export async function loadTexture(
textureUrl: string,
config: SkinRendererConfig = {}
config: SkinRendererConfig = {},
): Promise<THREE.Texture> {
const cacheKey = `${textureUrl}_${JSON.stringify(config)}`
@@ -95,7 +95,7 @@ export function applyTexture(model: THREE.Object3D, texture: THREE.Texture): voi
export function applyCapeTexture(
model: THREE.Object3D,
texture: THREE.Texture | null,
transparentTexture?: THREE.Texture
transparentTexture?: THREE.Texture,
): void {
model.traverse((child) => {
if ((child as THREE.Mesh).isMesh) {
@@ -125,7 +125,7 @@ export function attachCapeToBody(
bodyNode: THREE.Object3D,
capeModel: THREE.Object3D,
position = { x: 0, y: -1, z: -0.01 },
rotation = { x: 0, y: -Math.PI / 2, z: 0 }
rotation = { x: 0, y: -Math.PI / 2, z: 0 },
): void {
if (!bodyNode || !capeModel) return
@@ -184,17 +184,14 @@ export async function setupSkinModel(
textureUrl: string,
capeModelUrl?: string,
capeTextureUrl?: string,
config: SkinRendererConfig = {}
config: SkinRendererConfig = {},
): Promise<{
model: THREE.Object3D
bodyNode: THREE.Object3D | null
capeModel: THREE.Object3D | null
}> {
// Load model and texture in parallel
const [gltf, texture] = await Promise.all([
loadModel(modelUrl),
loadTexture(textureUrl, config),
])
const [gltf, texture] = await Promise.all([loadModel(modelUrl), loadTexture(textureUrl, config)])
const model = gltf.scene.clone()
applyTexture(model, texture)