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();
        }
        public SingleSkillControl(Skill skill, AtlasImageLoader imageLoader, Point distanceToNeighbor)
        {
            InitializeComponent();

            _skill = skill;

            InitSkillPanel(imageLoader, distanceToNeighbor);
            SetButtonImages(imageLoader);
        }
示例#3
0
        //// todo: rewrite public HeroEditor2(String filePath, TableDataSet tableDataSet)
        //{
        //    _dataSet = tableDataSet;
        //    _filePath = filePath;
        //    _hero = UnitHelpFunctions.OpenCharacterFile(_dataSet, _filePath);
        //    if (_hero.IsGood)
        //    {
        //        _itemFunctions = new UnitHelpFunctions(_dataSet);
        //        _itemFunctions.LoadCharacterValues(_hero);
        //        _wrapper = new UnitWrapper(tableDataSet, _hero);
        //        InitializeComponent();
        //    }
        //}
        private void HeroEditor2_Load(object sender, EventArgs e)
        {
            string path = Path.Combine(Config.HglDir, @"data\uix\xml\");

            AtlasImageLoader loader = new AtlasImageLoader();
            loader.LoadAtlas(path + "skilltree_atlas.xml");
            loader.LoadAtlas(path + "skillpanel_atlas.xml");

            InitSkillTree(loader);
            InitSkillPanel(loader);
        }
示例#4
0
        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 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();
        }
示例#6
0
        private Panel CreateSkillTab(SkillTab skillTab, AtlasImageLoader loader)
        {
            Panel panel = new Panel();
            Point distanceToNeighbor = new Point(140, 140);
            //panel.AutoScroll = true;
            //panel.BackColor = Color.Red;

            foreach (Skill skill in skillTab.Skills)
            {
                SingleSkillControl control = new SingleSkillControl(skill, loader, distanceToNeighbor);
                panel.Controls.Add(control);
            }

            panel.Size = new Size(distanceToNeighbor.X * 8 + 102, distanceToNeighbor.Y * 6 + 96);

            return panel;
        }
示例#7
0
        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;
        }
        public void SetAtlasImageLoader(AtlasImageLoader loader)
        {
            this.loader = loader;

            comboBox1.DataSource = loader.GetImageNames();
        }
示例#9
0
        public SingleSkillControl(Skill skill, AtlasImageLoader imageLoader, Point distanceToNeighbor)
        {
            InitializeComponent();

            _skill = skill;

            InitSkillPanel(imageLoader, distanceToNeighbor);
            SetButtonImages(imageLoader);
        }
示例#10
0
 private void SetButtonImages(AtlasImageLoader imageLoader)
 {
     b_up.BackgroundImage = imageLoader.GetImage("button add");
     b_down.BackgroundImage = imageLoader.GetImage("button shift");
 }
示例#11
0
        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();
        }
示例#12
0
 private void SetButtonImages(AtlasImageLoader imageLoader)
 {
     b_up.BackgroundImage   = imageLoader.GetImage("button add");
     b_down.BackgroundImage = imageLoader.GetImage("button shift");
 }
示例#13
0
        /// <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);
            }
        }
示例#14
0
        private void InitSkillTree(AtlasImageLoader loader)
        {
            if (_wrapper.Skills.SkillTabs.Count == 0) return;

            foreach (SkillTab skillTab in _wrapper.Skills.SkillTabs)
            {
                Panel panel = CreateSkillTab(skillTab, loader);
                panel.Scale(new SizeF(0.7f, 0.7f));
                this.Controls.Add(panel);
            }
        }