VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsFocus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'-----------------------------------------------------
' MirageBot Config.Focus Class
' Written by Christopher Nevin (lancergli@gmail.com)
'-----------------------------------------------------

Option Explicit
Option Compare Text

Private B(16) As Boolean, FocusList As String, mFocusMax As Integer

Public ProfilePath As String, FocusPath As String

Private Const S As String = "Focus"
 
Public Function InList(ByVal Username As String) As Boolean
    Dim S() As String, I As Integer, t As String
    S = Split(FocusList, vbNewLine)
    Username = Suffix(Username)
    For I = 0 To UBound(S)
        t = Suffix(S(I))
        If Len(t) = Len(Username) Then
            If Username = t Then
                InList = True
                Exit For
            End If
        End If
    Next I
    Erase S
End Function

Public Sub Load()
    ClanEmote = IsYes(ReadINI(ProfilePath, S, "ClanEmote"))
    ClanSpeak = IsYes(ReadINI(ProfilePath, S, "ClanSpeak"))
    ClanWhisper = IsYes(ReadINI(ProfilePath, S, "ClanWhisper"))
    FriendEmote = IsYes(ReadINI(ProfilePath, S, "FriendEmote"))
    FriendSpeak = IsYes(ReadINI(ProfilePath, S, "FriendSpeak"))
    FriendWhisper = IsYes(ReadINI(ProfilePath, S, "FriendWhisper"))
    SafeEmote = IsYes(ReadINI(ProfilePath, S, "SafeEmote"))
    SafeSpeak = IsYes(ReadINI(ProfilePath, S, "SafeSpeak"))
    SafeWhisper = IsYes(ReadINI(ProfilePath, S, "SafeWhisper"))
    FreeEmote = IsYes(ReadINI(ProfilePath, S, "FreeEmote"))
    FreeSpeak = IsYes(ReadINI(ProfilePath, S, "FreeSpeak"))
    FreeWhisper = IsYes(ReadINI(ProfilePath, S, "FreeWhisper"))
    FocusClan = IsYes(ReadINI(ProfilePath, S, "FocusClan"))
    FocusFriend = IsYes(ReadINI(ProfilePath, S, "FocusFriend"))
    FocusSafe = IsYes(ReadINI(ProfilePath, S, "FocusSafe"))
    FocusFree = IsYes(ReadINI(ProfilePath, S, "FocusFree"))
    AutoFocus = IsYes(ReadINI(ProfilePath, S, "AutoFocus"))
    FocusList = ReadFile(FocusPath)
End Sub

Public Sub Save()
    ClanEmote = ClanEmote
    ClanSpeak = ClanSpeak
    ClanWhisper = ClanWhisper
    FriendEmote = FriendEmote
    FriendSpeak = FriendSpeak
    FriendWhisper = FriendWhisper
    SafeEmote = SafeEmote
    SafeSpeak = SafeSpeak
    SafeWhisper = SafeWhisper
    FreeEmote = FreeEmote
    FreeSpeak = FreeSpeak
    FreeWhisper = FreeWhisper
    FocusClan = FocusClan
    FocusFriend = FocusFriend
    FocusSafe = FocusSafe
    FocusFree = FocusFree
    AutoFocus = AutoFocus
    SaveFile FocusPath, FocusList
End Sub

Public Property Get ClanEmote() As Boolean
    ClanEmote = B(0)
End Property

Public Property Let ClanEmote(ByVal V As Boolean)
    B(0) = V
    WriteINI ProfilePath, S, "ClanEmote", YesNo(V)
End Property

Public Property Get ClanSpeak() As Boolean
    ClanSpeak = B(1)
End Property

Public Property Let ClanSpeak(ByVal V As Boolean)
    B(1) = V
    WriteINI ProfilePath, S, "ClanSpeak", YesNo(V)
End Property

Public Property Get ClanWhisper() As Boolean
    ClanWhisper = B(2)
End Property

Public Property Let ClanWhisper(ByVal V As Boolean)
    B(2) = V
    WriteINI ProfilePath, S, "ClanWhisper", YesNo(V)
End Property

Public Property Get FriendEmote() As Boolean
    FriendEmote = B(3)
End Property

Public Property Let FriendEmote(ByVal V As Boolean)
    B(3) = V
    WriteINI ProfilePath, S, "FriendEmote", YesNo(V)
End Property

Public Property Get FriendSpeak() As Boolean
    FriendSpeak = B(4)
End Property

Public Property Let FriendSpeak(ByVal V As Boolean)
    B(4) = V
    WriteINI ProfilePath, S, "FriendSpeak", YesNo(V)
End Property

Public Property Get FriendWhisper() As Boolean
    FriendWhisper = B(5)
End Property

Public Property Let FriendWhisper(ByVal V As Boolean)
    B(5) = V
    WriteINI ProfilePath, S, "FriendWhisper", YesNo(V)
End Property

Public Property Get SafeEmote() As Boolean
    SafeEmote = B(6)
End Property

Public Property Let SafeEmote(ByVal V As Boolean)
    B(6) = V
    WriteINI ProfilePath, S, "SafeEmote", YesNo(V)
End Property

Public Property Get SafeSpeak() As Boolean
    SafeSpeak = B(7)
End Property

Public Property Let SafeSpeak(ByVal V As Boolean)
    B(7) = V
    WriteINI ProfilePath, S, "SafeSpeak", YesNo(V)
End Property

Public Property Get SafeWhisper() As Boolean
    SafeWhisper = B(8)
End Property

Public Property Let SafeWhisper(ByVal V As Boolean)
    B(8) = V
    WriteINI ProfilePath, S, "SafeWhisper", YesNo(V)
End Property

Public Property Get FreeEmote() As Boolean
    FreeEmote = B(9)
End Property

Public Property Let FreeEmote(ByVal V As Boolean)
    B(9) = V
    WriteINI ProfilePath, S, "FreeEmote", YesNo(V)
End Property

Public Property Get FreeSpeak() As Boolean
    FreeSpeak = B(10)
End Property

Public Property Let FreeSpeak(ByVal V As Boolean)
    B(10) = V
    WriteINI ProfilePath, S, "FreeSpeak", YesNo(V)
End Property

Public Property Get FreeWhisper() As Boolean
    FreeWhisper = B(11)
End Property

Public Property Let FreeWhisper(ByVal V As Boolean)
    B(11) = V
    WriteINI ProfilePath, S, "FreeWhisper", YesNo(V)
End Property

Public Property Get FocusClan() As Boolean
    FocusClan = B(12)
End Property

Public Property Let FocusClan(ByVal V As Boolean)
    B(12) = V
    WriteINI ProfilePath, S, "FocusClan", YesNo(V)
End Property

Public Property Get FocusFriend() As Boolean
    FocusFriend = B(13)
End Property

Public Property Let FocusFriend(ByVal V As Boolean)
    B(13) = V
    WriteINI ProfilePath, S, "FocusFriend", YesNo(V)
End Property

Public Property Get FocusSafe() As Boolean
    FocusSafe = B(14)
End Property

Public Property Let FocusSafe(ByVal V As Boolean)
    B(14) = V
    WriteINI ProfilePath, S, "FocusSafe", YesNo(V)
End Property

Public Property Get FocusFree() As Boolean
    FocusFree = B(15)
End Property

Public Property Let FocusFree(ByVal V As Boolean)
    B(15) = V
    WriteINI ProfilePath, S, "FocusFree", YesNo(V)
End Property

Public Property Get AutoFocus() As Boolean
    AutoFocus = B(16)
End Property

Public Property Let AutoFocus(ByVal V As Boolean)
    B(16) = V
    WriteINI ProfilePath, S, "AutoFocus", YesNo(V)
End Property
