Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MiniMapForm"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="screen">The game play screen.</param>
 public MiniMapForm(Control parent, GameplayScreen screen) : base(parent, new Vector2(50, 50), new Vector2(250, 250))
 {
     _topLeftPos = new Vector2(this.Position.X + this.Border.LeftWidth, this.Position.Y + this.Border.TopHeight);
     _scaledMapGrh = new Grh(null);
     _entityCharGrh = new Grh(GrhInfo.GetData("GUI", "MiniMapCharacter"));
     _entityNPCGrh = new Grh(GrhInfo.GetData("GUI", "MiniMapNPC"));
     _gamePlayScreen = screen;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Form"/> class.
        /// </summary>
        /// <param name="gps">The <see cref="GameplayScreen"/>.</param>
        /// <param name="parent">Parent <see cref="Control"/> of this <see cref="Control"/>.</param>
        /// <param name="position">Position of the Control reletive to its parent.</param>
        /// <exception cref="NullReferenceException"><paramref name="parent"/> is null.</exception>
        public QuickBarForm(GameplayScreen gps, Control parent, Vector2 position) : base(parent, position, Vector2.One)
        {
            ResizeToChildren = false;

            _gps = gps;

            RepositionSlots();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameplayScreenControls"/> class.
        /// </summary>
        /// <param name="gameplayScreen">The <see cref="GameplayScreen"/>.</param>
        /// <exception cref="ArgumentNullException"><paramref name="gameplayScreen" /> is <c>null</c>.</exception>
        public GameplayScreenControls(GameplayScreen gameplayScreen)
        {
            if (gameplayScreen == null)
                throw new ArgumentNullException("gameplayScreen");

            _gameplayScreen = gameplayScreen;

            CreateControls();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DragDropHandler"/> class.
        /// </summary>
        /// <param name="gps">The <see cref="GameplayScreen"/>.</param>
        public DragDropHandler(GameplayScreen gps)
        {
            // NOTE: Please read this before implementing new methods!
            // All methods are hooked automatically using reflection. The methods that begin with CanDrop_
            // implement the logic for the CanDrop() method for a specific source and destination. Methods that
            // begin with Drop_ do the same for Drop(). It is highly recommended that you follow the pattern
            // provided. That is, use the naming conventions used already. In the Drop_ method, be sure to
            // call the corresponding CanDrop_ method before handling.

            _gps = gps;

            // Find all the methods
            var methods = typeof(DragDropHandler).GetMethods(_bindingFlags);

            // Get the delegates for the methods
            _canDropCallbacks = CreateDropCallbacks(methods, _canDropMethodPrefix);
            _dropCallbacks = CreateDropCallbacks(methods, _dropMethodPrefix);
        }
Exemplo n.º 5
0
        void RecvChat(IIPSocket conn, BitStream r)
        {
            var text = r.ReadString(GameData.MaxServerSayLength);

            GameplayScreen.AppendToChatOutput(text);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the current time.
 /// </summary>
 /// <returns>Current time.</returns>
 public TickCount GetTime()
 {
     return(GameplayScreen.GetTime());
 }