예제 #1
0
파일: MainForm.cs 프로젝트: wutxtt/Tractor
        //牌面图案
        private void SelectCardImage_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;

            if (menuItem.Text.Equals("普通图案"))
            {
                gameConfig.CardsResourceManager             = Kuaff_Cards.ResourceManager;
                CommonToolStripMenuItem.CheckState          = CheckState.Checked;
                ModelToolStripMenuItem.CheckState           = CheckState.Unchecked;
                OperaToolStripMenuItem.CheckState           = CheckState.Unchecked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";
            }
            else if (menuItem.Text.Equals("香车美女"))
            {
                gameConfig.CardsResourceManager             = Kuaff_Model.ResourceManager;
                CommonToolStripMenuItem.CheckState          = CheckState.Unchecked;
                ModelToolStripMenuItem.CheckState           = CheckState.Checked;
                OperaToolStripMenuItem.CheckState           = CheckState.Unchecked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";
            }
            else if (menuItem.Text.Equals("京剧脸谱"))
            {
                gameConfig.CardsResourceManager             = Kuaff_Opera.ResourceManager;
                CommonToolStripMenuItem.CheckState          = CheckState.Unchecked;
                ModelToolStripMenuItem.CheckState           = CheckState.Unchecked;
                OperaToolStripMenuItem.CheckState           = CheckState.Checked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";
            }
            else if (menuItem.Text.StartsWith("自定义"))
            {
                SelectCardsImage sci = new SelectCardsImage(this);
                if (sci.ShowDialog(this) == DialogResult.OK)
                {
                    gameConfig.CardImageName = sci.CardsName;
                    menuItem.Text            = "自定义--" + gameConfig.CardImageName;

                    CommonToolStripMenuItem.CheckState          = CheckState.Unchecked;
                    ModelToolStripMenuItem.CheckState           = CheckState.Unchecked;
                    OperaToolStripMenuItem.CheckState           = CheckState.Unchecked;
                    CustomCardImageToolStripMenuItem.CheckState = CheckState.Checked;
                }
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: nxsky/Tractor
        //牌面图案
        private void SelectCardImage_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = (ToolStripMenuItem)sender;

            if (menuItem.Text.Equals("普通图案"))
            {
                gameConfig.CardsResourceManager = Kuaff_Cards.ResourceManager;
                CommonToolStripMenuItem.CheckState = CheckState.Checked;
                ModelToolStripMenuItem.CheckState = CheckState.Unchecked;
                OperaToolStripMenuItem.CheckState = CheckState.Unchecked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";

            }
            else if (menuItem.Text.Equals("香车美女"))
            {
                gameConfig.CardsResourceManager = Kuaff_Model.ResourceManager;
                CommonToolStripMenuItem.CheckState = CheckState.Unchecked;
                ModelToolStripMenuItem.CheckState = CheckState.Checked;
                OperaToolStripMenuItem.CheckState = CheckState.Unchecked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";
            }
            else if (menuItem.Text.Equals("京剧脸谱"))
            {
                gameConfig.CardsResourceManager = Kuaff_Opera.ResourceManager;
                CommonToolStripMenuItem.CheckState = CheckState.Unchecked;
                ModelToolStripMenuItem.CheckState = CheckState.Unchecked;
                OperaToolStripMenuItem.CheckState = CheckState.Checked;
                CustomCardImageToolStripMenuItem.CheckState = CheckState.Unchecked;

                CustomCardImageToolStripMenuItem.Text = "自定义";
                gameConfig.CardImageName = "";
            }
            else if (menuItem.Text.StartsWith("自定义"))
            {
                SelectCardsImage sci = new SelectCardsImage(this);
                if (sci.ShowDialog(this) == DialogResult.OK)
                {
                    gameConfig.CardImageName = sci.CardsName;
                    menuItem.Text = "自定义--" + gameConfig.CardImageName;

                    CommonToolStripMenuItem.CheckState = CheckState.Unchecked;
                    ModelToolStripMenuItem.CheckState = CheckState.Unchecked;
                    OperaToolStripMenuItem.CheckState = CheckState.Unchecked;
                    CustomCardImageToolStripMenuItem.CheckState = CheckState.Checked;
                }
            }
        }