superstar_v2/PrimaryFormParts/GroupSearch/PrimaryForm.GroupSearch.cs

130 lines
6.2 KiB
C#
Raw Normal View History

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 UpdateGroupSubBtns(Button activeButton, Image activeBackground)
2025-04-07 16:54:10 +08:00
{
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground;
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
activeButton.BackgroundImage = activeBackground;
2025-04-07 16:54:10 +08:00
}
private void InitializeButtonsForGroupPictureBox()
{
var data = LoadBtnConfigData();
InitializeButton(ref groupGuoYuButton, ref groupGuoYuNormalBackground, ref groupGuoYuActiveBackground, "groupGuoYuButton", 1197, 225, 225, 50, data["GroupSubBtn"]["GuoYuNormal"], data["GroupSubBtn"]["GuoYuActive"], GroupGuoYuButton_Click);
InitializeButton(ref groupTaiYuButton, ref groupTaiYuNormalBackground, ref groupTaiYuActiveBackground, "groupTaiYuButton", 1197, 280, 225, 50, data["GroupSubBtn"]["TaiYuNormal"], data["GroupSubBtn"]["TaiYuActive"], GroupTaiYuButton_Click);
InitializeButton(ref groupYueYuButton, ref groupYueYuNormalBackground, ref groupYueYuActiveBackground, "groupYueYuButton", 1197, 335, 225, 50, data["GroupSubBtn"]["YueYuNormal"], data["GroupSubBtn"]["YueYuActive"], GroupYueYuButton_Click);
InitializeButton(ref groupYingWenButton, ref groupYingWenNormalBackground, ref groupYingWenActiveBackground, "groupYingWenButton", 1197, 390, 225, 50, data["GroupSubBtn"]["YingWenNormal"], data["GroupSubBtn"]["YingWenActive"], GroupYingWenButton_Click);
InitializeButton(ref groupRiYuButton, ref groupRiYuNormalBackground, ref groupRiYuActiveBackground, "groupRiYuButton", 1197, 445, 225, 50, data["GroupSubBtn"]["RiYuNormal"], data["GroupSubBtn"]["RiYuActive"], GroupRiYuButton_Click);
InitializeButton(ref groupHanYuButton, ref groupHanYuNormalBackground, ref groupHanYuActiveBackground, "groupHanYuButton", 1197, 500, 225, 50, data["GroupSubBtn"]["HanYuNormal"], data["GroupSubBtn"]["HanYuActive"], GroupHanYuButton_Click);
}
2025-04-07 16:54:10 +08:00
private void GroupSongSelectionButton_Click(object sender, EventArgs e)
{
UpdateButtonBackgrounds(groupSearchButton, groupSearchActiveBackground);
2025-04-07 16:54:10 +08:00
isOnOrderedSongsPage = false;
2025-04-07 16:54:10 +08:00
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);
2025-08-13 16:42:22 +08:00
SetHandWritingForSongsAndButtonsVisibility(false);
SetWordCountSongsAndButtonsVisibility(false);
SetSongIDSearchAndButtonsVisibility(false);
SetHandWritingForSingersAndButtonsVisibility(false);
SetWordCountSingersAndButtonsVisibility(false);
2025-04-07 16:54:10 +08:00
SetGroupButtonsVisibility(true);
UpdateGroupSubBtns(groupGuoYuButton, groupGuoYuActiveBackground);
2025-04-07 16:54:10 +08:00
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();
}
}
}
}
}