public void CreateTemplate(bool preview)
        {
            if (string.IsNullOrWhiteSpace(mainForm.textBox_CoreScriptTemplates_ObjectId.Text))
            {
                return;
            }

            uint   objectEntry = Convert.ToUInt32(mainForm.textBox_CoreScriptTemplates_ObjectId.Text);
            string previewText = preview ? "true" : "";

            switch (GetScriptType(mainForm.comboBox_CoreScriptTemplates_ScriptType.SelectedIndex))
            {
            case ScriptTypes.Creature:
            {
                CreatureScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies, ref previewText);
                break;
            }

            case ScriptTypes.Spell:
            {
                SpellScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies, ref previewText);
                break;
            }
            }

            this.mainForm.Core_script_creatore_preview.ResetText();
            this.mainForm.Core_script_creatore_preview.Text = previewText;
        }
Esempio n. 2
0
        public void CreateTemplate()
        {
            uint objectEntry = Convert.ToUInt32(mainForm.textBox_CoreScriptTemplates_Entry.Text);

            switch (GetScriptType(mainForm.comboBox_CoreScriptTemplates_ScriptType.SelectedIndex))
            {
            case ScriptTypes.Creature:
            {
                CreatureScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies);
                break;
            }

            case ScriptTypes.Spell:
            {
                SpellScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies);
                break;
            }

            case ScriptTypes.Aura:
            {
                AuraScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies);
                break;
            }

            case ScriptTypes.BossScript:
            {
                BossScriptTemplate.CreateTemplate(objectEntry, mainForm.listBox_CoreScriptTemplates_Hooks, mainForm.treeView_CoreScriptTemplates_HookBodies);
                break;
            }
            }
        }