VERSION 5.00
Begin VB.Form frmCharAnim 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Character Animations"
   ClientHeight    =   3135
   ClientLeft      =   4290
   ClientTop       =   2700
   ClientWidth     =   6045
   Icon            =   "frmCharAnim.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3135
   ScaleWidth      =   6045
   Begin VB.CommandButton Command2 
      Caption         =   "Show Character"
      Height          =   255
      Left            =   3120
      TabIndex        =   8
      Top             =   2760
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Hide Character"
      Height          =   255
      Left            =   1440
      TabIndex        =   7
      Top             =   2760
      Width           =   1455
   End
   Begin VB.CommandButton cmdInsert 
      Caption         =   "&Insert"
      Height          =   360
      Left            =   4680
      TabIndex        =   6
      Top             =   360
      Visible         =   0   'False
      Width           =   1170
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "Exit"
      Height          =   360
      Left            =   4680
      TabIndex        =   5
      Top             =   1800
      Width           =   1170
   End
   Begin VB.CommandButton cmdStop 
      Caption         =   "S&top"
      Height          =   360
      Left            =   4680
      TabIndex        =   4
      Top             =   1320
      Width           =   1170
   End
   Begin VB.CommandButton cmdPlay 
      Caption         =   "&Play"
      Height          =   360
      Left            =   4680
      TabIndex        =   3
      Top             =   840
      Width           =   1170
   End
   Begin VB.Frame AnimationFrame 
      Caption         =   "Animations"
      Height          =   2355
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   4155
      Begin VB.ListBox AnimationListBox 
         Height          =   1620
         Left            =   90
         Sorted          =   -1  'True
         TabIndex        =   2
         Top             =   240
         Width           =   3900
      End
      Begin VB.CheckBox OutputStyleOption 
         Caption         =   "Play sound &effects"
         Height          =   330
         Left            =   120
         TabIndex        =   1
         Top             =   1950
         Value           =   1  'Checked
         Width           =   1725
      End
   End
End
Attribute VB_Name = "frmCharAnim"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Virtual Hypnotist
'©2003-2008 FollowTheWatch Software
'http://vhypno.sourceforge.net
'http://sourceforge.net/projects/vhypno
'Contact - followthewatch55@yahoo.com

'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or (at your option) any later version.

'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'GNU General Public License for more details.

'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Option Explicit
Public InsertCmd As Boolean

Private Sub AnimationListBox_DblClick()
Call cmdPlay_Click
End Sub

Private Sub cmdExit_Click()
Me.Hide
End Sub

Private Sub cmdInsert_Click()
If OutputStyleOption.value = 1 Then ScriptMaker.TextAdd = "<anim> " + AnimationListBox.List(AnimationListBox.ListIndex) + ", true" + vbCrLf
If OutputStyleOption.value = 0 Then ScriptMaker.TextAdd = "<anim> " + AnimationListBox.List(AnimationListBox.ListIndex) + ", false" + vbCrLf
Me.Hide
End Sub

Private Sub cmdPlay_Click()
'play animation
Char.Show
Char.Stop
Char.Play AnimationListBox.List(AnimationListBox.ListIndex)
End Sub

Private Sub cmdStop_Click()
Char.Stop
End Sub

Private Sub Command1_Click()
Char.Hide
End Sub

Private Sub Command2_Click()
Char.Show
End Sub

Private Sub Form_Activate()
Char.Show
If Char.SoundEffectsOn = True Then
    OutputStyleOption.value = 1
Else
    OutputStyleOption.value = 0
End If

'update caption
AnimationFrame.Caption = "&Animations for " + Char.Name

'load animation list
AnimationListBox.Clear
Dim AnimationName As Variant
For Each AnimationName In Char.AnimationNames
        AnimationListBox.AddItem AnimationName
Next

If AnimationListBox.ListCount > 0 Then
    AnimationListBox.ListIndex = 0
    cmdPlay.Enabled = True
Else
    cmdPlay.Enabled = False
End If

cmdInsert.Visible = InsertCmd
End Sub

Private Sub Form_Load()
Me.Left = (ScreenX / 2) - (Me.Width / 2)
Me.top = (ScreenY / 2) - (Me.Height / 2)
End Sub

Private Sub OutputStyleOption_Click()
If OutputStyleOption.value = False Then
    Char.SoundEffectsOn = True
Else
    Char.SoundEffectsOn = False
End If
End Sub

