superstar_v2/PrimaryFormParts/GroupSearch/PrimaryForm.GroupSearch.cs

187 lines
10 KiB
C#
Raw Normal View History

2025-08-06 10:47:43 +08:00
using System.IO;
2025-04-07 16:54:10 +08:00
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private Button groupSearchButton;
private Bitmap groupSearchNormalBackground;
private Bitmap groupSearchActiveBackground;
private Button groupGuoYuButton;
private Bitmap groupGuoYuNormalBackground;
private Bitmap groupGuoYuActiveBackground;
private Button groupTaiYuButton;
private Bitmap groupTaiYuNormalBackground;
private Bitmap groupTaiYuActiveBackground;
private Button groupYueYuButton;
private Bitmap groupYueYuNormalBackground;
private Bitmap groupYueYuActiveBackground;
private Button groupYingWenButton;
private Bitmap groupYingWenNormalBackground;
private Bitmap groupYingWenActiveBackground;
private Button groupRiYuButton;
private Bitmap groupRiYuNormalBackground;
private Bitmap groupRiYuActiveBackground;
private Button groupHanYuButton;
private Bitmap groupHanYuNormalBackground;
private Bitmap groupHanYuActiveBackground;
private void InitializeButtonsForGroupPictureBox()
{
groupGuoYuButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupGuoYuButton, 1197, 225, 225, 50);
Rectangle groupGuoYuButtonCropArea = new Rectangle(1197, 225, 225, 50);
2025-08-07 13:09:10 +08:00
groupGuoYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(未按).png"));
groupGuoYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(已按).png"));
2025-04-07 16:54:10 +08:00
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground;
groupGuoYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupGuoYuButton.FlatStyle = FlatStyle.Flat;
groupGuoYuButton.FlatAppearance.BorderSize = 0;
groupGuoYuButton.Click += GroupGuoYuButton_Click;
this.Controls.Add(groupGuoYuButton);
groupTaiYuButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupTaiYuButton, 1197, 280, 225, 50);
Rectangle groupTaiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
2025-08-07 13:09:10 +08:00
groupTaiYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(未按).png"));
groupTaiYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(已按).png"));
2025-04-07 16:54:10 +08:00
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupTaiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupTaiYuButton.FlatStyle = FlatStyle.Flat;
groupTaiYuButton.FlatAppearance.BorderSize = 0;
groupTaiYuButton.Click += GroupTaiYuButton_Click;
this.Controls.Add(groupTaiYuButton);
groupYueYuButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupYueYuButton, 1197, 335, 225, 50);
Rectangle groupYueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
2025-08-07 13:09:10 +08:00
groupYueYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(未按).png"));
groupYueYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(已按).png"));
2025-04-07 16:54:10 +08:00
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYueYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYueYuButton.FlatStyle = FlatStyle.Flat;
groupYueYuButton.FlatAppearance.BorderSize = 0;
groupYueYuButton.Click += GroupYueYuButton_Click;
this.Controls.Add(groupYueYuButton);
groupYingWenButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupYingWenButton, 1197, 390, 225, 50);
Rectangle groupYingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
2025-08-07 13:09:10 +08:00
groupYingWenNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(未按).png"));
groupYingWenActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(已按).png"));
2025-04-07 16:54:10 +08:00
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupYingWenButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYingWenButton.FlatStyle = FlatStyle.Flat;
groupYingWenButton.FlatAppearance.BorderSize = 0;
groupYingWenButton.Click += GroupYingWenButton_Click;
this.Controls.Add(groupYingWenButton);
groupRiYuButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupRiYuButton, 1197, 445, 225, 50);
Rectangle groupRiYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
2025-08-07 13:09:10 +08:00
groupRiYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(未按).png"));
groupRiYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(已按).png"));
2025-04-07 16:54:10 +08:00
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupRiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupRiYuButton.FlatStyle = FlatStyle.Flat;
groupRiYuButton.FlatAppearance.BorderSize = 0;
groupRiYuButton.Click += GroupRiYuButton_Click;
this.Controls.Add(groupRiYuButton);
groupHanYuButton = new Button { Text = "", Visible = false };
2025-08-06 10:47:43 +08:00
ResizeAndPositionButton(groupHanYuButton, 1197, 500, 225, 50);
Rectangle groupHanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
2025-08-07 13:09:10 +08:00
groupHanYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(未按).png"));
groupHanYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(已按).png"));
2025-04-07 16:54:10 +08:00
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
groupHanYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupHanYuButton.FlatStyle = FlatStyle.Flat;
groupHanYuButton.FlatAppearance.BorderSize = 0;
groupHanYuButton.Click += GroupHanYuButton_Click;
this.Controls.Add(groupHanYuButton);
}
private void GroupSongSelectionButton_Click(object sender, EventArgs e)
{
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
2025-08-07 13:09:10 +08:00
groupSearchButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_合唱查詢(已按).png"));
2025-04-07 16:54:10 +08:00
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false;
groupGuoYuButton.BackgroundImage = groupGuoYuActiveBackground;
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
2025-04-14 14:17:06 +08:00
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
2025-04-07 16:54:10 +08:00
.OrderByDescending(song => song.Plays)
2025-04-14 14:17:06 +08:00
.ToList();*/
2025-04-23 13:55:11 +08:00
/* 清空搜尋欄 */
ResetinputBox();
2025-06-24 10:35:01 +08:00
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
2025-04-14 14:17:06 +08:00
var guoYuSongs = SearchSongs_Mysql(query);
2025-04-07 16:54:10 +08:00
currentPage = 0;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(guoYuSongs);
2025-04-07 16:54:10 +08:00
SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false);
SetSongSearchButtonsVisibility(false);
SetPictureBoxLanguageButtonsVisibility(false);
SetPictureBoxCategoryAndButtonsVisibility(false);
SetZhuYinSingersAndButtonsVisibility(false);
SetZhuYinSongsAndButtonsVisibility(false);
SetEnglishSingersAndButtonsVisibility(false);
SetEnglishSongsAndButtonsVisibility(false);
SetPinYinSingersAndButtonsVisibility(false);
SetPinYinSongsAndButtonsVisibility(false);
SetPictureBoxToggleLightAndButtonsVisibility(false);
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
SetGroupButtonsVisibility(true);
if (pictureBoxQRCode != null)
{
pictureBoxQRCode.Visible = false;
closeQRCodeButton.Visible = false;
}
}
private void SetGroupButtonsVisibility(bool isVisible)
{
Button[] pictureBox6Buttons = { groupGuoYuButton, groupTaiYuButton, groupYueYuButton, groupYingWenButton, groupRiYuButton, groupHanYuButton };
foreach (var button in pictureBox6Buttons)
{
button.Visible = isVisible;
if (isVisible)
{
button.BringToFront();
}
}
}
}
}