From b14b28a9a54649748c0125efc92b8458076495cc Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 2 Dec 2021 20:22:38 +0100 Subject: [PATCH] Implementing custom entries Implementing custom entries reads and creation --- BMGEditor/BMG.cs | 6 ++++++ BMGEditor/UI/BMGEditForm.cs | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/BMGEditor/BMG.cs b/BMGEditor/BMG.cs index d46f2d5..8a79b5d 100644 --- a/BMGEditor/BMG.cs +++ b/BMGEditor/BMG.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; @@ -115,6 +116,11 @@ namespace BMGEditor Entries[j].text = ReadWideCharString(); } + m_File_Tbl.Entries.Sort((x, y) => + { + int a = (int)x[70793394], b = (int)y[70793394]; + return a.CompareTo(b); + }); int l = 0; foreach (Bcsv.Entry bcsvEntry in m_File_Tbl.Entries) { diff --git a/BMGEditor/UI/BMGEditForm.cs b/BMGEditor/UI/BMGEditForm.cs index f897777..660709d 100644 --- a/BMGEditor/UI/BMGEditForm.cs +++ b/BMGEditor/UI/BMGEditForm.cs @@ -70,6 +70,13 @@ namespace BMGEditor private void saveBMGbtn_Click(object sender, EventArgs e) { + m_File.Entries.Sort((x, y) => + { + string entryNameA = x.entryName, entryNameB = y.entryName; + return String.CompareOrdinal(entryNameA, entryNameB); + }); + + //m_FileTbl m_File.WriteToFile(); } }