Ejemplo n.º 1
0
        /// <summary>
        /// The BtnPrevFrame_Click.
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>.</param>
        /// <param name="e">The e<see cref="EventArgs"/>.</param>
        private void BtnPrevFrame_Click(object sender, EventArgs e)
        {
            int index = tabControl.SelectedIndex;

            if (frmDisplayIndex > 0)
            {
                frmDisplayIndex--;
                TabPage    tabPage = tabControl.TabPages[index];
                PictureBox picBox  = (PictureBox)tabPage.Controls[0].Controls[0];

                FRM frm = frms[index];
                // display the previous frame
                picBox.Image = frm.Frames[frmDisplayIndex].ToBitmap();

                // refresh the properties of the frame
                ListBox listBox = (ListBox)tabPage.Controls[1];
                listBox.Items.Clear();
                listBox.Items.Add("Version: " + frm.Version);
                listBox.Items.Add("FPS: " + frm.Fps);
                listBox.Items.Add("Action frame :" + frm.ActionFrame);
                listBox.Items.Add("Frames per direction: " + frm.FramesPerDirection);
                listBox.Items.Add("Total frames: " + frm.Frames.Count);
                listBox.Items.Add("Index:" + frmDisplayIndex);
                listBox.Items.Add("Direction: " + frm.GetDirection(frm.Frames[frmDisplayIndex]));
            }
        }
Ejemplo n.º 2
0
        public void WalkOrig(int direction)
        {
            _direction = direction;

            Stance = Stance.Walking;
            _texture = new FRM(_repo + _prefix + TextureName + "AB.frm", MovementHelper.HexX(HexPosition), MovementHelper.HexY(HexPosition));
            _texture.CurrentDirection = direction;
            _steps = _texture._directions[direction]._frames.Length;
            _steps = 4;
            
        }
Ejemplo n.º 3
0
 public void Verificar_FormsAbertos(Form FormAberto)
 {
     foreach (Form FRM in this.MdiChildren)
     {
         if (FRM.GetType() == FormAberto.GetType())
         {
             FRM.Focus();
             return;
         }
     }
     FormAberto.MdiParent = this;
     FormAberto.Show();
 }
Ejemplo n.º 4
0
        private FRM MapFarm(Farm farm, Dictionary <int, string> keyToIsoId, int farmIndex)
        {
            var isoFarm = new FRM
            {
                B = farm.Description,
            };

            isoFarm.A = isoFarm.GetIsoId(farmIndex);
            if (farm.GrowerId != null)
            {
                isoFarm.I = keyToIsoId[farm.GrowerId.Value];
            }

            keyToIsoId.Add(farm.Id.ReferenceId, isoFarm.A);
            return(isoFarm);
        }
Ejemplo n.º 5
0
Archivo: Wall.cs Proyecto: Uhha/Fo2
        public Wall(int start, byte[] bytes, Hex[] hexes, string[] wallNames, string[] itemsProtoNames, out int newStart)
        {
            MapObjectType = MapObjectType.Wall;
            TextureName = wallNames[HelperFuncts.SumTwoBytes(bytes[start + 34], bytes[start + 35])].Trim();

            int hexNumber = HelperFuncts.SumTwoBytes(bytes[start + 6], bytes[start + 7]);
            HexPosition = hexNumber;

            _objDirection = bytes[start + 31];
            string frmName = _repo + "art/walls/" + TextureName;
            _texture = new FRM(frmName, (int)hexes[hexNumber]._vertexes[0].X, (int)hexes[hexNumber]._vertexes[0].Y);
            _texture.CurrentDirection = _objDirection;
            _protoId = HelperFuncts.SumTwoBytes(bytes[start + 46], bytes[start + 47]); ;

            newStart = start += 88;
        }
Ejemplo n.º 6
0
Archivo: Misc.cs Proyecto: Uhha/Fo2
        public Misc(int start, byte[] bytes, Hex[] hexes, string[] miscNames, string[] itemsProtoNames, out int newStart)
        {
            MapObjectType = MapObjectType.Misc;
            TextureName = miscNames[HelperFuncts.SumTwoBytes(bytes[start + 34], bytes[start + 35])].Trim();

            int hexNumber = HelperFuncts.SumTwoBytes(bytes[start + 6], bytes[start + 7]);
            HexPosition = hexNumber;

            _objDirection = bytes[start + 31];
            string frmName = _repo + "art/misc/" + TextureName;
            _texture = new FRM(frmName, (int)hexes[hexNumber]._vertexes[0].X, (int)hexes[hexNumber]._vertexes[0].Y);
            _texture.CurrentDirection = _objDirection;
            _protoId = HelperFuncts.SumTwoBytes(bytes[start + 46], bytes[start + 47]); ;
            if (bytes[start + 47] == 12)  //Screen Blocker
            {
                newStart = start += 88;
            }
            else
            {
                newStart = start += 104; //Exit Grids - 104
            }
        }
Ejemplo n.º 7
0
        public GenericMapObject(string name, MapObjectType objType, int HexInt)
        {
            TextureName = name;
            HexPosition = HexInt;
            switch (objType)
            {
                case MapObjectType.Item:
                    break;
                case MapObjectType.Critter:
                    _prefix = "/art/critters/";
                    break;
                case MapObjectType.Scenery:
                    break;
                case MapObjectType.Wall:
                    break;
                case MapObjectType.Tile:
                    break;
                case MapObjectType.Misc:
                    break;
                case MapObjectType.Interface:
                    break;
                case MapObjectType.Invent:
                    break;
                case MapObjectType.Head:
                    break;
                case MapObjectType.Backgrnd:
                    break;
                case MapObjectType.Skilldex:
                    break;
                default:
                    break;
            }

            MapObjectType = objType;
            _texture = new FRM(_repo + _prefix + TextureName + "AA.frm", MovementHelper.HexX(HexInt), MovementHelper.HexY(HexInt));
        }
Ejemplo n.º 8
0
Archivo: Critter.cs Proyecto: Uhha/Fo2
        public Critter(int start, byte[] bytes, Hex[] hexes, string[] criNames, string[] itemsProtoNames, out int newStart)
        {
            MapObjectType = MapObjectType.Critter;
            TextureName = criNames[bytes[start + 35]].Split(',')[0] + WeaponEquipped + CurrentAnimation + ".frm";

            int hexNumber = HelperFuncts.SumTwoBytes(bytes[start + 6], bytes[start + 7]);
            HexPosition = hexNumber;

            _objDirection = bytes[start + 31];

            string frmName = _repo + "art/critters/" + TextureName;
            _texture = new FRM(frmName, (int)hexes[hexNumber]._vertexes[0].X, (int)hexes[hexNumber]._vertexes[0].Y);
            _texture.CurrentDirection = _objDirection;
            _frameNumer = bytes[start + 27];
            _protoId = HelperFuncts.SumTwoBytes(bytes[start + 46], bytes[start + 47]); ;
            _numberOfSubItems = bytes[start + 75];
            _hitPoints = bytes[start + 119];
            
            if (_numberOfSubItems > 0) { GetSubItems(_numberOfSubItems, start, bytes, itemsProtoNames, out start); }
            else { start += 128; }

            newStart = start;

        }
Ejemplo n.º 9
0
 public void Setup()
 {
     _frm        = new FRM();
     _output     = new StringBuilder();
     _xmlBuilder = XmlWriter.Create(_output);
 }
Ejemplo n.º 10
0
        public void Walk(int[] directionsPath)
        {
            if (directionsPath.Length == 0) return;
            _direction = directionsPath[0];
            _directionsPath = directionsPath;
            _hexesOnPath = directionsPath.Length;
            _hexesOnPathCount = 0;

            Stance = Stance.Walking;
            _texture = new FRM(_repo + _prefix + TextureName + "AB.frm", MovementHelper.HexX(HexPosition), MovementHelper.HexY(HexPosition));
            _texture.CurrentDirection = _direction;
            _steps = _texture._directions[_direction]._frames.Length;

            _twoSteps = SetNumberOfSteps();
            _steps = 4 * (directionsPath.Length);

        }
Ejemplo n.º 11
0
 private void WalkingOrig(double gameTime)
 {
     _counter += gameTime;
     if (_counter > 150)
     {
         _texture.Update(gameTime);
         _counter = 0;
         _steps--;
     }
     if (_steps == 0)
     {
         Stance = Stance.Standing;
         HexPosition = MovementHelper.GetAdjecentHex(_direction, HexPosition);
         _texture = new FRM(_repo + _prefix + TextureName + "AA.frm", MovementHelper.HexX(HexPosition), MovementHelper.HexY(HexPosition));
         _texture.CurrentDirection = _direction;
     }
 }
Ejemplo n.º 12
0
        private void Walking(double gameTime)
        {
            _counter += gameTime;
            if (_counter > 150)
            {
                _texture.Update(gameTime);
                _counter = 0;
                _steps--;
                _hexsteps--;
            }

            if(_hexsteps == 0 && _steps != 0)
            {
                
                
                _texture._directions[_direction]._anumationIndex = 0;
                
                if (_twoSteps)
                {
                    var nextHex = MovementHelper.GetAdjecentHex(_direction, HexPosition);
                    nextHex = MovementHelper.GetAdjecentHex(_direction, nextHex);
                    HexPosition = nextHex;
                    _texture._posX = MovementHelper.HexX(nextHex);
                    _texture._posY = MovementHelper.HexY(nextHex);
                    _hexesOnPathCount++;
                }
                else
                {
                    var nextHex = MovementHelper.GetAdjecentHex(_direction, HexPosition);
                    HexPosition = nextHex;
                    _texture._posX = MovementHelper.HexX(nextHex);
                    _texture._posY = MovementHelper.HexY(nextHex);
                }
                _direction = _directionsPath[++_hexesOnPathCount];
                _twoSteps = SetNumberOfSteps();
                _texture.CurrentDirection = _direction;
            }


            if (_steps == 0)
            {
                Stance = Stance.Standing;
                var nextHex = MovementHelper.GetAdjecentHex(_direction, HexPosition);
                HexPosition = nextHex;
                _texture = new FRM(_repo + _prefix + TextureName + "AA.frm", MovementHelper.HexX(HexPosition), MovementHelper.HexY(HexPosition));
                _texture.CurrentDirection = _direction;
            }
        }