提交 f9243a41 编写于 作者: L LeoKu

Handle case

上级 e855c18c
...@@ -58,6 +58,11 @@ export function getRandomAvatarOption( ...@@ -58,6 +58,11 @@ export function getRandomAvatarOption(
usually: [NONE], usually: [NONE],
}) })
const hairShape = getRandomValue(topList, {
avoid: [useOption.widgets?.tops?.shape],
})
const hairColor = getRandomFillColor()
const avatarOption: AvatarOption = { const avatarOption: AvatarOption = {
gender, gender,
...@@ -66,7 +71,10 @@ export function getRandomAvatarOption( ...@@ -66,7 +71,10 @@ export function getRandomAvatarOption(
background: { background: {
color: getRandomValue(SETTINGS.backgroundColor, { color: getRandomValue(SETTINGS.backgroundColor, {
avoid: [useOption.background?.color], avoid: [
useOption.background?.color,
hairShape === TopsShape.Punk && hairColor, // Handle special cases and prevent color conflicts.
],
}), }),
}, },
...@@ -75,10 +83,8 @@ export function getRandomAvatarOption( ...@@ -75,10 +83,8 @@ export function getRandomAvatarOption(
shape: getRandomValue(SETTINGS.faceShape), shape: getRandomValue(SETTINGS.faceShape),
}, },
tops: { tops: {
shape: getRandomValue(topList, { shape: hairShape,
avoid: [useOption.widgets?.tops?.shape], fillColor: hairColor,
}),
fillColor: getRandomFillColor(),
}, },
ear: { ear: {
shape: getRandomValue(SETTINGS.earShape, { shape: getRandomValue(SETTINGS.earShape, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册