2019-12-22 02:40:42 +08:00
|
|
|
import { ViewerView } from "./gui/ViewerView";
|
|
|
|
import { GuiStore } from "../core/stores/GuiStore";
|
2019-12-22 05:49:41 +08:00
|
|
|
import { HttpClient } from "../core/HttpClient";
|
2019-12-22 02:40:42 +08:00
|
|
|
|
2019-12-22 05:49:41 +08:00
|
|
|
export function initialize_viewer(http_client: HttpClient, gui_store: GuiStore): ViewerView {
|
2019-12-22 02:40:42 +08:00
|
|
|
return new ViewerView(
|
|
|
|
async () => {
|
|
|
|
const { Model3DStore } = await import("./stores/Model3DStore");
|
|
|
|
const { Model3DView } = await import("./gui/model_3d/Model3DView");
|
2019-12-22 05:49:41 +08:00
|
|
|
const { CharacterClassAssetLoader } = await import(
|
|
|
|
"./loading/CharacterClassAssetLoader"
|
|
|
|
);
|
|
|
|
return new Model3DView(
|
|
|
|
gui_store,
|
|
|
|
new Model3DStore(new CharacterClassAssetLoader(http_client)),
|
|
|
|
);
|
2019-12-22 02:40:42 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
async () => {
|
|
|
|
const { TextureStore } = await import("./stores/TextureStore");
|
|
|
|
const { TextureView } = await import("./gui/TextureView");
|
|
|
|
return new TextureView(gui_store, new TextureStore());
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|