Skip to content

Commit

Permalink
remove old code from custom traits and update display current trait name
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Dec 10, 2023
1 parent 1eb3f9c commit 4228ac3
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions src/components/Selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,51 +59,17 @@ export default function Selector({traits, traitGroupName, selectedTraitID, setSe
const [restrictions, setRestrictions] = useState(null)
const [currentTrait, setCurrentTrait] = useState(new Map());


const loadCustom = (url) => {
if (currentTraitName){
const option = {
item:{
id:"custom_" + currentTraitName,
name:"Custom " + currentTraitName,
directory:url
},
trait:templateInfo.traits.find((t) => t.name === currentTraitName)
}
effectManager.setTransitionEffect('switch_item');
loadOptions([option], false, false, false).then((loadedData)=>{
URL.revokeObjectURL(url);
let newAvatar = {};
loadedData.map((data)=>{
newAvatar = {...newAvatar, ...itemAssign(data)}
})
const finalAvatar = {...avatar, ...newAvatar}
setTimeout(() => {
if (Object.keys(finalAvatar).length > 0) {
cullHiddenMeshes(finalAvatar)
}
}, effectManager.transitionTime);
setAvatar(finalAvatar)
})
}
else{
console.log("Please select a trait first");
}
}

const uploadTrait = async() =>{
var input = document.createElement('input');
input.type = 'file';
input.accept=".vrm"

input.onchange = e => {
console.log("on")
var file = e.target.files[0];
if (file.name.endsWith(".vrm")){
console.log("ends")
const url = URL.createObjectURL(file);
//loadCustom(url)
characterManager.loadCustomTrait(traitGroupName,url)
// XXX change selected option
}
}
input.click();
Expand Down Expand Up @@ -142,7 +108,7 @@ export default function Selector({traits, traitGroupName, selectedTraitID, setSe

<div className={styles["SelectorContainerPos"]}>

<MenuTitle title={currentTraitName} width={130} left={20}/>
<MenuTitle title={traitGroupName} width={130} left={20}/>
<div className={styles["bottomLine"]} />
<div className={styles["scrollContainer"]}>
<div className={styles["selector-container"]}>
Expand Down

0 comments on commit 4228ac3

Please sign in to comment.