Example #1
0
        public static IEnumerable <(string Label, string Text)> GetLabelList(string path)
        {
            var msbt = new MSBT(File.ReadAllBytes(path));

            foreach (var e in msbt.LBL1.Labels)
            {
                yield return(GetCleanLabelText(e, msbt.TXT2.Strings));
            }
        }
Example #2
0
        public static void DebugDumpLines(this MSBT obj)
        {
            var lines = obj.GetOrderedLines();

            foreach (var line in lines)
            {
                Debug.WriteLine(line);
            }
        }
Example #3
0
        public static IEnumerable <string> GetOrderedLines(this MSBT obj, int indexBias = 0)
        {
            var sorted = obj.LBL1.Labels
                         .Where(z => !z.Name.EndsWith("_pl"))
                         .OrderBy(z => z.Index);

            foreach (var x in sorted)
            {
                var index = x.Index;
                var name  = x.Name;
                var data  = obj.TXT2.Strings[(int)index];
                var line  = data.ToString(obj.FileEncoding).TrimEnd('\0');
                yield return($"{line} = {index + indexBias}, // {name}");
            }
        }
Example #4
0
        public static void DebugDumpLines(this MSBT obj)
        {
            var sorted = obj.LBL1.Labels
                         .Where(z => !z.Name.EndsWith("_pl"))
                         .OrderBy(z => z.Index);

            foreach (var x in sorted)
            {
                var index = x.Index;
                var name  = x.Name;
                var data  = obj.TXT2.Strings[(int)index];
                var line  = data.ToString(obj.FileEncoding).TrimEnd('\0');
                Debug.WriteLine($"{index}\t{name}\t{line}");
            }
        }