Exemple #1
0
        private void AB_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var list = sender as ListView;

            if (list.SelectedIndex == -1)
            {
                return; // Return if no item is selected
            }
            // Check if files should not be loaded
            if (!_game.EnableResourceLoading)
            {
                return;
            }

            string path = (list.SelectedItem as STSCFileDatabase.ArtBookPageEntry).PagePathData;

            if (_novelTextureArchive.GetFileData($"{path}.tex") is byte[] data)
            {
                var tex = new TEXFile();
                using (var stream = new MemoryStream(data))
                    tex.Load(stream);

                AB_PG = ImageTools.ConvertToSource(tex.CreateBitmap());
                tex.Dispose();
            }
        }