public TextsWindow() { InitializeComponent(); Static2D = new CARCEditor("Static2D.carc"); for (var i = 0; i < CARCLanguages.Length; i++) { var main2d = new CARCEditor(FormatLanguageFile("Main2D", "carc", i)); Main2D.Add(main2d); var common = new BMG(main2d.ReadFile("common.bmg")); Common.Add(common); var mbchild = new BMG(Static2D.ReadFile(FormatLanguageFile("MBChild", "bmg", i))); MBChild.Add(mbchild); var chksel = new CARCEditor(FormatLanguageFile("CharacterKartSelect", "carc", i)); CharacterKartSelect.Add(chksel); var kartsel = new BMG(chksel.ReadFile("kart_select.bmg")); KartSelect.Add(kartsel); var wlmenu = new CARCEditor(FormatLanguageFile("WLMenu", "carc", i)); WLMenu.Add(wlmenu); var banner = new BMG(wlmenu.ReadFile("banner.bmg")); Banner.Add(banner); var menu = new CARCEditor(FormatLanguageFile("Menu", "carc", i)); Menu.Add(menu); var menu_bmg = new BMG(menu.ReadFile("menu.bmg")); MenuBMG.Add(menu_bmg); var mission = new BMG(menu.ReadFile("mission.bmg")); Mission.Add(mission); var rule = new BMG(menu.ReadFile("rule.bmg")); Rule.Add(rule); } Load(); }
private void ExportPrepareTrack(int index) { var name = MKDS.InternalTrackNames[index]; MainCARC = new CARCEditor(name + ".carc"); var texture_carc = new CARCEditor(name + "Tex.carc"); var track_model = new Model(TrackModelInfo, MainCARC, texture_carc); if (track_model.Export()) { MainModelCombo.Items.Add("Track"); MainModelCombo.SelectedIndex = 0; MainModels.Add(track_model); LoadModelIntoView(track_model); } else { Utils.ShowMessage("Unable to load track model."); } var skybox_model = new Model(SkyboxModelInfo, MainCARC, texture_carc); if (skybox_model.Export()) { MainModelCombo.Items.Add("Track skybox"); MainModelCombo.SelectedIndex = 0; MainModels.Add(skybox_model); LoadModelIntoView(skybox_model); } else { Utils.ShowMessage("Unable to load track skybox model."); } var nkm_data = MainCARC.ReadFile("course_map.nkm"); TrackNKM = new NKMD(nkm_data); var kcl_data = MainCARC.ReadFile("course_collision.kcl"); TrackKCL = new KCL(kcl_data); var dummy_kart_model_info = new ModelInfo { ModelFile = "kart_MR_a.nsbmd", TextureFile = "kart_MR_a.nsbtx" }; var dummy_kart_model = new Model(dummy_kart_model_info, null, null); if (dummy_kart_model.Export()) { ModelCombo.Items.Add("Start position"); ModelCombo.SelectedIndex = 0; ItemModels.Add(dummy_kart_model); LoadModelIntoView(dummy_kart_model); var ktps = TrackNKM.KartPointStart.Entries[0]; ItemModelTranslates.Add(new Vector3D(ktps.Position.X / 16, ktps.Position.Y / 16, ktps.Position.Z / 16)); UpdateModelTranslate(0, ktps.Position.X / 16, ktps.Position.Y / 16, ktps.Position.Z / 16, true); UpdateModelRotation(0, ktps.Rotation.X, ktps.Rotation.Y, ktps.Rotation.Z); } else { Utils.ShowMessage("Unable to load demo kart model."); } }