示例#1
0
        public override void KeysPressed(ConsoleKey _key, EKeyModifiers _modifiers)
        {
            var dPoint = KeyTranslator.GetDirection(_key);

            if (dPoint != null)
            {
                var newPoint = m_targetPoint + dPoint + m_addPoint;
                if (ContentRct.Contains(newPoint))
                {
                    m_targetPoint += dPoint;
                    if (m_targetPoint.Lenght > m_maxDistance)
                    {
                        m_targetPoint *= m_maxDistance / m_targetPoint.Lenght;
                    }
                }
            }
            switch (_key)
            {
            case ConsoleKey.Escape:
            case ConsoleKey.Z:
                m_act.IsCancelled = true;
                CloseTopBlock();
                break;

            case ConsoleKey.OemPlus:
                if (_modifiers != EKeyModifiers.NONE)
                {
                    return;
                }
                m_currentTarget++;
                SelectTargetFromList();
                break;

            case ConsoleKey.OemMinus:
                if (_modifiers != EKeyModifiers.NONE)
                {
                    return;
                }
                m_currentTarget--;
                SelectTargetFromList();
                break;

            case ConsoleKey.Add:
                m_currentTarget++;
                SelectTargetFromList();
                break;

            case ConsoleKey.Subtract:
                m_currentTarget--;
                SelectTargetFromList();
                break;

            case ConsoleKey.Enter:
            case ConsoleKey.T:
                m_act.AddParameter(m_realTarget);
                CloseTopBlock();
                return;
            }
            //MessageManager.SendMessage(this, WorldMessage.JustRedraw);
        }
示例#2
0
        public override void KeysPressed(ConsoleKey _key, EKeyModifiers _modifiers)
        {
            var dPoint = KeyTranslator.GetDirection(_key);

            if (dPoint != null)
            {
                var newPoint = m_targetPoint + dPoint + m_avatarScreenPoint;
                if (ContentRct.Contains(newPoint))
                {
                    m_targetPoint += dPoint;
                }
            }
            switch (_key)
            {
            case ConsoleKey.Escape:
            case ConsoleKey.Z:
                m_act.IsCancelled = true;
                CloseTopBlock();
                break;

            case ConsoleKey.Enter:
            case ConsoleKey.M:
                if (m_path != null)
                {
                    m_act.AddParameter(m_path);
                    m_act.AddParameter(int.MaxValue);
                    CloseTopBlock();
                }
                return;
            }
            //MessageManager.SendMessage(this, WorldMessage.JustRedraw);
        }
示例#3
0
        public override void KeysPressed(ConsoleKey _key, EKeyModifiers _modifiers)
        {
            var dPoint = KeyTranslator.GetDirection(_key);

            if (dPoint != null)
            {
                var newPoint = TargetPoint + dPoint + m_avatarScreenPoint;
                if (ContentRct.Contains(newPoint))
                {
                    TargetPoint += dPoint;
                }
            }
            switch (_key)
            {
            case ConsoleKey.Escape:
            case ConsoleKey.Z:
                CloseTopBlock();
                break;
            }
            //MessageManager.SendMessage(this, WorldMessage.JustRedraw);
        }
示例#4
0
        public override void DrawContent()
        {
            var strings = new List <string> {
                "[Enter|M] идти", "[z|Esc] - " + EALConst.EXIT.GetString()
            };

            m_messages.DrawLine(JoinCommandCaptions(strings), FColor.White, 0, 0, EAlignment.LEFT);

            var color = FColor.Gold;
            var avatarPathMapCoords = World.TheWorld.Avatar[0, 0].PathMapCoords;
            var targetPathMapCoords = avatarPathMapCoords + m_targetPoint;
            var path = World.TheWorld.LiveMap.PathFinder.FindPath(World.TheWorld.Avatar, targetPathMapCoords);

            if (path != null)
            {
                m_path = MoveToAct.GetMoveToPath(World.TheWorld.Avatar, path);
                foreach (var point in path)
                {
                    var pnt = point - avatarPathMapCoords;
                    if (pnt.Lenght < 1)
                    {
                        continue;
                    }

                    if (ContentRct.Contains(pnt + m_avatarScreenPoint))
                    {
                        ETileset.TARGETING.GetTile(1).Draw(pnt + m_avatarScreenPoint, color);
                    }
                }
                ETileset.TARGETING.GetTile(0).Draw(m_targetPoint + m_avatarScreenPoint, FColor.Gold);
            }
            else
            {
                m_path = null;
                ETileset.TARGETING.GetTile(0).Draw(m_targetPoint + m_avatarScreenPoint, FColor.Red);
            }
        }