protected void LoadTextures() { _icon64 = ContentsManager.GetTexture("screenshots_icon_64x64.png"); //_icon128 = ContentsManager.GetTexture("screenshots_icon_128x128.png"); _inspectIcon = ContentsManager.GetTexture("inspect.png"); //_portaitModeIcon128 = ContentsManager.GetTexture("portaitMode_icon_128x128.png"); //_portaitModeIcon512 = ContentsManager.GetTexture("portaitMode_icon_128x128.png"); _trashcanClosedIcon64 = ContentsManager.GetTexture("trashcanClosed_icon_64x64.png"); _trashcanOpenIcon64 = ContentsManager.GetTexture("trashcanOpen_icon_64x64.png"); //_trashcanClosedIcon128 = ContentsManager.GetTexture("trashcanClosed_icon_128x128.png"); //_trashcanOpenIcon128 = ContentsManager.GetTexture("trashcanOpen_icon_128x128.png"); _incompleteHeartIcon = ContentsManager.GetTexture("incomplete_heart.png"); _completeHeartIcon = ContentsManager.GetTexture("complete_heart.png"); _deleteSearchBoxContentIcon = ContentsManager.GetTexture("784262.png"); _notificationBackroundTexture = ContentsManager.GetTexture("ns-button.png"); }
protected override void Initialize() { ICON = ICON ?? ContentsManager.GetTexture("musician_icon.png"); Conveyor = new Conveyor() { Parent = ContentService.Graphics.SpriteScreen, Visible = false }; xmlParser = new XmlMusicSheetReader(); displayedSheets = new List <SheetButton>(); StopButton = new HealthPoolButton() { Parent = GameService.Graphics.SpriteScreen, Text = "Stop Playback", ZIndex = -1, Visible = false }; StopButton.LeftMouseButtonReleased += delegate { this.StopPlayback(); }; GameService.GameIntegration.Gw2LostFocus += GameIntegrationOnGw2LostFocus; }
protected override void Initialize() { LoadTextures(); GameService.Overlay.UserLocaleChanged += ChangeLocalization; ChangeLocalization(null, null); printScreenKey = new KeyBinding(Keys.PrintScreen); printScreenKey.Activated += ScreenshotNotify; printScreenKey.Enabled = true; screensPathWatchers = new List <FileSystemWatcher>(); displayedThumbnails = new Dictionary <string, Panel>(); foreach (var f in _imageFilters) { var w = new FileSystemWatcher { Path = DirectoryUtil.ScreensPath, NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName, Filter = f, EnableRaisingEvents = true }; w.Created += OnScreenshotCreated; w.Deleted += OnScreenshotDeleted; w.Renamed += OnScreenshotRenamed; screensPathWatchers.Add(w); } moduleCornerIcon = new CornerIcon { IconName = Name, Icon = ContentsManager.GetTexture("screenshots_icon_64x64.png"), Priority = Name.GetHashCode() }; moduleCornerIcon.Click += delegate { GameService.Overlay.BlishHudWindow.Show(); GameService.Overlay.BlishHudWindow.Navigate(modulePanel); //TODO: Select the correct tab. }; }
private Panel BuildLibraryPanel(WindowBase wndw) { var lPanel = new Panel() { CanScroll = false, Size = wndw.ContentRegion.Size }; var backButton = new BackButton(wndw) { Text = "Musician", NavTitle = "Library", Parent = lPanel, Location = new Point(20, 20), }; var melodyPanel = new Panel() { Location = new Point(0, MusicianModule.BOTTOM_MARGIN + backButton.Bottom), Size = new Point(lPanel.Width, lPanel.Size.Y - 50 - MusicianModule.BOTTOM_MARGIN), Parent = lPanel, ShowTint = true, ShowBorder = true, CanScroll = true }; // TODO: Load a list from online database. foreach (RawMusicSheet sheet in Sheets) { var melody = new SheetButton { Parent = melodyPanel, Icon = ContentsManager.GetTexture(@"instruments\" + sheet.Instrument.ToLowerInvariant() + ".png"), IconSize = DetailsIconSize.Small, Artist = sheet.Artist, Title = sheet.Title, User = sheet.User, MusicSheet = sheet }; displayedSheets.Add(melody); melody.LeftMouseButtonPressed += delegate { if (melody.MouseOverPlay) { this.StopPlayback(); GameService.Overlay.BlishHudWindow.Hide(); MusicPlayer = MusicPlayerFactory.Create( melody.MusicSheet, InstrumentMode.Preview ); MusicPlayer.Worker.Start(); Conveyor.Visible = true; StopButton.Visible = true; } if (melody.MouseOverEmulate) { this.StopPlayback(); GameService.Overlay.BlishHudWindow.Hide(); MusicPlayer = MusicPlayerFactory.Create( melody.MusicSheet, InstrumentMode.Emulate ); MusicPlayer.Worker.Start(); StopButton.Visible = true; } if (melody.MouseOverPreview) { if (melody.IsPreviewing) { this.StopPlayback(); } else { this.StopPlayback(); melody.IsPreviewing = true; MusicPlayer = MusicPlayerFactory.Create( melody.MusicSheet, InstrumentMode.Preview ); MusicPlayer.Worker.Start(); } } }; } var ddSortMethod = new Dropdown() { Parent = lPanel, Visible = melodyPanel.Visible, Location = new Point(lPanel.Right - 150 - 10, 5), Width = 150 }; ddSortMethod.Items.Add(DD_TITLE); ddSortMethod.Items.Add(DD_ARTIST); ddSortMethod.Items.Add(DD_USER); ddSortMethod.Items.Add("------------------"); ddSortMethod.Items.Add(DD_HARP); ddSortMethod.Items.Add(DD_FLUTE); ddSortMethod.Items.Add(DD_LUTE); ddSortMethod.Items.Add(DD_HORN); ddSortMethod.Items.Add(DD_BASS); ddSortMethod.Items.Add(DD_BELL); ddSortMethod.Items.Add(DD_BELL2); ddSortMethod.ValueChanged += UpdateSort; ddSortMethod.SelectedItem = DD_TITLE; UpdateSort(ddSortMethod, EventArgs.Empty); backButton.LeftMouseButtonReleased += (object sender, MouseEventArgs e) => { wndw.NavigateHome(); }; return(lPanel); }