feat: add torso support to avatar sandbox
This commit is contained in:
parent
85b4683a66
commit
431ef7ee73
1 changed files with 13 additions and 2 deletions
|
|
@ -35,6 +35,17 @@ const ItemCache = {
|
||||||
},
|
},
|
||||||
thumbnail: "https://c0.ptacdn.com/thumbnails/assets/anebTuFMLg8NKhRL3ab7hbzCfmcsFqGO.png",
|
thumbnail: "https://c0.ptacdn.com/thumbnails/assets/anebTuFMLg8NKhRL3ab7hbzCfmcsFqGO.png",
|
||||||
asset: "https://c0.ptacdn.com/assets/HD6TFdXD8CaflRNmd84VCNyNsmTB0SH3.png"
|
asset: "https://c0.ptacdn.com/assets/HD6TFdXD8CaflRNmd84VCNyNsmTB0SH3.png"
|
||||||
|
},
|
||||||
|
37582: {
|
||||||
|
type: "torso",
|
||||||
|
name: "Slim Body",
|
||||||
|
price: 0,
|
||||||
|
creator: {
|
||||||
|
name: "Polytoria",
|
||||||
|
id: 1
|
||||||
|
},
|
||||||
|
thumbnail: "https://c0.ptacdn.com/thumbnails/assets/f_k-ZN_xmA_ALZiJQanOKT-Y4qq5kI1b.png",
|
||||||
|
asset: "https://c0.ptacdn.com/assets/qoqZ2qPyaGvB3MLGgJZ6oLWTz-xxGo-8.glb"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let Avatar = {
|
let Avatar = {
|
||||||
|
|
@ -257,7 +268,7 @@ async function UpdateAvatar() {
|
||||||
|
|
||||||
const FormattedAvatar = structuredClone(Avatar)
|
const FormattedAvatar = structuredClone(Avatar)
|
||||||
|
|
||||||
const AccessoryPromise = [...Avatar.items, Avatar.tool].filter((x) => x !== undefined && !x.toString().startsWith('http') && !x.toString().startsWith('data:')).map(async (x, index) => {
|
const AccessoryPromise = [...Avatar.items, Avatar.tool, Avatar.torso].filter((x) => x !== undefined && !x.toString().startsWith('http') && !x.toString().startsWith('data:')).map(async (x, index) => {
|
||||||
if (ItemCache[x] === undefined) {
|
if (ItemCache[x] === undefined) {
|
||||||
const ItemDetails = (await (await fetch('https://api.polytoria.com/v1/store/' + x)).json())
|
const ItemDetails = (await (await fetch('https://api.polytoria.com/v1/store/' + x)).json())
|
||||||
ItemCache[x] = {
|
ItemCache[x] = {
|
||||||
|
|
@ -495,7 +506,7 @@ async function LoadItems() {
|
||||||
|
|
||||||
function LoadWearing() {
|
function LoadWearing() {
|
||||||
document.getElementById('wearing').innerHTML = '';
|
document.getElementById('wearing').innerHTML = '';
|
||||||
[...Avatar.items, Avatar.shirt, Avatar.pants].filter((x) => x !== undefined).forEach(id => {
|
[...Avatar.items, Avatar.shirt, Avatar.pants, Avatar.torso].filter((x) => x !== undefined).forEach(id => {
|
||||||
const Cached = Object.values(ItemCache)[Object.keys(ItemCache).indexOf(id.toString())]
|
const Cached = Object.values(ItemCache)[Object.keys(ItemCache).indexOf(id.toString())]
|
||||||
if (Cached !== undefined) {
|
if (Cached !== undefined) {
|
||||||
if (Cached.creator === null) {
|
if (Cached.creator === null) {
|
||||||
|
|
|
||||||
Reference in a new issue