protected override void OnClosing(CancelEventArgs e) { switch (Utils.ShowYesNoMessage(Utils.GetResource("common:saveChanges"), Utils.GetResource("common:warn"))) { case MessageBoxResult.Yes: { var ktps_pos = ItemModelTranslates[0]; var pos = TrackNKM.KartPointStart.Entries[0].Position; pos.X = (float)(ktps_pos.X * 16); pos.Y = (float)(ktps_pos.Y * 16); pos.Z = (float)(ktps_pos.Z * 16); TrackNKM.KartPointStart.Entries[0].Position = pos; MainCARC.WriteFile("course_map.nkm", TrackNKM.Write()); MainCARC.Save(); foreach (var model in MainModels) { model.Save(); } break; } case MessageBoxResult.Cancel: { e.Cancel = true; break; } } base.OnClosed(e); }
private void Save() { UpdateBMGs(); for (var i = 0; i < CARCLanguages.Length; i++) { Main2D[i].WriteFile("common.bmg", Common[i].Save()); Main2D[i].Save(); Static2D.WriteFile(FormatLanguageFile("MBChild", "bmg", i), MBChild[i].Save()); CharacterKartSelect[i].WriteFile("kart_select.bmg", KartSelect[i].Save()); CharacterKartSelect[i].Save(); WLMenu[i].WriteFile("banner.bmg", Banner[i].Save()); WLMenu[i].Save(); Menu[i].WriteFile("menu.bmg", MenuBMG[i].Save()); Menu[i].WriteFile("mission.bmg", Mission[i].Save()); Menu[i].WriteFile("rule.bmg", Rule[i].Save()); Menu[i].Save(); } Static2D.Save(); }