This is both of my subs I have done no change to either
Code:
Public Sub SpellEditorInit()
On Error Resume Next
Dim I As Long
frmSpellEditor.cmbClassReq.AddItem "All Classes"
For I = 0 To Max_Classes
frmSpellEditor.cmbClassReq.AddItem Trim(Class(I).name)
Next I
frmSpellEditor.txtName.Text = Trim(Spell(EditorIndex).name)
frmSpellEditor.cmbClassReq.ListIndex = Spell(EditorIndex).ClassReq
frmSpellEditor.scrlLevelReq.Value = Spell(EditorIndex).LevelReq
frmSpellEditor.cmbType.ListIndex = Spell(EditorIndex).Type
If Spell(EditorIndex).Type <> SPELL_TYPE_GIVEITEM Then
frmSpellEditor.fraVitals.Visible = True
frmSpellEditor.fraGiveItem.Visible = False
frmSpellEditor.scrlVitalMod.Value = Spell(EditorIndex).Data1
Else
frmSpellEditor.fraVitals.Visible = False
frmSpellEditor.fraGiveItem.Visible = True
frmSpellEditor.scrlItemNum.Value = Spell(EditorIndex).Data1
frmSpellEditor.scrlItemValue.Value = Spell(EditorIndex).Data2
End If
If Spell(EditorIndex).Type = SPELL_TYPE_WARP Then
frmSpellEditor.fraVitals.Visible = False
frmSpellEditor.fraGiveItem.Visible = False
frmSpellEditor.fraWarp.Visible = True
frmSpellEditor.scrlMapNum.Value = Spell(EditorIndex).Data1
frmSpellEditor.scrlMapX.Value = Spell(EditorIndex).Data2
frmSpellEditor.scrlMapY.Value = Spell(EditorIndex).Data3
frmSpellEditor.lblMapNum.Caption = frmSpellEditor.scrlMapNum.Value
frmSpellEditor.lblMapX.Caption = frmSpellEditor.scrlMapX.Value
frmSpellEditor.lblMapY.Caption = frmSpellEditor.scrlMapY.Value
End If
frmSpellEditor.Show vbModal
End Sub
Code:
Public Sub SpellEditorOk()
Spell(EditorIndex).name = frmSpellEditor.txtName.Text
Spell(EditorIndex).ClassReq = frmSpellEditor.cmbClassReq.ListIndex
Spell(EditorIndex).LevelReq = frmSpellEditor.scrlLevelReq.Value
Spell(EditorIndex).Type = frmSpellEditor.cmbType.ListIndex
If Spell(EditorIndex).Type <> SPELL_TYPE_GIVEITEM Then
Spell(EditorIndex).Data1 = frmSpellEditor.scrlVitalMod.Value
Else
Spell(EditorIndex).Data1 = frmSpellEditor.scrlItemNum.Value
Spell(EditorIndex).Data2 = frmSpellEditor.scrlItemValue.Value
End If
Spell(EditorIndex).Data3 = 0
If Spell(EditorIndex).Type = SPELL_TYPE_WARP Then
Spell(EditorIndex).Data1 = frmSpellEditor.scrlMapNum.Value
Spell(EditorIndex).Data2 = frmSpellEditor.scrlMapX.Value
Spell(EditorIndex).Data3 = frmSpellEditor.scrlMapY.Value
End If
Call SendSaveSpell(EditorIndex)
InSpellEditor = False
Unload frmSpellEditor
End Sub