Esempio n. 1
0
        private void DeleteString(object obj)
        {
            var selectedItem = DisplayedString_ListBox.SelectedItem as TLKStringRef;

            CleanedStrings.Remove(selectedItem);
            LoadedStrings.Remove(selectedItem);
            hasPendingChanges = true;
        }
        private void DeleteString(object obj)
        {
            var selectedItem = DisplayedString_ListBox.SelectedItem as ME1TalkFile.TLKStringRef;

            CleanedStrings.Remove(selectedItem);
            LoadedStrings.Remove(selectedItem);
            FileModified = true;
        }
        private void Evt_AddString(object sender, RoutedEventArgs e)
        {
            var blankstringref = new TLKStringRef(100, 1, "New Blank Line");

            LoadedStrings.Add(blankstringref);
            CleanedStrings.Add(blankstringref);
            DisplayedString_ListBox.SelectedIndex = CleanedStrings.Count() - 1;           //Set focus to new line (which is the last one)
            DisplayedString_ListBox.ScrollIntoView(DisplayedString_ListBox.SelectedItem); //Scroll to last item
            SetNewID();
            FileModified = true;
        }
        public override void LoadExport(ExportEntry exportEntry)
        {
            var tlkFile = new ME1Explorer.Unreal.Classes.TalkFile(exportEntry);         // Setup object as TalkFile

            LoadedStrings = tlkFile.StringRefs.ToList();                                //This is not binded to so reassigning is fine
            CleanedStrings.ClearEx();                                                   //clear strings Ex does this in bulk (faster)
            CleanedStrings.AddRange(LoadedStrings.Where(x => x.StringID > 0).ToList()); //nest it remove 0 strings.
            CurrentLoadedExport = exportEntry;
            editBox.Text        = NO_STRING_SELECTED;                                   //Reset ability to save, reset edit box if export changed.
            FileModified        = false;
        }
        public void LoadFileFromStream(Stream stream)
        {
            UnloadExport();
            //CurrentLoadedFile = filepath;
            CurrentME2ME3TalkFile = new TalkFile();
            CurrentME2ME3TalkFile.LoadTlkDataFromStream(stream);

            LoadedStrings = CurrentME2ME3TalkFile.StringRefs.ToList();                    //This is not binded to so reassigning is fine
            CleanedStrings.ReplaceAll(LoadedStrings.Where(x => x.StringID > 0).ToList()); //remove 0 or null strings.
            editBox.Text = NO_STRING_SELECTED;                                            //Reset ability to save, reset edit box if export changed.
            FileModified = false;
        }
        public override void LoadFile(string filepath)
        {
            //throw new NotImplementedException();
            UnloadExport();

            CurrentME2ME3TalkFile = new TalkFile();
            CurrentME2ME3TalkFile.LoadTlkData(filepath);

            LoadedStrings = CurrentME2ME3TalkFile.StringRefs.ToList();                    //This is not binded to so reassigning is fine
            CleanedStrings.ReplaceAll(LoadedStrings.Where(x => x.StringID > 0).ToList()); //remove 0 or null strings.
            editBox.Text = NO_STRING_SELECTED;                                            //Reset ability to save, reset edit box if export changed.
            FileModified = false;
        }
        public override void LoadFile(string filepath)
        {
            UnloadExport();
            CurrentLoadedFile     = filepath;
            CurrentME2ME3TalkFile = new TalkFile();
            CurrentME2ME3TalkFile.LoadTlkData(filepath);

            LoadedStrings = CurrentME2ME3TalkFile.StringRefs.ToList();                    //This is not binded to so reassigning is fine
            CleanedStrings.ReplaceAll(LoadedStrings.Where(x => x.StringID > 0).ToList()); //remove 0 or null strings.
            editBox.Text = NO_STRING_SELECTED;                                            //Reset ability to save, reset edit box if export changed.
            FileModified = false;

            AddRecent(filepath, false);
            SaveRecentList();
            RefreshRecent(true, RFiles);
            Window.GetWindow(this).Title = "TLK Editor - " + filepath;
        }
Esempio n. 8
0
 /// <summary>
 /// Memory cleanup when this control is unloaded
 /// </summary>
 public override void Dispose()
 {
     CurrentLoadedExport = null;
     LoadedStrings?.Clear();
     CleanedStrings?.ClearEx();
 }