Todo mundo sabe como o paperdoll funciona não é? Então vamos ao que interessa...
Parte 1: Paperdoll Comum
*Siga essa parte se vc quer colocar paperdoll na sua CS:DE
TUDO NO CLIENT SIDE
No modDirectX8
ache: Sub GDIRenderChar
Abaixo da sub inteira adicione isso:
Na: Sub DrawPlayer
Procure por:
Abaixo disso adicione:
Abaixo da DrawPlayer sub adicione isso:
Na Sub DrawGDI
Procure por:
Abaixo adicione:
Pronto! agora vc tem paperdoll no seu projeto!
PARTE 2: PAPERDOLL BASEADO NO GÊNERO
*Se vc quer o paperdoll baseado no gênero, siga a primeira parte primeiro, e depois esta.
SERVER SIDE:
No modServerTCP
Procure por:
Abaixo do Buffer.WriteLong GetPlayerStat(index, i) adicione:
No modPlayer adicione isso no final:
CLIENT SIDE
No modDirectX8
Perto do topo do módulo, ache isso:
e troque por isso:
Ache:
E troque por isso:
Na EngineCacheTextures ache:
E troque por essa:
Troque a Sub GDIRenderPaperdoll por esse:
Na Sub DrawPlayer Procure por essa linha:
E troque por essa:
No modTypes
Na Private Type PlayerRec procure por:
abaixo adicione:
Troque a Sub DrawPaperdoll por essa aki:
No modDatabase adicione isso bem no final:
No modHandleData
na Sub HandlePlayerData ache:
e abaixo adicione:
Prontinhu!
CREDITOS:
DJMaxus por criar
Eu por traduzir e trazer pra vcs
Parte 1: Paperdoll Comum
*Siga essa parte se vc quer colocar paperdoll na sua CS:DE
TUDO NO CLIENT SIDE
No modDirectX8
ache: Sub GDIRenderChar
Abaixo da sub inteira adicione isso:
- Código:
' Paperdoll show up in item editor
Public Sub GDIRenderPaperdoll(ByRef picBox As PictureBox, ByVal Sprite As Long)
Dim height As Long, Width As Long, sRECT As RECT
' exit out if doesn't exist
If Sprite <= 0 Or Sprite > Count_Paperdoll Then Exit Sub
height = 32
Width = 32
sRECT.top = 0
sRECT.bottom = sRECT.top + height
sRECT.left = 0
sRECT.Right = sRECT.left + Width
' Start Rendering
Call D3DDevice8.Clear(0, ByVal 0, D3DCLEAR_TARGET, 0, 1#, 0)
Call D3DDevice8.BeginScene
RenderTexture Tex_Paperdoll(Sprite), 0, 0, 0, 0, Width, height, Width, height
' Finish Rendering
Call D3DDevice8.EndScene
Call D3DDevice8.Present(sRECT, ByVal 0, picBox.hwnd, ByVal 0)
End Sub
Na: Sub DrawPlayer
Procure por:
- Código:
RenderTexture Tex_Char(Sprite), ConvertMapX(x), ConvertMapY(y), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height
Abaixo disso adicione:
- Código:
' check for paperdolling
For i = 1 To UBound(PaperdollOrder)
If GetPlayerEquipment(Index, PaperdollOrder(i)) > 0 Then
If Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll > 0 Then
Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
End If
End If
Next
Abaixo da DrawPlayer sub adicione isso:
- Código:
Public Sub DrawPaperdoll(ByVal x2 As Long, ByVal y2 As Long, ByVal Sprite As Long, ByVal Anim As Long, ByVal spritetop As Long)
Dim rec As GeomRec
If Sprite < 1 Or Sprite > Count_Paperdoll Then Exit Sub
With rec
.top = spritetop * (D3DT_TEXTURE(Tex_Paperdoll(Sprite)).height / 4)
.height = (D3DT_TEXTURE(Tex_Paperdoll(Sprite)).height / 4)
.left = Anim * (D3DT_TEXTURE(Tex_Paperdoll(Sprite)).Width / 4)
.Width = (D3DT_TEXTURE(Tex_Paperdoll(Sprite)).Width / 4)
End With
' Clip to screen
If y2 < 0 Then
With rec
.top = .top - y2
End With
y2 = 0
End If
If x2 < 0 Then
With rec
.left = .left - x2
End With
x2 = 0
End If
RenderTexture Tex_Paperdoll(Sprite), ConvertMapX(x2), ConvertMapY(y2), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height
End Sub
Na Sub DrawGDI
Procure por:
- Código:
GDIRenderItem frmEditor_Item.picItem, frmEditor_Item.scrlPic.value
Abaixo adicione:
- Código:
GDIRenderPaperdoll frmEditor_Item.picPaperdoll, frmEditor_Item.scrlPaperdoll.value
Pronto! agora vc tem paperdoll no seu projeto!
PARTE 2: PAPERDOLL BASEADO NO GÊNERO
*Se vc quer o paperdoll baseado no gênero, siga a primeira parte primeiro, e depois esta.
SERVER SIDE:
No modServerTCP
Procure por:
- Código:
For i = 1 To Stats.Stat_Count - 1
Buffer.WriteLong GetPlayerStat(index, i)
Next
Abaixo do Buffer.WriteLong GetPlayerStat(index, i) adicione:
- Código:
Buffer.WriteLong GetPlayerSex(index)
No modPlayer adicione isso no final:
- Código:
Function GetPlayerSex(ByVal index As Long) As Long
If index <= 0 Or index > MAX_PLAYERS Then Exit Function
GetPlayerSex = Player(index).Sex
End Function
CLIENT SIDE
No modDirectX8
Perto do topo do módulo, ache isso:
- Código:
Public Tex_Paperdoll() As Long
e troque por isso:
- Código:
Public Tex_Paperdoll_M() As Long
Public Tex_Paperdoll_F() As Long
Ache:
- Código:
Public Const Path_Paperdoll As String = "\data files\graphics\paperdolls\"
E troque por isso:
- Código:
Public Const Path_Paperdoll_M As String = "\data files\graphics\paperdolls\male\"
Public Const Path_Paperdoll_F As String = "\data files\graphics\paperdolls\female\"
Na EngineCacheTextures ache:
- Código:
' Paperdoll Textures
Count_Paperdoll = 1
Do While FileExist(App.path & Path_Paperdoll & Count_Paperdoll & ".png")
ReDim Preserve Tex_Paperdoll(0 To Count_Paperdoll)
Tex_Paperdoll(Count_Paperdoll) = SetTexturePath(App.path & Path_Paperdoll & Count_Paperdoll & ".png")
Count_Paperdoll = Count_Paperdoll + 1
Loop
Count_Paperdoll = Count_Paperdoll - 1
E troque por essa:
- Código:
' Male Paperdoll Textures
Count_Paperdoll = 1
Do While FileExist(App.Path & Path_Paperdoll_M & Count_Paperdoll & ".png")
ReDim Preserve Tex_Paperdoll_M(0 To Count_Paperdoll)
Tex_Paperdoll_M(Count_Paperdoll) = SetTexturePath(App.Path & Path_Paperdoll_M & Count_Paperdoll & ".png")
Count_Paperdoll = Count_Paperdoll + 1
Loop
Count_Paperdoll = Count_Paperdoll - 1
' Female Paperdoll Textures
Count_Paperdoll = 1
Do While FileExist(App.Path & Path_Paperdoll_F & Count_Paperdoll & ".png")
ReDim Preserve Tex_Paperdoll_F(0 To Count_Paperdoll)
Tex_Paperdoll_F(Count_Paperdoll) = SetTexturePath(App.Path & Path_Paperdoll_F & Count_Paperdoll & ".png")
Count_Paperdoll = Count_Paperdoll + 1
Loop
Count_Paperdoll = Count_Paperdoll - 1
Troque a Sub GDIRenderPaperdoll por esse:
- Código:
' Paperdoll show up in item editor
Public Sub GDIRenderPaperdoll(ByRef picBox As PictureBox, ByVal Sprite As Long)
Dim height As Long, Width As Long, sRECT As RECT
' exit out if doesn't exist
If Sprite <= 0 Or Sprite > Count_Paperdoll Then Exit Sub
height = 32
Width = 32
sRECT.top = 0
sRECT.bottom = sRECT.top + height
sRECT.left = 0
sRECT.Right = sRECT.left + Width
' Start Rendering
Call D3DDevice8.Clear(0, ByVal 0, D3DCLEAR_TARGET, 0, 1#, 0)
Call D3DDevice8.BeginScene
RenderTexture Tex_Paperdoll_M(Sprite), 0, 0, 0, 0, Width, height, Width, height
' Finish Rendering
Call D3DDevice8.EndScene
Call D3DDevice8.Present(sRECT, ByVal 0, picBox.hwnd, ByVal 0)
End Sub
Na Sub DrawPlayer Procure por essa linha:
- Código:
Call DrawPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
E troque por essa:
- Código:
Call DrawPaperdoll(Index, x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
No modTypes
Na Private Type PlayerRec procure por:
- Código:
name As String
abaixo adicione:
- Código:
Sex As Byte
Troque a Sub DrawPaperdoll por essa aki:
- Código:
Public Sub DrawPaperdoll(ByVal index As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal Sprite As Long, ByVal Anim As Long, ByVal spritetop As Long)
Dim rec As GeomRec
Dim G_Paperdoll As Long
If Sprite < 1 Or Sprite > Count_Paperdoll Then Exit Sub
If GetPlayerSex(index) = SEX_MALE Then
G_Paperdoll = Tex_Paperdoll_M(Sprite)
Else
G_Paperdoll = Tex_Paperdoll_F(Sprite)
End If
With rec
.top = spritetop * (D3DT_TEXTURE(G_Paperdoll).height / 4)
.height = (D3DT_TEXTURE(G_Paperdoll).height / 4)
.left = Anim * (D3DT_TEXTURE(G_Paperdoll).Width / 4)
.Width = (D3DT_TEXTURE(G_Paperdoll).Width / 4)
End With
' Clip to screen
If y2 < 0 Then
With rec
.top = .top - y2
End With
y2 = 0
End If
If x2 < 0 Then
With rec
.left = .left - x2
End With
x2 = 0
End If
RenderTexture G_Paperdoll, ConvertMapX(x2), ConvertMapY(y2), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height
End Sub
No modDatabase adicione isso bem no final:
- Código:
Function GetPlayerSex(ByVal Index As Long) As Long
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If Index > MAX_PLAYERS Then Exit Function
GetPlayerSex = Player(Index).Sex
' Error handler
Exit Function
errorhandler:
HandleError "GetPlayerPK", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Function
End Function
Sub SetPlayerSex(ByVal Index As Long, ByVal Sex As Long)
' If debug mode, handle error then exit out
If Options.Debug = 1 Then On Error GoTo errorhandler
If Index > MAX_PLAYERS Then Exit Sub
Player(Index).Sex = Sex
' Error handler
Exit Sub
errorhandler:
HandleError "SetPlayerPK", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub
No modHandleData
na Sub HandlePlayerData ache:
- Código:
For x = 1 To Stats.Stat_Count - 1
SetPlayerStat i, x, Buffer.ReadLong
Next
e abaixo adicione:
- Código:
Call SetPlayerSex(i, Buffer.ReadLong)
Prontinhu!
CREDITOS:
DJMaxus por criar
Eu por traduzir e trazer pra vcs