Mirage Source
http://web.miragesource.net/forums/

[Feature] Open/Close ChatBox
http://web.miragesource.net/forums/viewtopic.php?f=183&t=4411
Page 1 of 56

Author:  Mattyw [ Sun Sep 21, 2008 1:51 am ]
Post subject:  [Feature] Open/Close ChatBox

Difficulty: 0/5 - Very easy to add/use.
Functionality: Made for MS4, good for if TextBox is on the GameScreen(kind of).

Go into frmMirage, & look for "Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)", then add this in:

Code:
    If KeyCode = vbKeyReturn Then
        If txtChat.Visible = False Then
            txtChat.Visible = True
            txtMyChat.Visible = True
            SetFocusOnChat
        Else
            If txtMyChat.Text <> vbNullString Then
                txtChat.Visible = True
                txtMyChat.Visible = True
                Exit Sub
            End If
            txtChat.Visible = False
            txtMyChat.Visible = False
        End If
    End If


It's amde so when you press Enter, it opens. If you press enter with a message, ChatBox stays open, if you press Enter without a message it closes.

ENJOY!

Author:  GIAKEN [ Sun Sep 21, 2008 1:53 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Would this interfere with pressing enter to send a message?

Author:  Jacob [ Sun Sep 21, 2008 1:57 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Code:
    If KeyCode = vbKeyReturn Then
            txtChat.Visible = not txtChat.Visible
            txtMyChat.Visible = not txtMyChat.Visible       
    End If

Author:  GIAKEN [ Sun Sep 21, 2008 1:59 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Code:
    If KeyCode = vbKeyReturn Then
        txtChat.Visible = Not txtChat.Visible
        txtMyChat.Visible = Not txtMyChat.Visible
        KeyCode = 0
    End If

Author:  Nean [ Sun Sep 21, 2008 2:06 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Code:
' lol I added a comment
  If KeyCode = vbKeyReturn Then
        txtChat.Visible = Not txtChat.Visible
        txtMyChat.Visible = Not txtMyChat.Visible
        KeyCode = 0
    End If

Author:  Anthony [ Sun Sep 21, 2008 2:16 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

How about adding a frmMirage.Height = blah blah so that it shrinks/enlarges the form when you open/close it.

Author:  Mattyw [ Sun Sep 21, 2008 2:18 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

I have it ontop of my GameScreen, so I'll leave for the PUBLIC to modify. =-p

EDIT: Updated:

Code:
    If KeyCode = vbKeyReturn Then
        If txtText.Visible = False Then
            txtText.Visible = True
            txtChat.Visible = True
            txtMyChat.Visible = True
            SetFocusOnChat
        Else
            If txtMyChat.Text <> vbNullString Then
                txtText.Visible = True
                txtChat.Visible = True
                txtMyChat.Visible = True
                Exit Sub
            End If
            txtText.Visible = False
            txtChat.Visible = False
            txtMyChat.Visible = False
        End If
    End If


If you entered something, ChatBox stays open, if you entered nothing, it closes.

Author:  skillzalot [ Mon Sep 22, 2008 10:40 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

I don't know if it was your code or mine but every time txt.Text showed up I got Variable not defined so I changed all the txt.Text to txt.Chat and it installed properly so My code looks like this
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Call CheckInput(1, KeyCode, Shift)
    If KeyCode = vbKeyF1 Then
    frmAdminPanel.Visible = True
    End If
    If KeyCode = vbKeyReturn Then
        If txtChat.Visible = False Then
            txtChat.Visible = True
            txtChat.Visible = True
            txtMyChat.Visible = True
            SetFocusOnChat
        Else
            If txtMyChat.Text <> vbNullString Then
                txtChat.Visible = True
                txtChat.Visible = True
                txtMyChat.Visible = True
                Exit Sub
            End If
            txtChat.Visible = False
            txtChat.Visible = False
            txtMyChat.Visible = False
        End If
    End If
End Sub

That is my whole Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Author:  Mattyw [ Mon Sep 22, 2008 3:11 pm ]
Post subject:  Re: [Feature] Open/Close ChatBox

skillzalot wrote:
I don't know if it was your code or mine but every time txt.Text showed up I got Variable not defined so I changed all the txt.Text to txt.Chat and it installed properly so My code looks like this
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Call CheckInput(1, KeyCode, Shift)
    If KeyCode = vbKeyF1 Then
    frmAdminPanel.Visible = True
    End If
    If KeyCode = vbKeyReturn Then
        If txtChat.Visible = False Then
            txtChat.Visible = True
            txtChat.Visible = True
            txtMyChat.Visible = True
            SetFocusOnChat
        Else
            If txtMyChat.Text <> vbNullString Then
                txtChat.Visible = True
                txtChat.Visible = True
                txtMyChat.Visible = True
                Exit Sub
            End If
            txtChat.Visible = False
            txtChat.Visible = False
            txtMyChat.Visible = False
        End If
    End If
End Sub

That is my whole Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Change/remove txtText, forgot to remove from tut, I used that, but removed & changed with a Dropdown list.

Author:  Clu [ Mon Sep 22, 2008 8:11 pm ]
Post subject:  Re: [Feature] Open/Close ChatBox

wouldnt this interfere with enter to pick up items? (assuming enter is pick up items)

Author:  Mattyw [ Mon Sep 22, 2008 8:41 pm ]
Post subject:  Re: [Feature] Open/Close ChatBox

Clu wrote:
wouldnt this interfere with enter to pick up items? (assuming enter is pick up items)


Could, it's why I changed my Pickup to SpaceBar. =-p

Author:  Acruno [ Tue Feb 17, 2009 1:30 pm ]
Post subject:  Re: [Feature] Open/Close ChatBox

Apologies for the necro but I had a look at this and it doesn't work anymore.
In HandleKeyPresses
Code:
If LenB(ChatText) = 0 Then


change that little bit to
Code:
    If LenB(ChatText) = 0 Then
        If KeyAscii = vbKeyReturn Then
            If frmMirage.txtChat.Visible = True Then
                frmMirage.txtChat.Visible = False
                frmMirage.txtMyChat.Visible = False
            Else
                frmMirage.txtMyChat.Visible = True
                frmMirage.txtChat.Visible = True
                SetFocusOnChat
            End If
            Exit Sub
        End If
    End If

Author:  wanai [ Wed Dec 01, 2021 7:47 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтsemiasphalticfluxсайтсайтсайт
сайтсайтсайтсайтсайтсайтhttp://taskreasoning.ruсайтсайтсайтинфосайтсайтtuchkasсайтсайт

Author:  wanai [ Tue Dec 28, 2021 7:39 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Econ

Author:  wanai [ Tue Dec 28, 2021 7:40 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

50.6

Author:  wanai [ Tue Dec 28, 2021 7:41 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Bett

Author:  wanai [ Tue Dec 28, 2021 7:42 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Bett

Author:  wanai [ Tue Dec 28, 2021 7:43 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Unit

Author:  wanai [ Tue Dec 28, 2021 7:44 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Girl

Author:  wanai [ Tue Dec 28, 2021 7:45 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Toto

Author:  wanai [ Tue Dec 28, 2021 7:47 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Stan

Author:  wanai [ Tue Dec 28, 2021 7:48 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Mary

Author:  wanai [ Tue Dec 28, 2021 7:49 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Pack

Author:  wanai [ Tue Dec 28, 2021 7:50 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Sara

Author:  wanai [ Tue Dec 28, 2021 7:51 am ]
Post subject:  Re: [Feature] Open/Close ChatBox

Oper

Page 1 of 56 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/