Status Window
From VbGORE Visual Basic Online RPG Engine
Contents |
Introduction
I noticed some people had problems adding an Experience Percent Bar in their game (including myself), so I thought I would make a more detailed Tutorial for it. This tutorial will also show how to add a Health Percent Bar, and a MANA bar.
Here is a screenshot of the final product.
Adding the Grh
First, we need to add the Grh we're going to use for the Status window, where the Status bars will be in. here's an example you can use:
NOTE: be sure to make the width and height of the GUI sizes capable of 2, or else your Window will look much uglier ingame. (Example: the width of the window above is 256, the height is 128.)
Save this Grh into your Grh folder, and call it 150.PNG (Or a number you haven't used yet, you can see your next free number by opening ToolFreeNumber, located in your vbGORE folder, and see the numbers under Free Grh Files (XXX.PNG))
Now go to youre vbGORE folder and open up Data2. then open up the GrhRaw.txt. Now add the following at the end of the list:
<vb> Grh43=1-150-0-0-<Width>-<Height> </vb> The 'Grh43' can be changed to any number you havent used yet. To know what the next number is you haven't used yet open ToolFreeNumber, and see the numbers under Free Grh Values (Grh1.raw)
<Width> is the width of your window, so change that to the width of your window. <Heigth> is the height of your window, so change that to the height of your window. So in my case it's:
<vb> Grh43=1-150-0-0-256-128 </vb>
When you have done all things above, run ToolGrhDatMaker.
Skins
Now, we need to add the window to the skin. Go to your vbGORE folder, go to Data folder, then open up Skins and then open up Bluewave.ini. Add this at the bottom of the page:
<vb> [STATUS] ScreenX=2 ScreenY=2 ScreenWidth=256 ScreenHeight=128 Grh=43 </vb>
Now change the ScreenX to the X position where you want to have youre Status Window placed, and change the ScreenY to the Y position where you want to have youre Status Window placed. Change the ScreenWidth to the width of your window, and change the ScreenHeight to the height of your window. And at last change the Grh to the Grh ID you have given your window, in my case 43.
Now Save this and go back to the Data/Skins, and open up Bluewave.dat. You can open this by opening it with Notepad. Add this at the bottom of the page:
<vb> [STATUS] ScreenX=2 ScreenY=2 </vb>
Again change the ScreenX to the X position you want to have your window, and the ScreenY to the Y position you want to have your window. (Must be the same as in bluewave.ini)
Editing the Client
Now open up GameClient.vbp and search(Ctrl + F) for:
<vb> Public Type GameWindow 'List of all the different game windows
QuickBar As WindowQuickBar
Inventory As WindowInventory
Shop As WindowInventory
Mailbox As WindowMailbox
ViewMessage As WindowMessage
WriteMessage As WindowMessage
Amount As WindowAmount
Menu As WindowMenu
ChatWindow As ChatWindow
StatWindow As StatWindow
Bank As WindowInventory
NPCChat As WindowNPCChat
Trade As TradeWindow
</vb>
Replace that with:
<vb> Public Type GameWindow 'List of all the different game windows
QuickBar As WindowQuickBar
Inventory As WindowInventory
Shop As WindowInventory
Mailbox As WindowMailbox
ViewMessage As WindowMessage
WriteMessage As WindowMessage
Amount As WindowAmount
Menu As WindowMenu
ChatWindow As ChatWindow
StatWindow As StatWindow
Bank As WindowInventory
NPCChat As WindowNPCChat
Trade As TradeWindow
Status As StatusWindow
</vb>
Now find:
<vb> 'Info about the trade window Public Type TradeWindow
Screen As Rectangle User1Name As Rectangle User2Name As Rectangle Trade1(1 To 9) As Rectangle Trade2(1 To 9) As Rectangle Gold1 As Rectangle Gold2 As Rectangle Accept As Rectangle Trade As Rectangle Cancel As Rectangle SkinGrh As Grh
End Type </vb>
Under add (after the End Type):
<vb> Public Type StatusWindow
Screen As Rectangle SkinGrh As Grh
End Type </vb>
Ok, now search for:
<vb> 'Important: Windows are ordered by priority, where 1 = highest! Public Const AmountWindow As Byte = 1 Public Const MenuWindow As Byte = 2 Public Const NPCChatWindow As Byte = 3 Public Const TradeWindow As Byte = 4 Public Const WriteMessageWindow As Byte = 5 Public Const ViewMessageWindow As Byte = 6 Public Const MailboxWindow As Byte = 7 Public Const InventoryWindow As Byte = 8 Public Const ShopWindow As Byte = 9 Public Const BankWindow As Byte = 10 Public Const StatWindow As Byte = 11 Public Const ChatWindow As Byte = 12 Public Const QuickBarWindow As Byte = 13 Public Const NumGameWindows As Byte = 13 </vb>
Replace that code with:
<vb> 'Important: Windows are ordered by priority, where 1 = highest! Public Const AmountWindow As Byte = 1 Public Const MenuWindow As Byte = 2 Public Const NPCChatWindow As Byte = 3 Public Const TradeWindow As Byte = 4 Public Const WriteMessageWindow As Byte = 5 Public Const ViewMessageWindow As Byte = 6 Public Const MailboxWindow As Byte = 7 Public Const InventoryWindow As Byte = 8 Public Const ShopWindow As Byte = 9 Public Const BankWindow As Byte = 10 Public Const StatWindow As Byte = 11 Public Const ChatWindow As Byte = 12 Public Const QuickBarWindow As Byte = 13 Public Const StatusWindow As Byte = 14 Public Const NumGameWindows As Byte = 14 </vb>
Now search for Public Sub Engine_Init_GUI and go down, then you will see this:
<vb> 'Load skin GUI data 'More info: http://www.vbgore.com/GameClient.TileEngine.Engine_Init_GUI '************************************************************ Dim ImageOffsetX As Long Dim ImageOffsetY As Long Dim ImageSpaceX As Long Dim ImageSpaceY As Long Dim LoopC As Long Dim s As String 'Stores the path to our master skins file (.ini) Dim t As String 'Stores the path to our custom window positions file (.dat) Dim X As Long Dim Y As Long
s = DataPath & "Skins\" & CurrentSkin & ".ini" t = DataPath & "Skins\" & CurrentSkin & ".dat"
</vb>
After that code, add this:
<vb>
'Load Status
With GameWindow.Status
.Screen.X = Val(Var_Get(t, "STATUS", "ScreenX"))
.Screen.Y = Val(Var_Get(t, "STATUS", "ScreenY"))
.Screen.Width = Val(Var_Get(s, "STATUS", "ScreenWidth"))
.Screen.Height = Val(Var_Get(s, "STATUS", "ScreenHeight"))
Engine_Init_Grh .SkinGrh, Val(Var_Get(s, "STATUS", "Grh"))
End With
</vb>
Now we need to render the window, search for:
<vb> Private Sub Engine_Render_GUI_Window </vb>
Then find:
<vb> Select Case WindowIndex </vb>
Under that add:
<vb>
Case StatusWindow
With GameWindow.Status
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 46, (BaseStats(SID.EXP) / BaseStats(SID.ELU)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, EXPCOLOR, EXPCOLOR, EXPCOLOR, 0, False Engine_Render_Text Font_Default, BaseStats(SID.EXP) & "/" & BaseStats(SID.ELU), .Screen.X + 34, .Screen.Y + 44, -1
End With
</vb>
Explanation:
<vb> Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue</vb>
This line is for showing the window the Experience Percent Bar is in. Without this line you'll only see the bar and the text.
<vb> Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 46, (BaseStats(SID.EXP) / BaseStats(SID.ELU)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, EXPCOLOR, EXPCOLOR, EXPCOLOR, 0, False</vb>
This line adds the bar, that shows how much exp you have. .Screen.Y + : The number after the "+" is the Y position of the bar. .Screen.X + : The number after the "+" is the X position of the bar.
EXPCOLOR: this is the color of the Experience percent bar. Change this to a number with a "-" in front of it. ( without the " ", so like -16776961 ) Else you can't see the Exp Bar.
<vb> Engine_Render_Text Font_Default, BaseStats(SID.EXP) & "/" & BaseStats(SID.ELU), .Screen.X + 34, .Screen.Y + 44, -1</vb>
This line adds the text, that says how much exp you have, and how much you still need. .Screen.Y + : The number after the "+" is the Y position of the text. .Screen.X + : The number after the "+" is the X position of the text.
Okay, so that is what the window does. Now we go further with the code.
find:
<vb> Function Input_Mouse_LeftClick_Window</vb>
Go a bit down, and then you'll see this:
<vb> Select Case WindowIndex</vb>
Under add:
<vb> Case StatusWindow
If ShowGameWindow(StatusWindow) Then
With GameWindow.Status
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X, .Screen.Y, .Screen.Width, .Screen.Height) Then
Input_Mouse_LeftClick_Window = 1
LastClickedWindow = StatusWindow
SelGameWindow = StatusWindow
End If
End With
End If
</vb>
Now we need to make the Window dragable ( If you dont want that people can drag it around skip this part) First search for:
<vb> Input_Mouse_Move()</vb>
Go a bit down and you'll see:
<vb> Select Case SelGameWindow</vb>
Under that add:
<vb> Case StatusWindow
With GameWindow.Status.Screen
.X = .X + MousePosAdd.X
.Y = .Y + MousePosAdd.Y
If WindowsInScreen Then
If .X < 0 Then .X = 0
If .Y < 0 Then .Y = 0
If .X > ScreenWidth - .Width Then .X = ScreenWidth - .Width
If .Y > ScreenHeight - .Height Then .Y = ScreenHeight - .Height
End If
End With</vb>
Finally, to show the window ingame, find this:
<vb> 'Hide/show windows</vb>
And replace this (wich is under 'Hide/show windows):
<vb> If Input_Keys_IsPressed(KeyDefinitions.InventoryWindow, KeyCode) Then
If ShowGameWindow(InventoryWindow) Then
ShowGameWindow(InventoryWindow) = 0
If LastClickedWindow = InventoryWindow Then LastClickedWindow = 0
Else
ShowGameWindow(InventoryWindow) = 1
LastClickedWindow = InventoryWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.QuickBarWindow, KeyCode) Then
If ShowGameWindow(QuickBarWindow) Then
ShowGameWindow(QuickBarWindow) = 0
If LastClickedWindow = QuickBarWindow Then LastClickedWindow = 0
Else
ShowGameWindow(QuickBarWindow) = 1
LastClickedWindow = QuickBarWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.ChatWindow, KeyCode) Then
If ShowGameWindow(ChatWindow) Then
ShowGameWindow(ChatWindow) = 0
If LastClickedWindow = ChatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(ChatWindow) = 1
LastClickedWindow = ChatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.StatWindow, KeyCode) Then
If ShowGameWindow(StatWindow) Then
ShowGameWindow(StatWindow) = 0
If LastClickedWindow = StatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(StatWindow) = 1
LastClickedWindow = StatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.MenuWindow, KeyCode) Then
If ShowGameWindow(MenuWindow) Then
ShowGameWindow(MenuWindow) = 0
If LastClickedWindow = MenuWindow Then LastClickedWindow = 0
Else
ShowGameWindow(MenuWindow) = 1
LastClickedWindow = MenuWindow
End If
End If
</vb>
With this:
<vb> If Input_Keys_IsPressed(KeyDefinitions.InventoryWindow, KeyCode) Then
If ShowGameWindow(InventoryWindow) Then
ShowGameWindow(InventoryWindow) = 0
If LastClickedWindow = InventoryWindow Then LastClickedWindow = 0
Else
ShowGameWindow(InventoryWindow) = 1
LastClickedWindow = InventoryWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.QuickBarWindow, KeyCode) Then
If ShowGameWindow(QuickBarWindow) Then
ShowGameWindow(QuickBarWindow) = 0
If LastClickedWindow = QuickBarWindow Then LastClickedWindow = 0
Else
ShowGameWindow(QuickBarWindow) = 1
LastClickedWindow = QuickBarWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.ChatWindow, KeyCode) Then
If ShowGameWindow(ChatWindow) Then
ShowGameWindow(ChatWindow) = 0
If LastClickedWindow = ChatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(ChatWindow) = 1
LastClickedWindow = ChatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.StatWindow, KeyCode) Then
If ShowGameWindow(StatWindow) Then
ShowGameWindow(StatWindow) = 0
If LastClickedWindow = StatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(StatWindow) = 1
LastClickedWindow = StatWindow
End If
End If
ShowGameWindow(StatusWindow) = 1
LastClickedWindow = StatusWindow
If Input_Keys_IsPressed(KeyDefinitions.MenuWindow, KeyCode) Then
If ShowGameWindow(MenuWindow) Then
ShowGameWindow(MenuWindow) = 0
If LastClickedWindow = MenuWindow Then LastClickedWindow = 0
Else
ShowGameWindow(MenuWindow) = 1
LastClickedWindow = MenuWindow
End If
End If
</vb>
Now we still need to do one thing: make the window visible when the game starts. Find this:
<vb> 'Set scroll pixels per frame </vb>
And under that add:
<vb> ShowGameWindow(StatusWindow) = 1</vb>
Now you have a Status window in your game!
Optional: Health Percent Bar
When you add this code a HP Bar will be added in the Status window.
Go to this code (the code you had to add in the tutorial above):
<vb>
Case StatusWindow
With GameWindow.Status
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 46, (BaseStats(SID.EXP) / BaseStats(SID.ELU)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, EXPCOLOR, EXPCOLOR, EXPCOLOR, 0, False Engine_Render_Text Font_Default, BaseStats(SID.EXP) & "/" & BaseStats(SID.ELU), .Screen.X + 34, .Screen.Y + 44, -1
End With</vb>
And add this code at the bottom of the code above, but above End With:
<vb>
Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 14, (BaseStats(SID.MinHP) / ModStats(SID.MaxHP)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, HPCOLOR, HPCOLOR, HPCOLOR, 0, False
Engine_Render_Text Font_Default, BaseStats(SID.MinHP) & "/" & ModStats(SID.MaxHP), .Screen.X + 34, .Screen.Y + 12, -1</vb>
Explanation:
<vb> Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 14, (BaseStats(SID.MinHP) / ModStats(SID.MaxHP)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, HPCOLOR, HPCOLOR, HPCOLOR, 0, False</vb>
This line adds the bar, that shows how much Health you have. .Screen.Y + : The number after the "+" is the Y position of the bar. .Screen.X + : The number after the "+" is the X position of the bar.
HPCOLOR : This is the color of the Health percent bar. Change this to a number with a "-" in front of it . ( without the " ", so like -2818048 ) Else you can't see the HP Bar.
<vb> Engine_Render_Text Font_Default, BaseStats(SID.MinHP) & "/" & ModStats(SID.MaxHP), .Screen.X + 34, .Screen.Y + 12, -1</vb>
This line adds the text, that says how much exp you have, and how much you still need. .Screen.Y + : The number after the "+" is the Y position of the text. .Screen.X + : The number after the "+" is the X position of the text.
Optional: MANA Bar
When you add this code a MANA Bar will be added in the Status window.
Go to this code (the code you have added in the tutorial above):
<vb>
Case StatusWindow
With GameWindow.Status
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 46, (BaseStats(SID.EXP) / BaseStats(SID.ELU)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, EXPCOLOR, EXPCOLOR, EXPCOLOR, 0, False Engine_Render_Text Font_Default, BaseStats(SID.EXP) & "/" & BaseStats(SID.ELU), .Screen.X + 34, .Screen.Y + 44, -1
End With</vb>
And add this code at the bottom of the code above, but above End With:
<vb> Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 30, (BaseStats(SID.MinMAN) / ModStats(SID.MaxMAN)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, MANACOLOR, MANACOLOR, MANACOLOR, 0, False Engine_Render_Text Font_Default, BaseStats(SID.MinMAN) & "/" & ModStats(SID.MaxMAN), .Screen.X + 34, .Screen.Y + 28, -1</vb>
If you added the HP bar too, add the code under the code of the HP bar.
Explanation:
<vb> Engine_Render_Rectangle .Screen.X + 28, .Screen.Y + 30, (BaseStats(SID.MinMAN) / ModStats(SID.MaxMAN)) * 141, 11, 1, 1, 1, 1, 1, 1, 0, 0, 1, MANACOLOR, MANACOLOR, MANACOLOR, 0, False</vb>
This line adds the bar, that shows how much MANA you have. .Screen.Y + : The number after the "+" is the Y position of the bar. .Screen.X + : The number after the "+" is the X position of the bar.
MANACOLOR: this is the color of the MANA percent bar. Change this to a number with a "-" in front of it. ( without the " ", so like -200 ) Else you can't see the MANA Bar.
<vb> Engine_Render_Text Font_Default, BaseStats(SID.MinMAN) & "/" & ModStats(SID.MaxMAN), .Screen.X + 34, .Screen.Y + 28, -1</vb>
This line adds the text, that says how much MANA you have, and how much you still need. .Screen.Y + : The number after the "+" is the Y position of the text. .Screen.X + : The number after the "+" is the X position of the text.
End
I hope this tutorial helped. This is my first tutorial, so if you have questions or comments please reply to this. If you found bugs or mistakes I made tell me, I haven't tested it since I already added a Status window. :)
By:Tharsten
Adding Hotkeys
I just wanted to add on to this great tutorial!!! This section covers adding hotkeys to the Status Window. Since all the other windows have hotkeys to open and close them, it is only natural that you would want a hotkey for a newly made window
To start off, we need to add a key definition
Search for:
<vb> Private Type KeyDefinitions
MiniMap As Integer PickUpObj As Integer QuickBar(1 To 12) As Integer Attack As Integer ChatBufferUp As Integer ChatBufferDown As Integer InventoryWindow As Integer QuickBarWindow As Integer ChatWindow As Integer StatWindow As Integer MenuWindow As Integer ZoomIn As Integer ZoomOut As Integer MoveNorth As Integer MoveEast As Integer MoveSouth As Integer MoveWest As Integer ResetGUI As Integer QuickTarget As Integer QuickReply As Integer
</vb>
Under that add:
<vb>
StatusWindow As Integer
</vb>
Now search for Public Sub Input_Keys_LoadDefinitions() and go down, then you will see this:
<vb> Dim i As Long
KeyDefinitions.Attack = Val(Var_Get(DataPath & "Game.ini", "INPUT", "Attack"))
KeyDefinitions.ChatBufferDown = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatBufferDown"))
KeyDefinitions.ChatBufferUp = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatBufferUp"))
KeyDefinitions.ChatWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatWindow"))
KeyDefinitions.InventoryWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "InventoryWindow"))
KeyDefinitions.MenuWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MenuWindow"))
KeyDefinitions.MiniMap = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MiniMap"))
KeyDefinitions.MoveEast = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveEast"))
KeyDefinitions.MoveNorth = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveNorth"))
KeyDefinitions.MoveSouth = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveSouth"))
KeyDefinitions.MoveWest = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveWest"))
KeyDefinitions.PickUpObj = Val(Var_Get(DataPath & "Game.ini", "INPUT", "PickUpObj"))
KeyDefinitions.QuickBarWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickBarWindow"))
KeyDefinitions.StatWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "StatWindow"))
KeyDefinitions.ZoomIn = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ZoomIn"))
KeyDefinitions.ZoomOut = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ZoomOut"))
KeyDefinitions.ResetGUI = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ResetGUI"))
KeyDefinitions.QuickTarget = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickTarget"))
KeyDefinitions.QuickReply = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickReply"))
For i = 1 To 12
KeyDefinitions.QuickBar(i) = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickBar" & i))
Next i
</vb>
And replace it with this:
<vb> Dim i As Long
KeyDefinitions.Attack = Val(Var_Get(DataPath & "Game.ini", "INPUT", "Attack"))
KeyDefinitions.ChatBufferDown = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatBufferDown"))
KeyDefinitions.ChatBufferUp = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatBufferUp"))
KeyDefinitions.ChatWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ChatWindow"))
KeyDefinitions.InventoryWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "InventoryWindow"))
KeyDefinitions.MenuWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MenuWindow"))
KeyDefinitions.MiniMap = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MiniMap"))
KeyDefinitions.MoveEast = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveEast"))
KeyDefinitions.MoveNorth = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveNorth"))
KeyDefinitions.MoveSouth = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveSouth"))
KeyDefinitions.MoveWest = Val(Var_Get(DataPath & "Game.ini", "INPUT", "MoveWest"))
KeyDefinitions.PickUpObj = Val(Var_Get(DataPath & "Game.ini", "INPUT", "PickUpObj"))
KeyDefinitions.QuickBarWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickBarWindow"))
KeyDefinitions.StatWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "StatWindow"))
KeyDefinitions.ZoomIn = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ZoomIn"))
KeyDefinitions.ZoomOut = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ZoomOut"))
KeyDefinitions.ResetGUI = Val(Var_Get(DataPath & "Game.ini", "INPUT", "ResetGUI"))
KeyDefinitions.QuickTarget = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickTarget"))
KeyDefinitions.QuickReply = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickReply"))
KeyDefinitions.StatusWindow = Val(Var_Get(DataPath & "Game.ini", "INPUT", "StatusWindow"))
For i = 1 To 12
KeyDefinitions.QuickBar(i) = Val(Var_Get(DataPath & "Game.ini", "INPUT", "QuickBar" & i))
Next i
</vb>
Go to this code (the code you had to add in the tutorial above):
<vb> If Input_Keys_IsPressed(KeyDefinitions.InventoryWindow, KeyCode) Then
If ShowGameWindow(InventoryWindow) Then
ShowGameWindow(InventoryWindow) = 0
If LastClickedWindow = InventoryWindow Then LastClickedWindow = 0
Else
ShowGameWindow(InventoryWindow) = 1
LastClickedWindow = InventoryWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.QuickBarWindow, KeyCode) Then
If ShowGameWindow(QuickBarWindow) Then
ShowGameWindow(QuickBarWindow) = 0
If LastClickedWindow = QuickBarWindow Then LastClickedWindow = 0
Else
ShowGameWindow(QuickBarWindow) = 1
LastClickedWindow = QuickBarWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.ChatWindow, KeyCode) Then
If ShowGameWindow(ChatWindow) Then
ShowGameWindow(ChatWindow) = 0
If LastClickedWindow = ChatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(ChatWindow) = 1
LastClickedWindow = ChatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.StatWindow, KeyCode) Then
If ShowGameWindow(StatWindow) Then
ShowGameWindow(StatWindow) = 0
If LastClickedWindow = StatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(StatWindow) = 1
LastClickedWindow = StatWindow
End If
End If
ShowGameWindow(StatusWindow) = 1
LastClickedWindow = StatusWindow
If Input_Keys_IsPressed(KeyDefinitions.MenuWindow, KeyCode) Then
If ShowGameWindow(MenuWindow) Then
ShowGameWindow(MenuWindow) = 0
If LastClickedWindow = MenuWindow Then LastClickedWindow = 0
Else
ShowGameWindow(MenuWindow) = 1
LastClickedWindow = MenuWindow
End If
End If
</vb>
And replace it with this:
<vb> If Input_Keys_IsPressed(KeyDefinitions.InventoryWindow, KeyCode) Then
If ShowGameWindow(InventoryWindow) Then
ShowGameWindow(InventoryWindow) = 0
If LastClickedWindow = InventoryWindow Then LastClickedWindow = 0
Else
ShowGameWindow(InventoryWindow) = 1
LastClickedWindow = InventoryWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.QuickBarWindow, KeyCode) Then
If ShowGameWindow(QuickBarWindow) Then
ShowGameWindow(QuickBarWindow) = 0
If LastClickedWindow = QuickBarWindow Then LastClickedWindow = 0
Else
ShowGameWindow(QuickBarWindow) = 1
LastClickedWindow = QuickBarWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.ChatWindow, KeyCode) Then
If ShowGameWindow(ChatWindow) Then
ShowGameWindow(ChatWindow) = 0
If LastClickedWindow = ChatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(ChatWindow) = 1
LastClickedWindow = ChatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.StatWindow, KeyCode) Then
If ShowGameWindow(StatWindow) Then
ShowGameWindow(StatWindow) = 0
If LastClickedWindow = StatWindow Then LastClickedWindow = 0
Else
ShowGameWindow(StatWindow) = 1
LastClickedWindow = StatWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.StatusWindow, KeyCode) Then
If ShowGameWindow(StatusWindow) Then
ShowGameWindow(StatusWindow) = 0
If LastClickedWindow = StatusWindow Then LastClickedWindow = 0
Else
ShowGameWindow(StatusWindow) = 1
LastClickedWindow = StatusWindow
End If
End If
If Input_Keys_IsPressed(KeyDefinitions.MenuWindow, KeyCode) Then
If ShowGameWindow(MenuWindow) Then
ShowGameWindow(MenuWindow) = 0
If LastClickedWindow = MenuWindow Then LastClickedWindow = 0
Else
ShowGameWindow(MenuWindow) = 1
LastClickedWindow = MenuWindow
End If
End If
</vb>
Now Save this and go to the Data/Game.ini file. Add this line to the bottom of the page right under QuickReply=82
<vb> StatusWindow=KEYINPUT </vb>
KEYINPUT: this determines the hotkey. Change this to a number corresponding to the hotkey you want to use. ( so like 8276 to use CTRL + T)
Notes:
You can only change this hotkey from Game.ini, since it is not added to GameConfig. If anyone knows how to add this option to GameConfig, please post the tutorial!
Once your are done editing GameClient.vbp make sure you compile it to a .exe
So that's it!!! This was my first tutorial, hope you can find it useful!!
By:Martin
