diff --git a/PrimaryFormParts/PrimaryForm.SoundEffects.cs b/PrimaryFormParts/PrimaryForm.SoundEffects.cs index 449e0b5..38738d0 100644 --- a/PrimaryFormParts/PrimaryForm.SoundEffects.cs +++ b/PrimaryFormParts/PrimaryForm.SoundEffects.cs @@ -30,60 +30,60 @@ namespace DualScreenDemo { Name = "constructionButton", }; - ConfigureButton(constructionButton, 876, 494, 148, 64, + ConfigureButton(constructionButton, 18, 68, 148, 64, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])), ConstructionButton_Click); - this.Controls.Add(constructionButton); + pictureBoxSceneSoundEffects.Controls.Add(constructionButton); marketButton = new Button { Name = "marketButton", }; - ConfigureButton(marketButton, 1037, 495, 148, 63, + ConfigureButton(marketButton, 179, 68, 148, 63, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])), MarketButton_Click); - this.Controls.Add(marketButton); + pictureBoxSceneSoundEffects.Controls.Add(marketButton); drivingButton = new Button { Name = "drivingButton", }; - ConfigureButton(drivingButton, 876, 570, 148, 63, + ConfigureButton(drivingButton, 18, 144, 148, 63, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])), DrivingButton_Click); - this.Controls.Add(drivingButton); + pictureBoxSceneSoundEffects.Controls.Add(drivingButton); airportButton = new Button { Name = "airportButton", }; - ConfigureButton(airportButton, 1037, 570, 148, 63, + ConfigureButton(airportButton, 179, 144, 148, 63, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])), AirportButton_Click); - this.Controls.Add(airportButton); + pictureBoxSceneSoundEffects.Controls.Add(airportButton); officeButton = new Button { Name = "officeButton", }; - ConfigureButton(officeButton, 876, 646, 148, 64, + ConfigureButton(officeButton, 18, 220, 148, 64, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])), OfficeButton_Click); - this.Controls.Add(officeButton); + pictureBoxSceneSoundEffects.Controls.Add(officeButton); closeButton = new Button @@ -91,22 +91,19 @@ namespace DualScreenDemo Name = "closeButton", }; - ConfigureButton(closeButton, 1036, 646, 150, 63, + ConfigureButton(closeButton, 179, 220, 150, 63, new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])), new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])), CloseButton_Click); - this.Controls.Add(closeButton); + pictureBoxSceneSoundEffects.Controls.Add(closeButton); } private void SoundEffectButton_Click(object sender, EventArgs e) { var data = LoadBtnConfigData(); - - SetHotSongButtonsVisibility(false); - SetNewSongButtonsVisibility(false); - SetSingerSearchButtonsVisibility(false); - SetSongSearchButtonsVisibility(false); + SetPictureBoxToggleLightAndButtonsVisibility(false); + CloseUI(pictureBoxQRCode); if (!pictureBoxSceneSoundEffects.Visible) { @@ -150,19 +147,12 @@ namespace DualScreenDemo } private void ShowImageOnPictureBoxSceneSoundEffects(string imagePath) - { - + { Bitmap originalImage = new Bitmap(imagePath); - - Rectangle cropArea = new Rectangle(859, 427, 342, 295); - - - Bitmap croppedImage = CropImage(originalImage, cropArea); - - - pictureBoxSceneSoundEffects.Image = originalImage; - + Rectangle cropArea = new Rectangle(856, 422, 342, 295); + + pictureBoxSceneSoundEffects.Image = originalImage; ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height); @@ -170,45 +160,19 @@ namespace DualScreenDemo } private void TogglePictureBoxSceneSoundEffectsButtonsVisibility() - { - + { bool areButtonsVisible = pictureBoxSceneSoundEffects.Visible; - SetPictureBoxSceneSoundEffectsAndButtonsVisibility(!areButtonsVisible); } - private void SetPictureBoxSceneSoundEffectsAndButtonsVisibility(bool isVisible) - { - + { pictureBoxSceneSoundEffects.Visible = isVisible; if (isVisible) { - - pictureBoxSceneSoundEffects.BringToFront(); - } - - - List