📄 drawscene.vb.svn-base
字号:
'### Visual Basic.NET and Direct X9 Legend of MiR Project ###'
'### Mir Unleashed Client Draw Scene Module ###'
'### http://www.lomcn.co.uk ###' '### Credits to TrueADM and DeathWish ###'
'The main draw scene. This will draw different buttons/textboxes etc. into the scenes such as the Login Scene, Select Character Scene and the Game Scenes.
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Module DrawScene
Public WarriorTicked As Boolean 'True/False to check if user ticked the Warrior Check Box (Create New Hero)
Public WizardTicked As Boolean 'True/False to check if user ticked the Wizard Check Box (Create New Hero)
Public TaoistTicked As Boolean 'True/False to check if user ticked the Taoist Check Box (Create New Hero)
Public MaleTicked As Boolean 'True/False to check if user ticked the Male Check Box (Create New Hero)
Public FemaleTicked As Boolean 'True/False to check if user ticked the Female Check Box (Create New Hero)
Public Sub DrawGameScene()
Dim I As Integer
DrawTileMap()
DrawGameLayers()
DrawActorNameText()
For I = 0 To 1000
If Player(I).Exist = True And Races.Player = Races.Player Then
DrawPlayerNameText(I)
End If
Next I
For I = 0 To 1000
If NPC(I).Exist = True And Races.Npc = Races.Npc Then
DrawNPCNameText(I)
End If
Next I
For I = 0 To 1000
If Mob(I).Exist = True And Races.Monster = Races.Monster Then
DrawMonsterNameText(I)
End If
Next I
For I = 0 To 1000
If FloorItem(I).Exist = True Then
DrawItemNameText(I)
End If
Next
End Sub
Public Sub DrawLoginScene()
GameSprite.Begin(SpriteFlags.AlphaBlend)
If LoginStage = LoginStageType.LOGIN Then 'Login Scene
DrawBackground(0) 'Scene Background
DrawButton(0) 'Close Game Button
If Not Window(2).Show = True Then
If Connected = True Then 'Check if client is connected
DrawTextbox(0) 'Account Name Box
DrawTextbox(1) 'Account Password Box
DrawButton(1) 'Create New Account Button
DrawButton(2) 'Change Password Button
DrawButton(3) 'Login Button
End If
End If
ElseIf LoginStage = LoginStageType.CHAR_SEL Then
DrawBackground(0) 'Scene Background
DrawButton(0) 'Close Game Button
If Window(4).Show = True Then
Window(3).Show = False
Else
Window(3).Show = True 'Chracter creation window
End If
DrawButton(7)
ElseIf LoginStage = LoginStageType.NOTICE Or LoginStage = LoginStageType.LOAD_GAME Then
DrawBackground(34) 'Scene Background
DrawButton(0) 'Close Game Button
Window(3).Show = False
Window(4).Show = False
Window(1).Show = False
DrawNoticeScreen()
End If
GameSprite.End() 'End Game Sprite For Scene
DrawWindows() 'Draw The Windows
GameSprite.Begin(SpriteFlags.AlphaBlend) 'End sprite for windows
'Draw The Messagebox close button
If Window(1).Show = True Then
Button(6).X = Window(1).X + 362 'Done so the button moves with the window
Button(6).Y = Window(1).Y + 62 'Done so the button moves with the window
DrawButton(6) 'Now draw the button
End If
'Draw Account creation boxes/text
If Window(2).Show = True Then
DrawAccountCreationText()
DrawTextbox(2)
DrawTextbox(3)
DrawTextbox(4)
DrawTextbox(5)
DrawTextbox(6)
DrawTextbox(7)
DrawTextbox(8)
DrawTextbox(9)
DrawButton(4)
DrawButton(5)
End If
If LoginStage = LoginStageType.CHAR_SEL Then
If Window(3).Show = True Then
'Draws the buttons, text, images etc.
DrawCharacterSelectionInterface()
End If
If Window(4).Show = True Then
LoadInterfaceTexture(31)
DrawButton(8)
DrawButton(9)
DrawButton(10)
DrawButton(11)
DrawButton(12)
DrawTextbox(10)
TextboxSelectIndex = 10
TextboxSelect = True
If Button(7).Image = 25 Then
ButtonSelect = False
End If
Button(7).Image = 30
Button(7).X = 538
Button(7).Y = 360
DrawButton(7)
If WarriorTicked = True Then
GameSprite.Draw(InterfaceTexture(31), Rectangle.Empty, New Microsoft.DirectX.Vector3(0, 0, 0), New Microsoft.DirectX.Vector3(415, 173, 0), Color.FromArgb(255, 255, 255))
ElseIf WizardTicked = True Then
GameSprite.Draw(InterfaceTexture(31), Rectangle.Empty, New Microsoft.DirectX.Vector3(0, 0, 0), New Microsoft.DirectX.Vector3(415, 217, 0), Color.FromArgb(255, 255, 255))
ElseIf TaoistTicked = True Then
GameSprite.Draw(InterfaceTexture(31), Rectangle.Empty, New Microsoft.DirectX.Vector3(0, 0, 0), New Microsoft.DirectX.Vector3(415, 264, 0), Color.FromArgb(255, 255, 255))
End If
If MaleTicked = True Then
GameSprite.Draw(InterfaceTexture(31), Rectangle.Empty, New Microsoft.DirectX.Vector3(0, 0, 0), New Microsoft.DirectX.Vector3(538, 193, 0), Color.FromArgb(255, 255, 255))
ElseIf FemaleTicked = True Then
GameSprite.Draw(InterfaceTexture(31), Rectangle.Empty, New Microsoft.DirectX.Vector3(0, 0, 0), New Microsoft.DirectX.Vector3(538, 251, 0), Color.FromArgb(255, 255, 255))
End If
Else
Button(7).Image = 25
Button(7).X = 10
Button(7).Y = 539
End If
End If
'Text outputs - done here because other wise the interface overlaps.
LoginSceneText() 'Text for login scene
DrawCharacterSelectText() ' Text for character selection
DrawMessageBoxText() 'Text for message box
GameSprite.End() 'End sprite for everything else
End Sub
End Module
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -