2024-04-18 08:38:59 +08:00
|
|
|
|
namespace CDSAE3_Lian_Lian_Kan.Forms
|
2024-03-22 17:03:01 +08:00
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
public partial class MenuForm : Form, IMenuForm
|
2024-03-22 17:03:01 +08:00
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
public MenuForm()
|
2024-03-22 17:03:01 +08:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2024-04-18 08:38:59 +08:00
|
|
|
|
Etcs.gameMenuForm = this;
|
|
|
|
|
SetTheme();
|
|
|
|
|
}
|
|
|
|
|
Color menuThemeColor, playThemeColor;
|
|
|
|
|
bool IsOutPicture = false;
|
|
|
|
|
bool AnimationUseImage = false;
|
|
|
|
|
Image? playPanelImage;
|
|
|
|
|
public void SetTheme()
|
|
|
|
|
{
|
|
|
|
|
Etcs.ThemeInfo theme = Etcs.currentThemeInfo;
|
|
|
|
|
AnimationUseImage = theme.AnimationUseImage;
|
|
|
|
|
IsOutPicture = theme.IsOutPicture;
|
|
|
|
|
if (IsOutPicture)
|
|
|
|
|
BackgroundImage = new Bitmap(theme.PictureName!);
|
|
|
|
|
else
|
|
|
|
|
BackgroundImage = (Image)Etcs.res_Manager.GetObject(theme.PictureName!, Etcs.res_Culture)!;
|
|
|
|
|
if (theme.PlayPanelUsePicture)
|
|
|
|
|
if (theme.PlayPanelPictureIsOutPicture)
|
|
|
|
|
playPanelImage = new Bitmap(theme.PlayPanelPictureName!);
|
|
|
|
|
else
|
|
|
|
|
playPanelImage = (Image)Etcs.res_Manager.GetObject(theme.PlayPanelPictureName!, Etcs.res_Culture)!;
|
|
|
|
|
start_Game.Location = new Point(theme.StartGamePos![0], theme.StartGamePos[1]);
|
|
|
|
|
to_Challenge_mode.Location = new Point(theme.ChallengeModePos![0], theme.ChallengeModePos[1]);
|
|
|
|
|
to_table_of_scores.Location = new Point(theme.ScoreBoardPos![0], theme.ScoreBoardPos[1]);
|
|
|
|
|
to_settings.Location = new Point(theme.SettingsPos![0], theme.SettingsPos[1]);
|
|
|
|
|
menuThemeColor = Color.FromArgb(theme.ThemeColor![0], theme.ThemeColor[1], theme.ThemeColor[2]);
|
|
|
|
|
Color buttonColor = theme.ButtonColor!.Count == 3 ? Color.FromArgb(theme.ButtonColor![0], theme.ButtonColor![1], theme.ButtonColor![2]) :
|
|
|
|
|
Color.FromArgb(theme.ButtonColor![0], theme.ButtonColor![1], theme.ButtonColor![2], theme.ButtonColor![3]);
|
|
|
|
|
playThemeColor = Color.FromArgb(theme.PlayAreaThemeColor![0], theme.PlayAreaThemeColor[1], theme.PlayAreaThemeColor[2]);
|
|
|
|
|
start_Game.BackColor = buttonColor;
|
|
|
|
|
to_Challenge_mode.BackColor = buttonColor;
|
|
|
|
|
to_table_of_scores.BackColor = buttonColor;
|
|
|
|
|
to_settings.BackColor = buttonColor;
|
|
|
|
|
start_Game.Size = new Size(theme.ButtonSize![0], theme.ButtonSize[1]);
|
|
|
|
|
to_Challenge_mode.Size = new Size(theme.ButtonSize[0], theme.ButtonSize[1]);
|
|
|
|
|
to_table_of_scores.Size = new Size(theme.ButtonSize[0], theme.ButtonSize[1]);
|
|
|
|
|
to_settings.Size = new Size(theme.ButtonSize[0], theme.ButtonSize[1]);
|
|
|
|
|
mainLabel.Font = new Font(theme.Font!, float.Parse(theme.FontSize!));
|
|
|
|
|
mainLabel.BackColor = buttonColor;
|
|
|
|
|
mainLabel.ForeColor = Color.FromArgb(theme.FontColor![0], theme.FontColor[1], theme.FontColor[2]);
|
|
|
|
|
mainLabel.Location = new Point(theme.FontBlockPos![0], theme.FontBlockPos[1]);
|
|
|
|
|
mainLabel.Size = new Size(theme.FontBlockSize![0], theme.FontBlockSize[1]);
|
2024-04-19 10:00:37 +08:00
|
|
|
|
Etcs.song_Audio_Processer.set_albums(Etcs.curAlbum);
|
|
|
|
|
Etcs.song_Audio_Processer.set_song(Etcs.song_Audio_Processer.get_next_song());
|
2024-04-18 08:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
public void playFormToMenu()
|
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
Etcs.form?.change_form(this, true, playThemeColor, menuThemeColor);
|
2024-03-22 17:03:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void start_Game_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
Etcs.form?.change_form(new Leisure_Mode(), true, menuThemeColor, playThemeColor);
|
2024-04-18 08:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-19 10:00:37 +08:00
|
|
|
|
private void to_settings_Click(object sender, EventArgs e)
|
2024-04-18 08:38:59 +08:00
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
Etcs.form?.change_form(Etcs.setting, false, null, null);
|
2024-04-18 08:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void to_table_of_scores_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-04-19 10:00:37 +08:00
|
|
|
|
Etcs.form?.change_form(Etcs.charts, false, null, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void to_Challenge_mode_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//Etcs.form?.change_form(new Challenge_Mode(), true, menuThemeColor, playThemeColor, AnimationUseImage, this.BackgroundImage);
|
|
|
|
|
Etcs.form?.change_form(new Challenge_Mode(), true, menuThemeColor, Color.Black);
|
|
|
|
|
|
2024-03-22 17:03:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|