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

[ES] Why is there duplicate color constants?


Ginnungagap
 Share

Recommended Posts

I was looking through the source code in Eclipse Stable (btw, I'm new to this),
and was wondering why these variables are in several different files:

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

Public Const SayColor = Grey
Public Const GlobalColor = Green
Public Const BroadcastColor = White
Public Const TellColor = White
Public Const EmoteColor = White
Public Const AdminColor = BrightCyan
Public Const HelpColor = White
Public Const WhoColor = Grey
Public Const JoinLeftColor = Grey
Public Const NpcColor = White
Public Const AlertColor = White
Public Const NewMapColor = Grey

```
I was wanting to edit the chat colors, and I'm not sure how to go about it now.
Link to comment
Share on other sites

The first row of const are the colors itself.

You could write:
```
Public Const SayColor = Grey
```OR
```
Public Const SayColor = 7
```
Its the same.
If you want to edit the colors for the chat, edit SayColor. Its pretty self explanatory.

Example:
```
Public Const SayColor = Yellow
```OR
```
Public Const SayColor = 14
```
Using 'Yellow' is way easier to read, thats why there are 2 row of variables.
i'm not pretty good at explaining things, but you'll get the hang of it.

Have fun!
Link to comment
Share on other sites

Its been a while I opened up this source…
I guess these variables can be found in both client and server.

*checking*
yes, in modConstants.mod

edit this file in both client and server and you'll be fine.
Link to comment
Share on other sites

Err, I don't know about newer versions of eclipse… I stopped coding things before '2.8' came out.

Try what I said, if it doesn't work I'm afraid I cannot help you. (ignore modText)
Link to comment
Share on other sites

The variables aren't being declared in different files. That'd cause errors.

They're only declared in modConstants on both the server and client. (Poorly, btw. It doesn't even give a datatype so they're all variant by default.)
Link to comment
Share on other sites

Either way, changing any of the values for SayColor is not actually changing it.

I've set them different in both files, and I have also set them to the same thing.

On a side note, how are they not declared in different files if I am supposed to edit them in both places?
Link to comment
Share on other sites

You shouldn't be editing single files anyway. You should always edit the project through the .vbp file. When compiling it takes all the different forms and modules and classes and compiles into a single .exe file. You can't compile a single piece of that project.

"File -> Make [filename].exe" will make a fully compiled .exe file. "Ctrl & F5" will do a full compile & run which is best for debugging.
Link to comment
Share on other sites

At first it gave me a "System Registry" error when trying to open the projects, which is why I was attempting to edit single files (because it let me do that).
I just searched it and had to give VB6 admin rights.

Just got it all working after the compile!

Thanks so much.

(Sorry for the hassle, I'm a JAVA programmer and it compiles classes separately)

EDIT: also, it only requires the server file to be changed.
Link to comment
Share on other sites

Ah, that explains it. Java is quite a bit different.

It only requires the server to be changed because the server sends through the chat messages.

I honestly don't know if the client-side variables are used for anything as I've never used Stable.
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...