예제 #1
0
        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();
        }
예제 #2
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);
        }
예제 #3
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);
            }
        }
예제 #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);
        }
예제 #5
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);
        }
예제 #6
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;
        }
예제 #7
0
        public void SetAtlasImageLoader(AtlasImageLoader loader)
        {
            this.loader = loader;

            comboBox1.DataSource = loader.GetImageNames();
        }