Option Strict Off
Option Explicit On
Friend Class MonsterDropEditor
	Inherits System.Windows.Forms.Form
	'UPGRADE_WARNING: Arrays can't be declared with New. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC9D3AE5-6B95-4B43-91C7-28276302A5E8"'
    Private MonsterDrops() As monsterdrop = ADGEDotNetUt.ArrayUt(Of monsterdrop).NewArray1(40)
	Public selectedMonsterDrop As Short
	Public subchange As Boolean
	
    Public Sub init()
        Dim i As Short

        MonsterDropList.Items.Clear()

        For i = 1 To 40
            MonsterDrops(i).word0 = App.graphics.f559.monsterdrop(i).word0
            MonsterDropList.Items.Add(zerostr(i - 1, 2)).SubItems.Add("")
        Next

        For i = 1 To 11
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Dragon"
        Next
        For i = 12 To 15
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Worm"
        Next
        For i = 16 To 18
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Screamer"
        Next
        For i = 19 To 21
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Hellhound"
        Next
        For i = 22 To 26
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Rockpile"
        Next
        For i = 27 To 33
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Knight"
        Next
        For i = 34 To 35
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Antman"
        Next
        For i = 36 To 37
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Stone Golem"
        Next
        For i = 38 To 40
            'UPGRADE_WARNING: Couldn't resolve default property of object MonsterDropList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            MonsterDropList.Items(i - 1).SubItems(1).Text = "Skeleton"
        Next

        CBItem.Items.Clear()
        CBItem.Items.Add(Str(0) & " -")
        For i = 2 To 180
            CBItem.Items.Add(Str(i - 1) & " " & App.graphics.f556.objstring(App.graphics.f559.obj(i).ItemType + 1))
        Next
        selectMonsterDrop(1)
    End Sub
	
    Public Sub selectMonsterDrop(ByVal num As Short)
        selectedMonsterDrop = num

        MonsterDropList.Items(selectedMonsterDrop - 1).Focused = True
        MyUt.CheckSel(MonsterDropList, selectedMonsterDrop - 1, "BlueGem")
        Item.Text = Str(MonsterDrops(num).itemnum)
        SometimesDropped.CheckState = MonsterDrops(num).sometimes
        If MonsterDrops(num).itemnum >= 0 And MonsterDrops(num).itemnum <= 180 Then
            CBItem.SelectedIndex = MonsterDrops(num).itemnum
        Else
            CBItem.SelectedIndex = 0
        End If
    End Sub
	
	'UPGRADE_WARNING: Event CBItem.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub CBItem_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBItem.SelectedIndexChanged
		
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		MonsterDrops(selectedMonsterDrop).set_itemnum((CBItem.SelectedIndex))
		Item.Text = Str(MonsterDrops(selectedMonsterDrop).itemnum)
		
		subchange = False
	End Sub
	
	
	'UPGRADE_WARNING: Event SometimesDropped.CheckStateChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub SometimesDropped_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles SometimesDropped.CheckStateChanged
		
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		MonsterDrops(selectedMonsterDrop).set_sometimes((SometimesDropped.CheckState))
		subchange = False
	End Sub
	
	
	'UPGRADE_WARNING: Event Item.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Item_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Item.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		MonsterDrops(selectedMonsterDrop).set_itemnum(App.EFChange16(Item, 0, 32767))
		If MonsterDrops(selectedMonsterDrop).itemnum >= 0 And MonsterDrops(selectedMonsterDrop).itemnum <= 180 Then
			CBItem.SelectedIndex = MonsterDrops(selectedMonsterDrop).itemnum
		Else
			CBItem.SelectedIndex = 0
		End If
		
		subchange = False
	End Sub
	
    Private Sub Cancel_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cancel.Click
        Hide()

    End Sub
	
	
    Private Sub MonsterDropList_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MonsterDropList.SelectedIndexChanged
        If MonsterDropList.FocusedItem Is Nothing Then Exit Sub
        selectMonsterDrop(MonsterDropList.FocusedItem.Index + 1)
    End Sub
	
	
    Private Sub Ok_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Ok.Click
        Dim i As Integer
        For i = 1 To 40
            App.graphics.f559.monsterdrop(i).word0 = MonsterDrops(i).word0
        Next
        App.graphics.f559.update()
        Hide()
    End Sub

    Private Sub MonsterDropEditor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MonsterDropList.SmallImageList = App.JewelIL
    End Sub
End Class