Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Where to change message colors?


chuchoide
 Share

Recommended Posts

Hello.

The colours are found in different locations trough the sources. I guess that if you want to change them in the chat you might as well want to change them in the map. Unless you really just want to change the colours in the chatbox, but then you'd have even more than you need anyway.  ;)

Note that you can modify the color with any valid color function. The one I'd personally prefer (As those numbers mean something to me) is RGB(r, g, b) ([http://www.chennaiiq.com/developers/reference/visual_basic/functions/rgb.asp](http://www.chennaiiq.com/developers/reference/visual_basic/functions/rgb.asp)), simple enough isn't it?  :cheesy: There's also QBColor(color), as referenced here : [http://www.chennaiiq.com/developers/reference/visual_basic/functions/qbcolor.asp](http://www.chennaiiq.com/developers/reference/visual_basic/functions/qbcolor.asp). QBColor's constants are found in the modConstants file and goes as follow :

> ' text color constants
> Public Const Black As Byte = 0
> Public Const Blue As Byte = 1
> Public Const Green As Byte = 2
> Public Const Cyan As Byte = 3
> Public Const Red As Byte = 4
> Public Const Magenta As Byte = 5
> Public Const Brown As Byte = 6
> Public Const Grey As Byte = 7
> Public Const DarkGrey As Byte = 8
> Public Const BrightBlue As Byte = 9
> Public Const BrightGreen As Byte = 10
> Public Const BrightCyan As Byte = 11
> Public Const BrightRed As Byte = 12
> Public Const Pink As Byte = 13
> Public Const Yellow As Byte = 14
> Public Const White As Byte = 15

In the modText file at line ~56 there's the comment ' Check access level , in the Sub DrawPlayerName(ByVal Index As Long). This function is meant to draw the player's name as you see it on the map. You will see this code under the comment :
```
If GetPlayerPK(Index) = NO Then

        Select Case GetPlayerAccess(Index)
            Case 0
                color = RGB(255, 96, 0)
            Case 1
                color = QBColor(DarkGrey)
            Case 2
                color = QBColor(Cyan)
            Case 3
                color = QBColor(BrightGreen)
            Case 4
                color = QBColor(Yellow)
        End Select

    Else
        color = QBColor(BrightRed)
    End If

```
I guess it's pretty intuitive.  :P (Do not forget the else statement if you want to edit admin's color.)

Regarding your chatbox problem… It's located in file modHandleData at line ~ 2073 in the Sub HandleSayMsg(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) function, who's job is to write player's stuff in the txtChat form, also known as "Chatbox". It's exactly the same code as above.

Also note that the Sub AddText(ByVal Msg As String, ByVal color As Integer) subprocess found in the modText file at line ~283 does as different job from HandleSayMsg one, as you can judge by it's arguments. The latter is solely used to declare stuff on the chatbox, as the message of the day. It has a color argument but if you're planning on a chatbox mod system or whatever, built it in the HandleSayMsg to keep the remaining of your sources clean.

Hope you learnt some and **HOPE I didn't say shit about your sources, Robin.**   :embarrassed:

:rstar: :rstar: :rstar:
Link to comment
Share on other sites

@Minikloon:

> Hello.
>
> The colours are found in different locations trough the sources. I guess that if you want to change them in the chat you might as well want to change them in the map. Unless you really just want to change the colours in the chatbox, but then you'd have even more than you need anyway.  ;)
>
> Note that you can modify the color with any valid color function. The one I'd personally prefer (As those numbers mean something to me) is RGB(r, g, b) ([http://www.chennaiiq.com/developers/reference/visual_basic/functions/rgb.asp](http://www.chennaiiq.com/developers/reference/visual_basic/functions/rgb.asp)), simple enough isn't it?  :cheesy: There's also QBColor(color), as referenced here : [http://www.chennaiiq.com/developers/reference/visual_basic/functions/qbcolor.asp](http://www.chennaiiq.com/developers/reference/visual_basic/functions/qbcolor.asp). QBColor's constants are found in the modConstants file and goes as follow :
>
> In the modText file at line ~56 there's the comment ' Check access level , in the Sub DrawPlayerName(ByVal Index As Long). This function is meant to draw the player's name as you see it on the map. You will see this code under the comment :
> ```
> If GetPlayerPK(Index) = NO Then
>
>         Select Case GetPlayerAccess(Index)
>             Case 0
>                 color = RGB(255, 96, 0)
>             Case 1
>                 color = QBColor(DarkGrey)
>             Case 2
>                 color = QBColor(Cyan)
>             Case 3
>                 color = QBColor(BrightGreen)
>             Case 4
>                 color = QBColor(Yellow)
>         End Select
>
>     Else
>         color = QBColor(BrightRed)
>     End If
>
> ```
> I guess it's pretty intuitive.  :P (Do not forget the else statement if you want to edit admin's color.)
>
> Regarding your chatbox problem… It's located in file modHandleData at line ~ 2073 in the Sub HandleSayMsg(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) function, who's job is to write player's stuff in the txtChat form, also known as "Chatbox". It's exactly the same code as above.
>
> Also note that the Sub AddText(ByVal Msg As String, ByVal color As Integer) subprocess found in the modText file at line ~283 does as different job from HandleSayMsg one, as you can judge by it's arguments. The latter is solely used to declare stuff on the chatbox, as the message of the day. It has a color argument but if you're planning on a chatbox mod system or whatever, built it in the HandleSayMsg to keep the remaining of your sources clean.
>
> Hope you learnt some and **HOPE I didn't say shit about your sources, Robin.**   :embarrassed:
>
> :rstar: :rstar: :rstar:

Hey man, thank you very much! This is the best answer I ever got. Thanks a lot, really!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...