Still in the TileEngine.bas...
Go to Engien_Init_GUI
Find This:
Code:
t = DataPath & "Skins\" & CurrentSkin & ".dat"
Add this below that:
Code:
'Load Furnace Menu
With GameWindow.FurnaceMenu
If LoadCustomPos Then
.Screen.X = Val(Var_Get(t, "FURNACEMENU", "ScreenX"))
.Screen.Y = Val(Var_Get(t, "FURNACEMENU", "ScreenY"))
.Locked = CBool(Var_Get(t, "FURNACEMENU", "Locked"))
Else
.Screen.X = Val(Var_Get(s, "FURNACEMENU", "ScreenX"))
.Screen.Y = Val(Var_Get(s, "FURNACEMENU", "ScreenY"))
.Locked = CBool(Var_Get(s, "FURNACEMENU", "Locked"))
End If
.Screen.Width = Val(Var_Get(s, "FURNACEMENU", "ScreenWidth"))
.Screen.Height = Val(Var_Get(s, "FURNACEMENU", "ScreenHeight"))
Engine_Init_Grh .SkinGrh, Val(Var_Get(s, "FURNACEMENU", "Grh"))
End With
With GameWindow.FurnaceMenu.IronBar
.X = Val(Var_Get(s, "FURNACEMENU", "IronBarX"))
.Y = Val(Var_Get(s, "FURNACEMENU", "IronBarY"))
.Width = Val(Var_Get(s, "FURNACEMENU", "IronBarWidth"))
.Height = Val(Var_Get(s, "FURNACEMENU", "IronBarHeight"))
End With
'Load Anvil Menu
With GameWindow.AnvilMenu
If LoadCustomPos Then
.Screen.X = Val(Var_Get(t, "ANVILMENU", "ScreenX"))
.Screen.Y = Val(Var_Get(t, "ANVILMENU", "ScreenY"))
.Locked = CBool(Var_Get(t, "ANVILMENU", "Locked"))
Else
.Screen.X = Val(Var_Get(s, "ANVILMENU", "ScreenX"))
.Screen.Y = Val(Var_Get(s, "ANVILMENU", "ScreenY"))
.Locked = CBool(Var_Get(s, "ANVILMENU", "Locked"))
End If
.Screen.Width = Val(Var_Get(s, "ANVILMENU", "ScreenWidth"))
.Screen.Height = Val(Var_Get(s, "ANVILMENU", "ScreenHeight"))
Engine_Init_Grh .SkinGrh, Val(Var_Get(s, "ANVILMENU", "Grh"))
Engine_Init_Grh .SelectGrh, Val(Var_Get(s, "ANVILMENU", "SelectGrh"))
End With
With GameWindow.AnvilMenu.IronBar
.X = Val(Var_Get(s, "ANVILMENU", "IronBarX"))
.Y = Val(Var_Get(s, "ANVILMENU", "IronBarY"))
.Width = Val(Var_Get(s, "ANVILMENU", "IronBarWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "IronBarHeight"))
End With
With GameWindow.AnvilMenu.Shuriken
.X = Val(Var_Get(s, "ANVILMENU", "ShurikenX"))
.Y = Val(Var_Get(s, "ANVILMENU", "ShurikenY"))
.Width = Val(Var_Get(s, "ANVILMENU", "ShurikenWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "ShurikenHeight"))
End With
With GameWindow.AnvilMenu.Dagger
.X = Val(Var_Get(s, "ANVILMENU", "DaggerX"))
.Y = Val(Var_Get(s, "ANVILMENU", "DaggerY"))
.Width = Val(Var_Get(s, "ANVILMENU", "DaggerWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "DaggerHeight"))
End With
With GameWindow.AnvilMenu.Shield
.X = Val(Var_Get(s, "ANVILMENU", "ShieldX"))
.Y = Val(Var_Get(s, "ANVILMENU", "ShieldY"))
.Width = Val(Var_Get(s, "ANVILMENU", "ShieldWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "ShieldHeight"))
End With
With GameWindow.AnvilMenu.Armor
.X = Val(Var_Get(s, "ANVILMENU", "ArmorX"))
.Y = Val(Var_Get(s, "ANVILMENU", "ArmorY"))
.Width = Val(Var_Get(s, "ANVILMENU", "ArmorWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "ArmorHeight"))
End With
With GameWindow.AnvilMenu.Create
.X = Val(Var_Get(s, "ANVILMENU", "CreateX"))
.Y = Val(Var_Get(s, "ANVILMENU", "CreateY"))
.Width = Val(Var_Get(s, "ANVILMENU", "CreateWidth"))
.Height = Val(Var_Get(s, "ANVILMENU", "CreateHeight"))
End With
Now go to Engine_Render_GUI_Window
After "Select Case WindowIndex" add this:
Code:
Case FurnaceWindow
With GameWindow.FurnaceMenu
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue
'---------- Added by Adam Britt; Detect if user clicks on "X" --------------
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 136, .Screen.Y + 1, 12, 11) Then
If MouseLeftDown > 0 And Not LastClickedWindow = 0 Then
ShowGameWindow(LastClickedWindow) = 0
LastClickedWindow = 0
Exit Sub
End If
End If
'---------- Added by Adam Britt; Detect if user clicks on "Lock" --------------
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 126, .Screen.Y + 1, 10, 12) Then
If MouseLeftDown > 0 And Not LastClickedWindow = 0 Then
GameWindow.FurnaceMenu.Locked = Not GameWindow.FurnaceMenu.Locked
Exit Sub
End If
End If
End With
Case AnvilWindow
With GameWindow.AnvilMenu
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue
Dim MetalSelect As Rectangle
Dim ItemSelect As Rectangle
Dim ItemRow As Integer
Dim ItemCol As Integer
MetalSelect.X = .Screen.X + 2
MetalSelect.Y = .Screen.Y + 24 + ((.Metal - 1) * 40)
ItemRow = Round((.Item / 6) + 0.5)
ItemCol = .Item - ((ItemRow - 1) * 6)
ItemSelect.X = .Screen.X + 44 + ((ItemCol - 1) * 42)
ItemSelect.Y = .Screen.Y + 24 + ((ItemRow - 1) * 40)
Engine_Render_Grh .SelectGrh, ItemSelect.X, ItemSelect.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue
Engine_Render_Grh .SelectGrh, MetalSelect.X, MetalSelect.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue
'---------- Added by Adam Britt; Detect if user clicks on "X" --------------
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 284, .Screen.Y + 2, 12, 11) Then
If MouseLeftDown > 0 And Not LastClickedWindow = 0 Then
ShowGameWindow(LastClickedWindow) = 0
LastClickedWindow = 0
Exit Sub
End If
End If
'---------- Added by Adam Britt; Detect if user clicks on "Lock" --------------
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 272, .Screen.Y + 2, 10, 12) Then
If MouseLeftDown > 0 And Not LastClickedWindow = 0 Then
GameWindow.AnvilMenu.Locked = Not GameWindow.AnvilMenu.Locked
Exit Sub
End If
End If
End With
Then go to "Engine_Render_Char" and in there find "If CharList(CharIndex).Moving Then". Now go to the "End If" of the If Statement. Above it add this:
Code:
ElseIf CharList(CharIndex).ActionIndex > 1 Then
CharList(CharIndex).Body.Attack(CharList(CharIndex).Heading).Started = 1
Almost forgot, go back to the Engine_Render_Screen and find this:
Code:
'Calculate the particle offset values
'Do NOT move this any farther down in the module or you will get "jumps" as the left/top borders on particles
ParticleOffsetX = (Engine_PixelPosX(ScreenMinX) - PixelOffsetX)
ParticleOffsetY = (Engine_PixelPosY(ScreenMinY) - PixelOffsetY)
and above it add this:
Code:
AcceptEffects = True
Open TCP.bas
Find "Data_Server_EraseChar" and replace it with this:
Code:
Sub Data_Server_EraseChar(ByRef rBuf As DataBuffer)
'************************************************************
'Erase a character by the character index
'<CharIndex(I)>
'More info: http://www.vbgore.com/GameClient.TCP.Data_Server_EraseChar
'************************************************************
Dim MakeBlood As Byte
Dim CharIndex As Integer
CharIndex = rBuf.Get_Integer
MakeBlood = rBuf.Get_Byte
'Check to make blood
If MakeBlood <> 0 Then Effect_BloodSplatter_Begin Engine_TPtoSPX(CharList(CharIndex).Pos.X), Engine_TPtoSPY(CharList(CharIndex).Pos.Y), 20 + Rnd * 40
'Erase the character
Engine_Char_Erase CharIndex
End Sub
now add this new sub:
Code:
Sub Data_User_OpenJobMenu(ByRef rBuf As DataBuffer)
'************************************************************
'Open Job Menu
'************************************************************
Dim Job As Byte
'Get Job Menu
Job = rBuf.Get_Byte
'Render Menu
Select Case Job
Case 1 'Furnace
'show options for metal bars to smelt
HideShowWindow (FurnaceWindow)
Case 2 'Anvil
'shwo options for items to smith
GameWindow.AnvilMenu.Item = 1 'Set Default Selection
GameWindow.AnvilMenu.Metal = 1 'Set Default Metal
HideShowWindow (AnvilWindow)
End Select
End Sub
Ok, more is still coming!