Social Icons

Sunday, 11 August 2013

[TUT][SKIDS]How to add new chat colors

Okay so I just found out how to do it, it isn't really hard to do.

1: Navigate to FontRenderer and search for
Code:
123456789abcdef
2: add the next letter of the alphabet or just a random letter
3: go to the constructor and search for
Code:
this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255;

4: now do the following: make an if statement like so:
Code:
if(var5 == 16){
        this.colorCode[var5] = 0xRRGGBB;
}else
{
    this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255;   
}
When you add a new letter for a code just do the following:
Code:
if(var5 == 16)
    {
        this.colorCode[var5] = 0xRRGGBB;
    } else if(var5 == 17){
        this.colorCode[var5] = 0xRRGGBB;
      }else
    {
    this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255;   
    }
Basically you want to count up from 16

After that look for
Code:
GL11.glColor4f((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.alpha);
and change it to this
Code:
try{
    var6 = this.colorCode[var5];

    this.textColor = var6;
    GL11.glColor4f((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.alpha);
    }catch(Exception ex)
    {
    }
It throws an exception but idk why, it still works tho

Just wanted to make a tutorial for it :D

No comments:

Post a Comment