I have found a way that you can use any color from the currently loaded pallette in clientside text prints.
This function is used in all parts of the game except channels for printing and coloring characters(I had to upload a text file because posting it made this post too big):
http://teh.projectbnet.net/Nano351/m...xtFunction.txt
This Function selects what color to use:
Code:
0041F600 /$ 3C 01 CMP AL,1
0041F602 |. 75 0B JNZ SHORT starcraf.0041F60F
0041F604 |. A1 D0E06C00 MOV EAX,DWORD PTR DS:[6CE0D0]
0041F609 |. A3 A8E06C00 MOV DWORD PTR DS:[6CE0A8],EAX
0041F60E |. C3 RETN
0041F60F |> 8B0D A8E06C00 MOV ECX,DWORD PTR DS:[6CE0A8] ; starcraf.006CDFE8
0041F615 |. 0FB6C0 MOVZX EAX,AL
0041F618 |. 83C0 FE ADD EAX,-2 ; Switch (cases 2..1F)
0041F61B |. 83F8 1D CMP EAX,1D
0041F61E |. 890D D0E06C00 MOV DWORD PTR DS:[6CE0D0],ECX
0041F624 |. 0F87 ED000000 JA starcraf.0041F717
0041F62A |. FF2485 18F7410>JMP DWORD PTR DS:[EAX*4+41F718]
0041F631 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CDFE8 ; Case 2 of switch 0041F618
0041F63B |. C3 RETN
0041F63C |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CDFF0 ; Case 3 of switch 0041F618
0041F646 |. C3 RETN
0041F647 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE000 ; Case 5 of switch 0041F618
0041F651 |. C3 RETN
0041F652 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CDFF8 ; Case 4 of switch 0041F618
0041F65C |. C3 RETN
0041F65D |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE008 ; Case 6 of switch 0041F618
0041F667 |. C3 RETN
0041F668 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE010 ; Case 7 of switch 0041F618
0041F672 |. C3 RETN
0041F673 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE028 ; Case 8 of switch 0041F618
0041F67D |. C3 RETN
0041F67E |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE030 ; Case E of switch 0041F618
0041F688 |. C3 RETN
0041F689 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE038 ; Case F of switch 0041F618
0041F693 |. C3 RETN
0041F694 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE040 ; Case 10 of switch 0041F618
0041F69E |. C3 RETN
0041F69F |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE048 ; Case 11 of switch 0041F618
0041F6A9 |. C3 RETN
0041F6AA |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE050 ; Case 15 of switch 0041F618
0041F6B4 |. C3 RETN
0041F6B5 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE058 ; Case 16 of switch 0041F618
0041F6BF |. C3 RETN
0041F6C0 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE060 ; Case 17 of switch 0041F618
0041F6CA |. C3 RETN
0041F6CB |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE068 ; Case 18 of switch 0041F618
0041F6D5 |. C3 RETN
0041F6D6 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE070 ; Case 19 of switch 0041F618
0041F6E0 |. C3 RETN
0041F6E1 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE078 ; Case 1B of switch 0041F618
0041F6EB |. C3 RETN
0041F6EC |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE080 ; Case 1C of switch 0041F618
0041F6F6 |. C3 RETN
0041F6F7 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE088 ; Case 1D of switch 0041F618
0041F701 |. C3 RETN
0041F702 |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE090 ; Case 1E of switch 0041F618
0041F70C |. C3 RETN
0041F70D |> C705 A8E06C00 >MOV DWORD PTR DS:[6CE0A8],starcraf.006CE0A0 ; Case 1F of switch 0041F618
0041F717 \> C3 RETN ; Default case of switch
by patching at 0041FDB6 you can create your own custom color characters for high unused characters such as 7Fh. To setup a color you must first setup a color structure. It seems to me that it's just 8 byte array. It also seems that only a few bytes are used from that array:
Code:
00h,XXh,XXh,XXh,00h,00h,00h,XXh
the last byte is usually for shadow and the second, third, and forth are for different parts of the text's coloring the second being the largest portion.
An example would be this for pink in game lobby (which is in my latest version of host hack which still needs to be approved
):
Code:
00h,77h,77h,00h,00h,00h,00h,00h
Another way of patching is you could find when the color presets are written and change a preset after it is written to. This method doesn't quite get as much variety availability.
With this new coloring method you are no longer limited to starcraft's preset colors for clientside text and the only limit now is the colors available in the current palette.