public NotificationHelper(InvokerCrappahilationPaid main) { _main = main; Renderer = main.Context.RenderManager; var startPosition = HUDInfo.GetCustomTopPanelPosition(0, Team.Radiant) + new Vector2(0, HUDInfo.TopPanelSizeY); Notifications = new List <Notification>(); var sizeX = HUDInfo.TopPanelSizeX; var sizeY = HUDInfo.TopPanelSizeY; Renderer.Draw += renderer => { foreach (var notification in Notifications) { if (notification.IsActive) { var rect = new RectangleF(notification.StartPosition.X, notification.StartPosition.Y, sizeX, notification.CurrentPosition.Y - notification.StartPosition.Y); renderer.DrawFilledRectangle(rect, Color.FromArgb(155, 50, 50, 50), Color.FromArgb(255, 0, 0, 0)); if (notification.State == Notification.StateType.Staying) { var r = new RectangleF(rect.X, rect.Y + rect.Height - sizeX, sizeX, sizeX); renderer.DrawTexture(notification.TextureId, r); } } } }; UpdateManager.Subscribe(() => { foreach (var notification in Notifications) { if (notification.IsActive) { notification.Move(); } } Notifications.RemoveAll(x => !x.IsActive); }, 25); /*_main.Context.Input.RegisterHotkey("Toster", Key.S, args => * { * Notificate(_main.Me, AbilityId.invoker_sun_strike); * });*/ }
public Additional(Common common) { CheckRuneMenu = common.MenuConfig.ShowMeMoreMenu.CheckRuneMenu; CheckHandOfMidasMenu = common.MenuConfig.ShowMeMoreMenu.CheckHandOfMidasMenu; RoshanMenu = common.MenuConfig.ShowMeMoreMenu.RoshanMenu; MessageCreator = common.MessageCreator; SoundHelper = common.SoundHelper; RendererManager.LoadTextureFromAssembly("Divine.BeAware.Resources.Textures.roshan_alive.png"); RendererManager.LoadTextureFromAssembly("Divine.BeAware.Resources.Textures.roshan_dead.png"); RoshanPanelPosition = HUDInfo.GetCustomTopPanelPosition(1, Team.Radiant) - (new Vector2(480, -4) * RendererManager.Scaling); GameManager.GameEvent += OnGameEvent; UpdateManager.CreateIngameUpdate(1000, OnTimeEvent); RendererManager.Draw += OnDraw; }