/// <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; }
/// <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(); }
/// <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(); }
/// <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); }
void RecvChat(IIPSocket conn, BitStream r) { var text = r.ReadString(GameData.MaxServerSayLength); GameplayScreen.AppendToChatOutput(text); }
/// <summary> /// Gets the current time. /// </summary> /// <returns>Current time.</returns> public TickCount GetTime() { return(GameplayScreen.GetTime()); }