public void SetBitmaps(FileManager fileManager, HGLWindowStyle windowStyle) { AtlasImageLoader loader; loader = new AtlasImageLoader(); loader.LoadAtlas(@"data\uix\xml\main_atlas.xml", fileManager); List<Bitmap> imageList = new List<Bitmap>(); imageList.Clear(); imageList.Add(loader.GetImage(windowStyle + "_1_TL")); imageList.Add(loader.GetImage(windowStyle + "_2_TM")); imageList.Add(loader.GetImage(windowStyle + "_3_TR")); imageList.Add(loader.GetImage(windowStyle + "_4_ML")); imageList.Add(loader.GetImage(windowStyle + "_5_MM")); imageList.Add(loader.GetImage(windowStyle + "_6_MR")); imageList.Add(loader.GetImage(windowStyle + "_7_BL")); imageList.Add(loader.GetImage(windowStyle + "_8_BM")); imageList.Add(loader.GetImage(windowStyle + "_9_BR")); SetBitmaps(imageList); loader.ClearImageList(); imageList.Clear(); }
private void InitSkillPanel(AtlasImageLoader imageLoader, Point distanceToNeighbor) { this.toolTip1.ToolTipTitle = _skill.Name; this.toolTip1.SetToolTip(p_icon, _skill.Description); this.BackgroundImageLayout = ImageLayout.Stretch; this.BackgroundImage = imageLoader.GetImage("icon panel big"); p_icon.BackgroundImageLayout = ImageLayout.Stretch; p_icon.BackgroundImage = imageLoader.GetImage(_skill.IconName); this.Location = new Point(_skill.Position.X * distanceToNeighbor.X, _skill.Position.Y * distanceToNeighbor.Y); UpdateControls(); }
public AnimationTestForm(FileManager fileManager) { InitializeComponent(); animations = new List<string>(); animations.Add("health anim "); animations.Add("power anim "); loader = new AtlasImageLoader(); loader.LoadAtlas(@"data\uix\xml\main_new_atlas.xml", fileManager); handler = new AnimationHandler(); handler.Speed = (int)numericUpDown1.Value; handler.NewFrameEvent += new NewFrame(handler_NewFrameEvent); handler.AddOverlay(loader.GetImage("meter mask")); handler.AddOverlay(loader.GetImage("health meter")); comboBox1.DataSource = animations; }
private void InitSkillPanel(AtlasImageLoader loader) { Panel panel = new Panel(); panel.BackColor = Color.Transparent; panel.BackgroundImageLayout = ImageLayout.Stretch; Bitmap img = loader.GetImage("skill panel"); this.BackgroundImage = img; this.ClientSize = img.Size; panel.Scale(new SizeF(0.7f, 0.7f)); this.Controls.Add(panel); }
private void SetButtonImages(AtlasImageLoader imageLoader) { b_up.BackgroundImage = imageLoader.GetImage("button add"); b_down.BackgroundImage = imageLoader.GetImage("button shift"); }
/// <summary> /// Event Function for Tree View - After Select. /// Will update the file details based upon selection. /// Will update the file image preview if .dds file /// </summary> /// <param name="sender">The TreeView clicked.</param> /// <param name="e">The After Select event args.</param> private void _FilesTreeView_AfterSelect(Object sender, TreeViewEventArgs e) { TreeView treeView = (TreeView)sender; TreeNode selectedNode = treeView.SelectedNode; NodeObject nodeObject = (NodeObject)selectedNode.Tag; PackFileEntry fileEntry = nodeObject.FileEntry; AtlasImageLoader loader = new AtlasImageLoader(); pictureBox1.Image = null; pictureBox1.Tag = null; loader.ClearImageList(); textBoxPath.Text = selectedNode.FullPath; pictureBox1.Hide(); if (checkBoxPreview.Checked) { if (selectedNode.Name.EndsWith(".dds")) { _fileManager.BeginAllDatReadAccess(); Bitmap bmp = AtlasImageLoader.TextureFromGameFile(selectedNode.FullPath, _fileManager); bmp.Tag = selectedNode.Text.Replace(Path.GetExtension(selectedNode.Text), string.Empty); _fileManager.EndAllDatAccess(); pictureBox1.Image = bmp; pictureBox1.Show(); } else if (selectedNode.Name.EndsWith("_atlas.xml")) { try { _fileManager.BeginAllDatReadAccess(); loader.LoadAtlas(selectedNode.FullPath, _fileManager); _fileManager.EndAllDatAccess(); if (loader.ImageCount > 0) { pictureBox1.Image = loader.GetImage(loader.GetImageNames()[0]); pictureBox1.Tag = loader; pictureBox1.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } _files_listView.Items.Clear(); if (nodeObject.IsFolder) return; // no file index means it's either an uncooked file, or a new file if (fileEntry == null) { // todo: this entires if-block is a little dodgy and assumes alot // assuming only uncooked at the moment Debug.Assert(nodeObject.IsUncookedVersion); // if it's the uncooked version, we need to use the parents node path TreeNode parentNode = selectedNode.Parent; String fileDataPath = parentNode.Name.Replace(".cooked", ""); String filePath = Path.Combine(Config.HglDir, fileDataPath); FileInfo fileInfo; try { fileInfo = new FileInfo(filePath); } catch (Exception) { // todo remove file from tree as it has been moved(?) return; } String[] fileDetails = new String[5]; fileDetails[0] = fileInfo.Name; fileDetails[1] = fileInfo.Length.ToString(); fileDetails[2] = String.Empty; fileDetails[3] = fileInfo.LastWriteTime.ToString(); fileDetails[4] = fileDataPath; ListViewItem listViewItem = new ListViewItem(fileDetails); _files_listView.Items.Add(listViewItem); return; } _ListView_AddFileItem(fileEntry); if (fileEntry.Siblings == null) return; foreach (PackFileEntry siblingEntry in fileEntry.Siblings) { _ListView_AddFileItem(siblingEntry); } }