Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ideas about a chat system.
#3
Not many players will press a button to re-read whats been said before. Cause it will take too much time for them to press and press and press. So I wouldn't save more than the last 25 messages or so.

Now all I would do is save the messages into
Code:
Dim lineChat(1 to 25) as String

And use a function to determine which one is free, and then to move the messages around. Like

Code:
Public Sub(byval Message as String)
  Dim i as Byte

  For i=1 to 25
    if lineChat(i) = vbNullstring then
      lineChat(i) = Message
      Exit sub
    end if
  Next i

  lineChat(1) = Message
  For i=1 to 24
    lineChat(i+1) = Message
  Next i
End Sub

So now, it first checks if 25 messages have been posted, if not the sub exists and the message is saved. If there are 25 messages in the chat, then it will replace lineChat(1) with the new message, and move them all up 1 slot and remove the old lineChat(25) message from memory.

Now you can just loop through the first 5 or so on the screen, and when you press up, it could jump up 5 slots at a time.

And for the idea of having a Len() to determine the length of the strings to keep them all in lines, so they are inside the chatbox. You could just use:

GOT BORED IGNORE THE BELOW PART. BY THE WAY, IM SICK.
Code:
Public Sub BltText()
Dim i as long, ii as byte
  For i = 1 to 25
    if Len(lineChat(i)) > 0 Then
      
    elseif Len(lineChat(i)) > 50 Then '50letters in a row
      
    End if
  Next i
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)