Exemple #1
0
        /// <summary>
        /// 菜单:编辑
        /// </summary>
        private void toolStripMenuItem5_Click(object sender, EventArgs e)
        {
            if (this.codeListBox.SelectedIndex == -1)
            {
                return;
            }
            var editPack = this.core.GetEditPackage(this.codeListBox.SelectedIndex);

            switch (editPack.nodeType)
            {
            case ActionPackageType.act_dialog:
                DialogForm editDialogDf = new DialogForm("显示对话", true, editPack.argsDict["context"].valueExp);
                editDialogDf.ShowDialog(this);
                break;

            case ActionPackageType.script:
                DialogForm editScriptDf = new DialogForm("代码片段", true, editPack.argsDict["context"].valueExp);
                editScriptDf.ShowDialog(this);
                break;

            case ActionPackageType.notation:
                NotationForm editNf = new NotationForm(true, editPack.argsDict["context"].valueExp);
                editNf.ShowDialog(this);
                break;

            case ActionPackageType.act_wait:
                WaitForm editWf = new WaitForm(true, Convert.ToInt32(editPack.argsDict["time"].valueExp));
                editWf.ShowDialog(this);
                break;

            case ActionPackageType.act_a:
                AForm editAf = new AForm(true, editPack.argsDict["name"].valueExp,
                                         editPack.argsDict["face"].valueExp, editPack.argsDict["loc"].valueExp,
                                         editPack.argsDict["vid"].valueExp);
                editAf.ShowDialog(this);
                break;

            case ActionPackageType.act_picture:
                PicturesForm editPf = new PicturesForm(true, editPack.argsDict["id"].valueExp,
                                                       editPack.argsDict["filename"].valueExp, editPack.argsDict["x"].valueExp,
                                                       editPack.argsDict["y"].valueExp, editPack.argsDict["xscale"].valueExp,
                                                       editPack.argsDict["yscale"].valueExp, editPack.argsDict["opacity"].valueExp,
                                                       editPack.argsDict["ro"].valueExp);
                editPf.ShowDialog(this);
                break;

            case ActionPackageType.act_move:
                MoveForm editMf = new MoveForm(true, editPack.argsDict["name"].valueExp,
                                               editPack.argsDict["id"].valueExp, editPack.argsDict["time"].valueExp,
                                               editPack.argsDict["target"].valueExp, editPack.argsDict["dash"].valueExp,
                                               editPack.argsDict["acc"].valueExp);
                editMf.ShowDialog(this);
                break;

            case ActionPackageType.act_button:
                ButtonForm editBf = new ButtonForm(true, editPack.argsDict["id"].valueExp,
                                                   editPack.argsDict["x"].valueExp, editPack.argsDict["y"].valueExp,
                                                   editPack.argsDict["target"].valueExp, editPack.argsDict["type"].valueExp,
                                                   editPack.argsDict["normal"].valueExp, editPack.argsDict["over"].valueExp,
                                                   editPack.argsDict["on"].valueExp);
                editBf.ShowDialog(this);
                break;

            case ActionPackageType.act_jump:
                JumpForm editJf = new JumpForm(true, editPack.argsDict["filename"].valueExp,
                                               editPack.argsDict["target"].valueExp, editPack.argsDict["cond"].valueExp);
                editJf.ShowDialog(this);
                break;

            case ActionPackageType.act_label:
                LabelForm editLf = new LabelForm(true, editPack.argsDict["name"].valueExp);
                editLf.ShowDialog(this);
                break;

            case ActionPackageType.act_vocal:
                VocalForm editVocalf = new VocalForm(true, editPack.argsDict["name"].valueExp,
                                                     editPack.argsDict["vid"].valueExp);
                editVocalf.ShowDialog();
                break;

            case ActionPackageType.act_scamera:
                SCameraForm editScf = new SCameraForm(true, editPack.argsDict["name"].valueExp,
                                                      editPack.argsDict["x"].valueExp, editPack.argsDict["y"].valueExp,
                                                      editPack.argsDict["ro"].valueExp);
                editScf.ShowDialog(this);
                break;

            case ActionPackageType.act_deletepicture:
                DeleteViewForm editDpf = new DeleteViewForm(0, true, editPack.argsDict["id"].valueExp);
                editDpf.ShowDialog(this);
                break;

            case ActionPackageType.act_deletecstand:
                DeleteViewForm editDcf = new DeleteViewForm(1, true, editPack.argsDict["id"].valueExp);
                editDcf.ShowDialog(this);
                break;

            case ActionPackageType.act_deletebutton:
                DeleteViewForm editDsf = new DeleteViewForm(2, true, editPack.argsDict["id"].valueExp);
                editDsf.ShowDialog(this);
                break;

            case ActionPackageType.act_bg:
                BgForm editBgf = new BgForm(true, editPack.argsDict["id"].valueExp,
                                            editPack.argsDict["filename"].valueExp, editPack.argsDict["ro"].valueExp);
                editBgf.ShowDialog(this);
                break;

            case ActionPackageType.act_var:
                VarForm editVf = new VarForm(true, editPack.argsDict["opLeft"].valueExp,
                                             editPack.argsDict["op"].valueExp, editPack.argsDict["opRight"].valueExp);
                editVf.ShowDialog(this);
                break;

            case ActionPackageType.act_if:
                IfForm editIff = new IfForm(true, Convert.ToBoolean(editPack.argsDict["?elseflag"].valueExp),
                                            editPack.argsDict["expr"].valueExp, editPack.argsDict["op1"].valueExp,
                                            editPack.argsDict["opr"].valueExp, editPack.argsDict["op2"].valueExp);
                editIff.ShowDialog(this);
                break;

            case ActionPackageType.act_switch:
                SwitchesForm editSwf = new SwitchesForm("开关操作", true,
                                                        editPack.argsDict["id"].valueExp, editPack.argsDict["dash"].valueExp);
                editSwf.ShowDialog(this);
                break;

            //case ActionPackageType.act_bgm:
            //    MusicForm editBgmf = new MusicForm("插入音乐", 0, true);
            //    editBgmf.ShowDialog(this);
            //    break;
            default:
                MessageBox.Show(@"该项目不支持编辑");
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// 按钮:显示背景
        /// </summary>
        private void button7_Click(object sender, EventArgs e)
        {
            BgForm bf = new BgForm(false);

            bf.ShowDialog(this);
        }