VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "file561"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'// Start of graphic 0x231
'  btn Buttons18936[5];   // swapped when read
'  btn Buttons18876[4];   //    ""      ...
'  btn Buttons18828[3];   //    ""      ...
'  btn Buttons18792[2];   //    ""      ...
'  btn Buttons18768[5];   //    ""      ...
'  btn Buttons18708[4];   //    ""      ...
'  btn Buttons18660[3];   //    ""      ...
'  btn Buttons18624[2]; //      ""    ...
' all above = editable

'  i8  Byte18600[8];    // RectPos swapped when read        ...
'  i8  Byte18592[8];    // RectPos swapped when read        ...
'  i8  Byte18584[8];    // RectPos swapped when read        ...
'  i8  Byte18576[8];    // RectPos swapped when read        ...
'  i16 Word18568[4];    // deltax[dir] NESW swapped when read        ...
'  i16 Word18560[4];    // deltay[dir] NESW swapped when read         ...
'  i16 Word18552[28];   // Swapped when read.  Magic buttons???         ...
'  MOVEBUTN MoveButn18496[4]; // MF, MR, MB, ML Swapped when read
'  ui8 DropAreas[16];//18464 X andY in screen coordinates
'  i8  Byte18448[8];     // KeyXlate swapped when read        ...
'  i8  Byte18440[12];    //  KeyXlate swapped when read        ...
'  KeyXlate Byte18428[7];//  KeyXlate swapped when read        ...
'  i8  Byte18400[28];    //  KeyXlate swapped when read

' all below = editable
'  btn Buttons18372[4];  //
'  btn Buttons18324[9];  // Swapped when read... chest buttons
'  btn Buttons18216[13]; // Swapped when read
'  btn Buttons18060[9];  // Swapped when read
'  btn Buttons17952[5];  // Swapped when read
'  btn Buttons17892[5];  // Swapped when read
'  btn Buttons17832[3];  // Swapped when read         ...
'  btn Buttons17796[3];  // Swapped when read  [864-4*12]
'  btn Buttons17760[38]; // Swapped when read
'  btn Buttons17304[9];  // Swapped when read         ...
'  btn Buttons17196[20]; // Swapped when read         ...
'  btn Buttons16956[2];  // Swapped when read         ...
'  btn Buttons16932[4];  // Swapped when read
'                        // End of graphic 0x231


Public itemdata As String
Public itemloc As Long

Private csbbuttons(152) As New csbbutton
Private byte18600(228) As Byte




Public Function csbbutton(ByVal X As Integer) As csbbutton
    Set csbbutton = csbbuttons(X)
End Function



Function read_byte() As Byte
    read_byte = AscB(MidB(itemdata, itemloc, 1))
    itemloc = itemloc + 1
End Function

Function read_int() As Long
    Dim b1, b2 As Byte
    Dim l1 As Long
    b2 = read_byte
    b1 = read_byte
    read_int = b2
    read_int = read_int * 256
    read_int = read_int + b1
End Function

Function write_byte(num As Byte)
    itemdata = itemdata + ChrB(num)
    itemloc = itemloc + 1
End Function
Function write_int(num As Long)
    Dim b1, b2 As Byte
    Dim l1 As Long
    l1 = num And &HFF00
    b1 = l1 / &H100
    b2 = num And &HFF
    write_byte (b1)
    write_byte (b2)
End Function



Public Sub read()
    Dim i, j As Integer
    
    itemloc = 1

    '28 dialog buttons
    For i = 1 To 28
        csbbuttons(i).word0 = read_int
        csbbuttons(i).x1 = read_int
        csbbuttons(i).x2 = read_int
        csbbuttons(i).y1 = read_int
        csbbuttons(i).y2 = read_int
        csbbuttons(i).button = read_int
    Next
    
    For i = 1 To 228
        byte18600(i) = read_byte
    Next
    
    '124 game buttons
    For i = 1 To 124
        csbbuttons(i + 28).word0 = read_int
        csbbuttons(i + 28).x1 = read_int
        csbbuttons(i + 28).x2 = read_int
        csbbuttons(i + 28).y1 = read_int
        csbbuttons(i + 28).y2 = read_int
        csbbuttons(i + 28).button = read_int
    Next
    
    initcsbbuttonnames
End Sub



Public Sub update()
    Dim i, j As Integer
    
    itemdata = ""
    itemloc = 1
    
    For i = 1 To 28
        write_int csbbuttons(i).word0
        write_int csbbuttons(i).x1
        write_int csbbuttons(i).x2
        write_int csbbuttons(i).y1
        write_int csbbuttons(i).y2
        write_int csbbuttons(i).button
    Next
    
    For i = 1 To 228
        write_byte byte18600(i)
    Next
    
    For i = 1 To 124
        write_int csbbuttons(i + 28).word0
        write_int csbbuttons(i + 28).x1
        write_int csbbuttons(i + 28).x2
        write_int csbbuttons(i + 28).y1
        write_int csbbuttons(i + 28).y2
        write_int csbbuttons(i + 28).button
    Next

    graphics.setgitemsize 561, LenB(itemdata)
    graphics.setgitemdata 561, itemdata
End Sub


Public Sub initcsbbuttonnames()

    Dim i As Integer
    Dim nodescription As String
    
    nodescription = ""
    i = 1
    csbbuttons(i).name = "Top left dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top right dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower left dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower right dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower left dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower right dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Bottom dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Bottom dialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top left minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top right minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower left minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower right minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower left minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower right minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Bottom minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Bottom minidialog button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Ressurect hero button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Reincarnate hero button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Cancel hero button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 3"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 4"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 5"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 6"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 7"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Chest item 8"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 name"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 name"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 name"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 name"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 left hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 right hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 left hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 right hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 left hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 right hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 left hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 right hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 3"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 4"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 5"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell rune 6"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Cast spell"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Delete rune"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 attack"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 attack"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 attack"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 attack"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Cancel attack"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Attack 1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Attack 2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Attack 3"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? full screen"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? full screen"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? viewport"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? viewport"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? full screen"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv Save button"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv Sleep"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv cancel"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv left hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv right hand"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv head"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv chest"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv legs"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv feet"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv pouch 2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv Mouth"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv eye"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv quiver 2,1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv quiver 1,2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv quiver 2,2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv necklace"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv pouch 1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv quiver 1,1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,1"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,3"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,4"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,5"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,6"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,7"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,8"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 2,9"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,2"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,3"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,4"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,5"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,6"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,7"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,8"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv backpack 1,9"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Inv lower right box ??"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move turn left"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move forward"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move turn right"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move left"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move back"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Move right"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? viewport"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? near full screen"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 face"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 face"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 face"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 face"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top left player"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Top right player"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower right player"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Lower left player"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 section"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 section"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 section"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 section"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 1 bars"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 2 bars"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 3 bars"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Player 4 bars"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Spell area"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Attack area"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? lower left dot"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "?? inventory status bottom"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Entrance enter dungeon"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Entrance resume"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Entrance credits"
    csbbuttons(i).description = nodescription
    i = i + 1
    csbbuttons(i).name = "Unused"
    csbbuttons(i).description = nodescription
End Sub
