2020-01-29 20:24:47 +08:00
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{KUR2:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));var i=s("nN8q"),r=s("FXpb");class n extends i.a{constructor(e){super(),this.renderer=e,this.element=Object(r.h)({className:"core_RendererWidget"}),this.children=[],this.element.append(e.canvas_element),this.disposable(e),this.finalize_construction()}start_rendering(){this.renderer.start_rendering()}stop_rendering(){this.renderer.stop_rendering()}resize(e,t){return super.resize(e,t),this.renderer.set_size(e,t),this}}},puLw:function(e,t,s){"use strict";s.r(t);s("zwwH");var i=s("KUR2"),r=(s("c3F4"),s("FXpb")),n=s("zsIO");class a extends n.a{constructor(e,t,s,i){super(),this.character_classes=e,this.selected=t,this.set_selected=s,this.border_left=i,this.element=Object(r.B)({className:"viewer_model_CharacterClassSelectionView"}),this.list_click=e=>{if(e.target instanceof HTMLLIElement&&e.target.dataset.index){this.selected_element&&this.selected_element.classList.remove("active"),e.target.classList.add("active");const t=parseInt(e.target.dataset.index,10);this.selected_element=e.target,this.set_selected(this.character_classes[t])}},this.element.onclick=this.list_click,i&&(this.element.style.borderLeft="var(--border)"),e.forEach((e,t)=>{this.element.append(Object(r.o)({data:{index:t.toString()}},e.name))}),this.disposables(t.observe(({value:e})=>{if(this.selected_element&&(this.selected_element.classList.remove("active"),this.selected_element=void 0),e&&e!==this.selected_model){const t=this.character_classes.indexOf(e);-1!==t&&(this.selected_element=this.element.childNodes[t],this.selected_element.classList.add("active"))}},{call_now:!0})),this.finalize_construction()}}s.d(t,"ModelView",(function(){return d}));const c=100,l=220,h=140;class d extends n.a{constructor(e,t,s,n){super(),this.element=Object(r.h)({className:"viewer_model_ModelView"}),this.tool_bar_view=this.add(t),this.character_class_selection_view=this.add(new a(e.character_classes,e.current_character_class,e.set_current_character_class,!1)),this.options_view=this.add(s),this.renderer_view=this.add(new i.a(n)),this.animation_selection_view=this.add(new a(e.animations,e.current_animation,e.set_current_animation,!0)),this.element.append(this.tool_bar_view.element,Object(r.h)({className:"viewer_model_ModelView_container"},this.character_class_selection_view.element,this.options_view.element,this.renderer_view.element,this.animation_selection_view.element)),this.finalize_construction()}activate(){this.renderer_view.start_rendering(),super.activate()}deactivate(){super.deactivate(),this.renderer_view.stop_rendering()}resize(e,t){super.resize(e,t);const s=Math.max(0,t-this.tool_bar_view.height);return this.character_class_selection_view.resize(c,s),this.options_view.resize(l,s),this.renderer_view.resize(Math.max(0,e-c-l-h),s),this.animation_selection_view.resize(h,s),this}}}}]);
|