Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub MainMenu_MouseUp()
- Dim i As Long, X As Long, Y As Long, e As Long, n As Long
- mouseState2 = 0
- Select Case MenuGUIs
- Case RenderState.Register
- i = 8
- X = 480
- Y = 390
- ' check if we're on the button
- If (GlobalX >= X And GlobalX <= X + Buttons(i).Width) And (GlobalY >= Y And GlobalY <= Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- Select Case i
- Case 8
- ' prevent password
- If RegisterStr(4) <> RegisterStr(3) Then
- GameNotify = "Please make sure your password match!"
- Exit Sub
- End If
- ' Prevent fake letters
- For i = 1 To Len(RegisterStr(1))
- n = AscW(Mid$(RegisterStr(1), i, 1))
- If Not isNameLegal(n) Then
- GameNotify = "Invalid username, only letters, numbers, spaces, and _ allowed in usernames."
- resetClickedButtons()
- Exit Sub
- End If
- Next
- If Not RegisterStr(5) = Captcha.ToUpper Then
- GameNotify = "Captcha Incorrecto"
- Captcha = CreateCaptcha() ' Reset the Captcha
- resetClickedButtons()
- Exit Sub
- End If
- ' Email check
- If InStr(RegisterStr(2), ".") > 0 Then
- If Not InStr(RegisterStr(2), "@") > 0 Then
- GameNotify = "Email Invalido"
- resetClickedButtons()
- Exit Sub
- End If
- Else
- GameNotify = "Necesitas usar un . en una dirección de correo electronico."
- resetClickedButtons()
- Exit Sub
- End If
- MenuState(RenderState.Register)
- End Select
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Case RenderState.NewChar
- For i = 17 To 22
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- Select Case i
- Case 17 ' Caballero
- createChar.ClassSelect = 1
- LoadCharClass(createChar.ClassSelect)
- Case 18
- createChar.ClassSelect = 3 ' Mago
- LoadCharClass(createChar.ClassSelect)
- Case 19
- 'createChar.ClassSelect = 2 ' Acechador
- 'LoadCharClass(createChar.ClassSelect)
- Case 20
- 'createChar.ClassSelect = 5 ' Nigromante
- 'LoadCharClass(createChar.ClassSelect)
- Case 21
- 'createChar.ClassSelect = 4 ' Cazador
- ' LoadCharClass(createChar.ClassSelect)
- Case 22
- ' createChar.ClassSelect = 6 ' Druida
- ' LoadCharClass(createChar.ClassSelect)
- End Select
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- 'Clases
- For i = 33 To 34
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- Select Case i
- Case 33
- createChar.SexSelect = SEX_MALE
- createChar.HairSelect = 1
- createChar.SpriteSelect = 1
- Buttons(34).state = 0
- Case 34
- createChar.SexSelect = SEX_FEMALE
- createChar.HairSelect = 1
- createChar.SpriteSelect = 1
- Buttons(33).state = 0
- End Select
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- 'CODIGO DE LOS COLORES RGB
- For i = 23 To 32
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- For z = 1 To UBound(createChar.HairTint)
- If i = (z + 22) Then
- createChar.HairTintSelect = z : Exit For
- End If
- Next
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- For i = 37 To 38
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- Select Case i
- Case 37
- createChar.SpriteSelect += 1
- If createChar.SpriteSelect > UBound(createChar.Sprite) Then
- createChar.SpriteSelect = 1
- End If
- Case 38
- createChar.HairSelect += 1
- If createChar.HairSelect > UBound(createChar.Hair) Then
- createChar.HairSelect = 1
- End If
- End Select
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- For i = 39 To 40
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- Select Case i
- Case 39
- Call MenuState(RenderState.AddChar)
- Case 40
- Select Case MenuGUIs
- Case RenderState.NewChar
- 'MenuState(MENU_STATE_CHARACTERS)
- MenuGUIs = RenderState.Characters
- Case Else
- If Not PlayerSocket Is Nothing Then
- PlayerSocket.Close()
- PlayerSocket = Nothing
- End If
- 'DestroyTCP()
- ' clear the textbox
- 'curTextbox = 1
- End Select
- PlaySound(Sound_ButtonClick)
- End Select
- End If
- End If
- Next
- 'Select Case MenuGUIs
- Case RenderState.Menu
- ' find out which button we're clicking
- For i = 7 To 8
- ' check if we're on the button
- If (GlobalX >= Buttons(i).X And GlobalX <= Buttons(i).X + Buttons(i).Width) And (GlobalY >= Buttons(i).Y And GlobalY <= Buttons(i).Y + Buttons(i).Height) Then
- If Buttons(i).state = 2 Then
- ' do stuffs
- Select Case i
- Case 7
- 'If faderState = 4 Then
- ' login
- If isLoginLegal(idDialogue, passCorrect) Then
- MenuState(RenderState.Login)
- End If
- Case 8
- pnlCreditsVisible = False
- MenuGUIs = RenderState.Register
- 'If faderState = 4 Then
- ' register
- 'PlayerSocket.Close()
- ' = MENU_REGISTER
- 'frmMenu.picRegister.Visible = True
- 'frmMenu.picCharacters.Visible = False
- ' clear the textbox
- 'sUser = vbNullString
- 'sPass = vbNullString
- 'sPass2 = vbNullString
- 'curTextbox = 1
- 'End If
- End Select
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- Case RenderState.Characters
- For e = 41 To 43
- ' check if we're on the button
- If (GlobalX >= Buttons(e).X And GlobalX <= Buttons(e).X + Buttons(e).Width) And (GlobalY >= Buttons(e).Y And GlobalY <= Buttons(e).Y + Buttons(e).Height) Then
- If Buttons(e).state = 2 Then
- ' do stuffs
- Select Case e
- Case 41
- If SelectedChar <= 0 Then Exit Sub 'Fix
- If Len(Trim(CharData(SelectedChar).Name)) = 0 Then Call MenuState(RenderState.NewChar)
- Case 42
- If SelectedChar <= 0 Then Exit Sub 'fix
- If Len(Trim(CharData(SelectedChar).Name)) > 0 Then Call MenuState(RenderState.UseChar)
- Case 43
- If SelectedChar <= 0 Then Exit Sub ' fix
- If Len(Trim(CharData(SelectedChar).Name)) > 0 Or CharData(SelectedChar).Name = "" Then
- If MsgBox("Are you sure you want to delete this character?", vbYesNo) = vbYes Then Call MenuState(RenderState.DelChar)
- End If
- End Select
- ' play sound
- PlaySound(Sound_ButtonClick)
- End If
- End If
- Next
- End Select
- ' reset buttons
- resetClickedButtons()
- 'MainMenuButtonState(1) = 0
- 'MainMenuButtonState(2) = 0
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement