Attribute VB_Name = "GlobalVariables"
Option Explicit

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Global variables.
' (Terrible thing to do I know, but they make life so easy!)
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'01/15/2003 Chris Hill  These directory standards will be changed for 4.0
Global g_cLOGDIR         As String
Global g_cMAPDIR         As String
Global g_cPORTRAITSDIR   As String
Global g_cONLINEREFDIR   As String
Global g_cSOUNDDIR       As String
Global g_cHELPDIR        As String
Global g_cPLAYERDIR      As String
Global g_cBACKUPDIR      As String
Global g_cDATADIR        As String
Global g_cEMOTESDIR      As String
Global g_cSYSGRAPHICSDIR As String
Global g_cDNDONLINEDIR   As String
Global Const g_cGRAPHICFILTER As String = "BitMaps (*.BMP)|*.BMP|All Files (*.*)|*.*"
Global Const g_cSOUNDFILTER   As String = "Wave (*.WAV)|*.WAV|All Files (*.*)|*.*"

'12/17/2002 Chris Hill  This is for Steve's Single Weapon Prof.
Global Const g_cSINGLEWEAPPROF As String = "Single Weapon Proficiency"

'11/25/2002 Chris Hill  This is the character we use to seperate proficiencies in our DB
Global Const g_cPROFNUMSEPERATOR As String = "<!>"
Global Const g_cPROFSEPERATOR As String = "<S>"
Global Const g_cLANGSEPERATOR As String = "<S>"

'This is the macro seperator for items
Public Const m_cITEMMACROSEP As String = "<IM ö>"

'08/06/2002 Chris Hill  This is a list of Macro events
Global Const g_cMACROEVENTS_NONE                As String = ""
Global Const g_cMACROEVENTS_FUNCTION            As String = "<FUNCTION>"
Global Const g_cMACROEVENTS_COMBATBEGINS        As String = "Event_CombatBegins()"
Global Const g_cMACROEVENTS_COMBATENDS          As String = "Event_CombatEnds()"
Global Const g_cMACROEVENTS_PLAYERJOINSCHAT     As String = "Event_PlayerJoinsChat(sPlayersName)"
Global Const g_cMACROEVENTS_RECEIVEDIM          As String = "Event_ReceivedIM(sCharFrom)"
Global Const g_cMACROEVENTS_NEXTCOMBATROUND     As String = "Event_NextCombatRound(nRound)"
    Global Const g_cMACROEVENTS_ROLLATTACK_NAME As String = "Event_RollAttack"
Global Const g_cMACROEVENTS_ROLLATTACK          As String = g_cMACROEVENTS_ROLLATTACK_NAME & "(sAttackText)"
    Global Const g_cMACROEVENTS_ROLLINIT_NAME   As String = "Event_RollInit"
Global Const g_cMACROEVENTS_ROLLINIT            As String = g_cMACROEVENTS_ROLLINIT_NAME & "(sInitText,nInitRolled)"
    Global Const g_cMACROEVENTS_ROLLSTAT_NAME   As String = "Event_RollStat"
Global Const g_cMACROEVENTS_ROLLSTAT            As String = g_cMACROEVENTS_ROLLSTAT_NAME & "(sStatName,nStatScore,sStatRollText)"

'05/10/2002 Chris Hill  This mocked up GUID is to allow us to uniquely identify the DM minion.
Global Const g_cDMMINIONGUID As String = "<DM_MINION:48434.73,7056,1>"

'06/06/2002 Chris Hill  We can't set this check box until we are connected to the network.
'So the new stratagy is to set this temporary bool and then set the checkbox after we connect.
Global g_bIWantToBeDMWhenIConnectToNetwork As Boolean

'TCPIP Info
Global Const g_cSTARTINGPORT As Long = 3470 'Port that you start trying to connect to

'DND variables
Global g_nMyNumber As Long
Global g_bAmIHost As Boolean
Global g_nWhoIsDM As Long 'This is where I keep track of who is the DM
Global g_nRound As Long

'Minions I have.  Minions are characters that don't get saved.  Most characterists
'of a character dont exist for minions.  For example spells and experiance.
Global g_colMinions As New Collection
Global g_oClasses As New clsClasses
Global g_oMacros As New clsMacros
Global g_oOldMacros As New clsFI_Querys
Global g_oPlayers As New Collection
Global g_oTables As New clsTables
Global g_oEmotes As clsEmotes
Global g_oErrors As New clsFOTAErrors

'Message constants for transmitted code  üü
Global Const g_cHasTypedCode            As String = "<HasTypedCode Å>"
Global Const g_cStoppedTypingCode       As String = "<StoppedTypingCode è>"
Global Const g_cSendMsgCode             As String = "<SendMsgCode å>"
Global Const g_cQuitChatCode            As String = "<QuitChatCode ƒ>"
Global Const g_cSendChatMsgCode         As String = "<SendChatMsgCode ±>"
Global Const g_cInviteToChatCode        As String = "<InviteToChatCode Ä>"
Global Const g_cJoinChatCode            As String = "<JoinChatCode ô>"
'DM control messages
Global Const g_cIAmTheDMCode            As String = "<IAmTheDMCode Ñ>"
Global Const g_cIAmNotTheDMCode         As String = "<IAmNotTheDMCode Ç>"
Global Const g_cBroadcastCode           As String = "<BroadcastCode Ü>"
Global Const g_cAckRequestCode          As String = "<AckRequestCode à>"
Global Const g_cAckReplyCode            As String = "<AckReplyCode ¿>"
'Character Stat messages
Global Const g_cSerizlizedCharacterCode As String = "<PlayerAllStatsCode É>"
Global Const g_cSerizlizedMinionCode    As String = "<MinionAllStatsCode ÿ>"
Global Const g_cKillMinionCode          As String = "<KillMinionCode Ç>"
Global Const g_cKillCharacterCode       As String = "<KillCharacterCode â>"
Global Const g_cGiveItemCode            As String = "<GiveItemCode É>"
Global Const g_cGiveExpCode             As String = "<GiveExpCode ë>"
'BattleMap messages
Global Const g_cLoadBMCode              As String = "<LoadBMCode ö>"
Global Const g_cUpdateBMPeiceCode       As String = "<UpdateBMPeiceCode É>"
Global Const g_cBeginCombatCode         As String = "<BeginCombatCode û>"
Global Const g_cEndCombatCode           As String = "<EndCombatCode ä>"
Global Const g_cNextRoundCode           As String = "<NextRoundCode ù>"
Global Const g_cUpdateBMDrawCode        As String = "<UpdateBMDrawCode è>"
Global Const g_cDelBMDrawCode           As String = "<DelBMDrawCode å>"
Global Const g_cCloseBMCode             As String = "<CloseBMCode ç>"
Global Const g_cBMSizeChangeCode        As String = "<BMSizeChangeCode æ>"
'Minion messages
Global Const g_cWhenMinionsAttackCode   As String = "<WhenMinionsAttackCode »>"
'Overland map system
Global Const g_cUpdatedOverlandMapCode  As String = "<UpdatedOverlandMapCode ê>"
Global Const g_cPartyUpdatedOverlandMapCode  As String = "<PartyUpdatedOverlandMapCode à>"
'Combat Map messages
Global Const g_cStartCMCode             As String = "<StartCMCode ï>"
Global Const g_cCMUpdateCode            As String = "<CMUpdateCode Ö>"
Global Const g_cCMUpdateItemCode        As String = "<CMUpdateItemCode è>"
Global Const g_cCMRemoveItemCode        As String = "<CMRemoveItemCode é>"
Global Const g_cCMMapUpdateRequestCode  As String = "<CMMapUpdateRequestCode ë>"
Global Const g_cCharInitCode            As String = "<CharInitCode ä>"
Global Const g_cInitCheckCode           As String = "<InitCheckCode â>"



'Database Access Information
Global g_oDB As ADODB.Connection
Global g_bDebugOn As Boolean

'This is the name we logged in as
Global g_sPreLoginName As String
'This is the file of the DB we opened so we can back it up
Global g_sBackupFileName As String

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Options
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Global g_sLastLoadedChar As String
Global g_bAlwaysLoadChar As Boolean
Global g_bSupressColors As Boolean
Global g_bSupressFonts As Boolean
Global g_bBroadcastTyping As Boolean
Global g_nYouTypeDelay As Long
Global g_nTheyListenDelay As Long
Global g_bAutoAttackIM As Boolean
Global g_bAutoAttackAutoDamage As Boolean
Global g_bStartWithHiddenCharSheet As Boolean
Global g_bShowAllLabels As Boolean

'Your font Suppress information
Global g_oFontSuppress As New StdFont
Global g_nFontSuppressColor As Long
'Your font name information
Global g_oFontName As New StdFont
Global g_nFontNameColor As Long
'The default font
Global g_oFontDefault As New StdFont
Global g_nFontDefaultColor As Long
'The Announcement font
Global g_oFontAnnouncement As New StdFont
Global g_nFontAnnouncementColor As Long

'Save variables
Global g_bSave As Boolean
'Global g_sWhereToSave As String
Global g_nReplayXLines As Long '08/28/2002 Chris Hill  Replay variables
Global g_bBackupDB As Boolean '09/03/2002 Chris Hill  Backup the DB?

'Sound variables
Global g_bSound_Sound As Boolean
Global g_sSound_SendSound As String
Global g_sSound_ReceiveSound As String
Global g_sSound_EnterSound As String
Global g_sSound_ExitSound As String

'Chat Room options
Global g_nChatRoom_LinesInChat As Long
Global g_bChatRoom_ShowCharNames As Boolean
Global g_bChatRoom_BugFixForceScroll As Boolean
Global g_bChatRoom_InstallNewFonts As Boolean
Global g_bChatRoom_MinimumMacroButtonSize As Boolean

'Spellcasting options
Global g_nCast_FilterDefault As Long
Global g_sCast_LevelDefault As String
Global g_bCast_Mage As Boolean
Global g_bCast_Priest As Boolean
Global g_bCast_AutoSend As Boolean
Global g_bCast_MarkOff As Boolean
Global g_nCast_SortColumn As Long

'DM Item screen options
Global g_bDMItems_AutomaticallyUpdate As Boolean

'Verchange last ver loaded
Global g_sVerChangeLastLoaded As String

'BattleMap Options
Global g_bBM_HideLabelInformation As Boolean

'CM Options
Global g_bCM_ShowMiniNames As Boolean
Global g_bCM_KeepAspectRatios As Boolean
Global g_nCM_FOWBrushSize As Long
Global g_bCM_FOWTransparent As Boolean
Global g_bCM_FOWShowTerrain As Boolean
    

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'API calls
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Declare Function GetFocus Lib "USER32" () As Long
Declare Function APISetFocus Lib "USER32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Declare Function SetWindowRgn Lib "USER32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long

Declare Function GetForegroundWindow Lib "USER32" () As Long
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Declare Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Declare Function PostMessage Lib "USER32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Global Const WM_QUIT = &H12

Declare Function SetWindowPos Lib "USER32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2
Global Const SWP_NOMOVE = &H2
Global Const SWP_NOSIZE = &H1

'Combat map stuff
Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Declare Function GetDC Lib "USER32" (ByVal hwnd As Long) As Long
Declare Function GetDesktopWindow Lib "USER32" () As Long
Declare Function ReleaseDC Lib "USER32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
