bzselect now clean + KVview adapted
This commit is contained in:
@@ -21,28 +21,21 @@ class KeyframeView extends WindozDomContent {
|
||||
this.setupTriggers(components)
|
||||
this.setupRefs(components)
|
||||
|
||||
|
||||
this.agentDefs = await this.models.agents.getSprites('Basic 3D')
|
||||
// for(const agentType in this.agentDefs){
|
||||
// const opt = new Option(agentType, agentType)
|
||||
// this.outputs.agentsSelector.add(opt)
|
||||
// }
|
||||
// this.outputs.agentsSelector.addEventListener('change',this.onChangeAgent.bind(this))
|
||||
|
||||
// const x = new tinySelector('[data-output="agentsSelector"]',{
|
||||
// selectorOptions: Object.keys(this.agentDefs).map(aname => ({ markup: aname, value: aname}))
|
||||
// })
|
||||
this.outputs.agentsSelector.fillOptions( Object.keys(this.agentDefs).map(aname => ({ markup: `<i>${aname}</i>`, value: aname})) )
|
||||
this.outputs.agentsSelector.addEventListener('change',this.onChangeAgent.bind(this))
|
||||
|
||||
// this.agentPreview = new app.LoadedModules.AgentPreview(this.outputs.agentSampleCanvas, this.agentDefs)
|
||||
// this.onChangeAgent()
|
||||
// this.agentPreview.startRendering()
|
||||
// this.agentPreview.animation = true
|
||||
this.agentPreview = new app.LoadedModules.AgentPreview(this.outputs.agentSampleCanvas, this.agentDefs)
|
||||
this.onChangeAgent()
|
||||
this.agentPreview.startRendering()
|
||||
this.agentPreview.animation = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
onChangeAgent(event){
|
||||
this.agentPreview.setAgent(this.outputs.agentsSelector.value)
|
||||
console.log('onChangeAgent',this.outputs.agentsSelector.value)
|
||||
if(this.outputs.agentsSelector.value) this.agentPreview.setAgent(this.outputs.agentsSelector.value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user