** CUSTOMIZABLE BORDERS **
open your "client.cpp" first find tintarea.. if you have tintarea2 under it good.. if not
then use the one i paste.. now you should already have consoleborder coding .. replace all of that with this.
void tintArea2(int x,int y,int w,int h, ColorEntry* clr1,ColorEntry* clr2)
{
oglSubtractive = true;
for(int v=y;v<=y+h;v+=2)
{
gEngfuncs.pfnFillRGBA(x,v,w,1,clr1->r,clr1->g,clr1->b,clr1->a);
gEngfuncs.pfnFillRGBA(x,v+1,w,1,clr2->r,clr2->g,clr2->b,clr2->a);
}
oglSubtractive = false;
}
//===================================================================================
void consoleBorder(int x,int y,int w, int h, ColorEntry* clr3)
{
oglSubtractive = true;
gEngfuncs.pfnFillRGBA( x-6, y-6, w+11, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w+5, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y+h+6, w+12, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y+h+1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-2, y-2, w+4, 1 , clr3->r/2, clr3->g/2, clr3->b/2, clr3->a );
gEngfuncs.pfnFillRGBA( x-2, y-2, 1, h+4 , clr3->r/2, clr3->g/2, clr3->b/2, clr3->a );
gEngfuncs.pfnFillRGBA( x-5, y+h+5, w+10, 1 , clr3->r/2, clr3->g/2, clr3->b/2, clr3->a );
gEngfuncs.pfnFillRGBA( x+w+4, y-4, 1, h+10 , clr3->r/2, clr3->g/2, clr3->b/2, clr3->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, w+8, 2 , clr3->r,clr3->g,clr3->b,clr3->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, 2, h+8 , clr3->r,clr3->g,clr3->b,clr3->a );
gEngfuncs.pfnFillRGBA( x-4, y+h+3, w+8, 2 , clr3->r,clr3->g,clr3->b,clr3->a );
gEngfuncs.pfnFillRGBA( x+w+2, y-4, 2, h+9 , clr3->r,clr3->g,clr3->b,clr3->a );
oglSubtractive = false;
gEngfuncs.pfnFillRGBA( x-5, y-5, w+10, 1 , clr3->r*2, clr3->g*2, clr3->b*2, clr3->a );
gEngfuncs.pfnFillRGBA( x-5, y-5, 1, h+10 , clr3->r*2, clr3->g*2, clr3->b*2, clr3->a );
gEngfuncs.pfnFillRGBA( x-2, y+h+2, w+4, 1 , clr3->r*2, clr3->g*2, clr3->b*2, clr3->a );
gEngfuncs.pfnFillRGBA( x+w+1, y-1, 1, h+3 , clr3->r*2, clr3->g*2, clr3->b*2, clr3->a );
}
void menuBorder(int x,int y,int w, int h, ColorEntry* clr4)
{
oglSubtractive = true;
gEngfuncs.pfnFillRGBA( x-6, y-6, w+11, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w+5, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y+h+6, w+12, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y+h+1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-2, y-2, w+4, 1 , clr4->r/2, clr4->g/2, clr4->b/2, clr4->a );
gEngfuncs.pfnFillRGBA( x-2, y-2, 1, h+4 , clr4->r/2, clr4->g/2, clr4->b/2, clr4->a );
gEngfuncs.pfnFillRGBA( x-5, y+h+5, w+10, 1 , clr4->r/2, clr4->g/2, clr4->b/2, clr4->a );
gEngfuncs.pfnFillRGBA( x+w+4, y-4, 1, h+10 , clr4->r/2, clr4->g/2, clr4->b/2, clr4->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, w+8, 2 , clr4->r,clr4->g,clr4->b,clr4->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, 2, h+8 , clr4->r,clr4->g,clr4->b,clr4->a );
gEngfuncs.pfnFillRGBA( x-4, y+h+3, w+8, 2 , clr4->r,clr4->g,clr4->b,clr4->a );
gEngfuncs.pfnFillRGBA( x+w+2, y-4, 2, h+9 , clr4->r,clr4->g,clr4->b,clr4->a );
oglSubtractive = false;
gEngfuncs.pfnFillRGBA( x-5, y-5, w+10, 1 , clr4->r*2, clr4->g*2, clr4->b*2, clr4->a );
gEngfuncs.pfnFillRGBA( x-5, y-5, 1, h+10 , clr4->r*2, clr4->g*2, clr4->b*2, clr4->a );
gEngfuncs.pfnFillRGBA( x-2, y+h+2, w+4, 1 , clr4->r*2, clr4->g*2, clr4->b*2, clr4->a );
gEngfuncs.pfnFillRGBA( x+w+1, y-1, 1, h+3 , clr4->r*2, clr4->g*2, clr4->b*2, clr4->a );
}
void radarBorder(int x,int y,int w, int h, ColorEntry* clr5)
{
oglSubtractive = true;
gEngfuncs.pfnFillRGBA( x-6, y-6, w+11, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w+5, y-6, 1, h+12 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-6, y+h+6, w+12, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-1, y+h+1, w+2, 1 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x+w, y-1, 1, h+2 , 0, 0, 0, 128 );
gEngfuncs.pfnFillRGBA( x-2, y-2, w+4, 1 , clr5->r/2, clr5->g/2, clr5->b/2, clr5->a );
gEngfuncs.pfnFillRGBA( x-2, y-2, 1, h+4 , clr5->r/2, clr5->g/2, clr5->b/2, clr5->a );
gEngfuncs.pfnFillRGBA( x-5, y+h+5, w+10, 1 , clr5->r/2, clr5->g/2, clr5->b/2, clr5->a );
gEngfuncs.pfnFillRGBA( x+w+4, y-4, 1, h+10 , clr5->r/2, clr5->g/2, clr5->b/2, clr5->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, w+8, 2 , clr5->r,clr5->g,clr5->b,clr5->a );
gEngfuncs.pfnFillRGBA( x-4, y-4, 2, h+8 , clr5->r,clr5->g,clr5->b,clr5->a );
gEngfuncs.pfnFillRGBA( x-4, y+h+3, w+8, 2 , clr5->r,clr5->g,clr5->b,clr5->a );
gEngfuncs.pfnFillRGBA( x+w+2, y-4, 2, h+9 , clr5->r,clr5->g,clr5->b,clr5->a );
oglSubtractive = false;
gEngfuncs.pfnFillRGBA( x-5, y-5, w+10, 1 , clr5->r*2, clr5->g*2, clr5->b*2, clr5->a );
gEngfuncs.pfnFillRGBA( x-5, y-5, 1, h+10 , clr5->r*2, clr5->g*2, clr5->b*2, clr5->a );
gEngfuncs.pfnFillRGBA( x-2, y+h+2, w+4, 1 , clr5->r*2, clr5->g*2, clr5->b*2, clr5->a );
gEngfuncs.pfnFillRGBA( x+w+1, y-1, 1, h+3 , clr5->r*2, clr5->g*2, clr5->b*2, clr5->a );
}
now find your "drawRadarFrame()" function.. replace it with this
void drawRadarFrame()
{
int& centerx = cvar.radar_x;
int& centery = cvar.radar_y;
int& size = cvar.radar_size;
int x = centerx-size;
int y = centery-size;
ColorEntry* clr;
ColorEntry* c1;
ColorEntry* c2;
clr = colorList.get(12);
c1 = colorList.get(40);
c2 = colorList.get(41);
tintArea2(centerx-size, centery-size, 2*size, 2*size, c1,c2);
ColorEntry* c4 = colorList.get(47);
radarBorder(centerx-size,centery-size,2*size,2*size,c4);
clr = colorList.get(11);
gEngfuncs.pfnFillRGBA(centerx,centery-size,1,2*size,clr->r,clr->g,clr->b,clr->a);
gEngfuncs.pfnFillRGBA(centerx-size,centery,2*size,1,clr->r,clr->g,clr->b,clr->a);
}
find your "drawMenu()" function.. replace it with this
void drawMenu( )
{
int x, y, w;
if (!menu_active)
return;
if (!curMenu)
curMenu = ogcMenu.baseMenu;
vector<OgcCommandMenu::MenuEntry>& items = curMenu->items;
x = cvar.menu_x;
y = cvar.menu_y;
w = cvar.menu_w;
enum{ TEXT_H = 20 };
int title_h = TEXT_H+5;
int frame_y = cvar.menu_y - title_h;
int frame_h = items.size()*TEXT_H + title_h;
ColorEntry* c1 = colorList.get(42);
ColorEntry* c2 = colorList.get(43);
tintArea2(x,frame_y,w,title_h,c1,c2);
int h1 = curMenu->selection*TEXT_H;
if(h1)
{
tintArea(x,y,w,h1,colorList.get(21));
y+=h1;
}
tintArea(x,y,w,TEXT_H,colorList.get(22));
y+=TEXT_H;
int numItemsLeft = items.size() - curMenu->selection - 1;
if(numItemsLeft>0)
{
tintArea(x,y,w,numItemsLeft*TEXT_H,colorList.get(21));
}
register int c = 200;
gEngfuncs.pfnFillRGBA(x,frame_y,w,1 ,c,c,c,c);
gEngfuncs.pfnFillRGBA(x,frame_y,1,frame_h ,c,c,c,c);
gEngfuncs.pfnFillRGBA(x+w,frame_y,1,frame_h,c,c,c,c);
gEngfuncs.pfnFillRGBA(x,frame_y+frame_h,w,1,c,c,c,c);
gEngfuncs.pfnFillRGBA(x,cvar.menu_y,w+1,1 ,c,c,c,c);
ColorEntry* c4 = colorList.get(46); // 34
menuBorder(x,frame_y,w-2,frame_h,c4);
DrawHudString(cvar.menu_x+10,frame_y+5,255,0,255,const_cast<char*>(curMenu->name.c_str()));
y=cvar.menu_y+4;
x+=4;
for(int i=0;i<items.size();i++)
{
OgcCommandMenu::MenuEntry& item = items;
ColorEntry* clr = colorList.get(23); // "menu_text"
gEngfuncs.pfnDrawSetTextColor(clr->onebased_r,clr->onebased_g,clr->onebased_b);
gEngfuncs.pfnDrawConsoleString(x,y,const_cast<char*>(item.name.c_str()));
y+=TEXT_H;
}
}
now open up your "client.h" and paste these definitions..
void tintArea2(int x,int y,int w,int h, ColorEntry* clr1,ColorEntry* clr2);
void consoleBorder(int x,int y,int w, int h, ColorEntry* clr );
void menuBorder(int x,int y,int w, int h, ColorEntry* clr );
void radarBorder(int x,int y,int w, int h, ColorEntry* clr ); void SetClockNT(int);
now in color.cpp add these colors to customize the borders at the bottom..
add("mborder" ,0,0,0, 128 ); // index:46
add("rborder" ,0,0,0, 128 ); // index:47
add("cborder" ,0,0,0, 128 ); // index:48
now open console.cpp and in the first function "draw" replace it with this..
void OgcConsole::draw(int con_x, int con_y, int con_w, int con_h)
{
if(!active && !curHeight ) return;
int nscroll = scrollEventCounter.get();
for(int i=0;i<nscroll;i++)
{
if( active ){
if(curHeight!=con_h)
{
curHeight += cvar.con_slidespeed;
if(curHeight>con_h) curHeight=con_h;
}
} else {
curHeight -= cvar.con_slidespeed;
if(curHeight<=0) { curHeight=0; return; }
}
}
ColorEntry* color = colorList.get(17);
ColorEntry c1 = *colorList.get(44);
ColorEntry c2 = *colorList.get(45);
tintArea2(con_x,con_y,con_w,curHeight,&c1,&c2);
int x = con_x+3;
int y = con_y+curHeight-14;
if(blinkTimer.expired())
{
blink = !blink;
if(blink) { blinkTimer.countdown(0.2); }
else { blinkTimer.countdown(0.2); }
}
if(blink)
{
int length, height, ch_length;
char save;
save = cursorpos[0]; cursorpos[0]=0;
gEngfuncs.pfnDrawConsoleStringLen( editbuf, &length, &height );
cursorpos[0]=save;
save = cursorpos[1]; cursorpos[1]=0;
gEngfuncs.pfnDrawConsoleStringLen( cursorpos, &ch_length, &height );
cursorpos[1]=save;
if(!*cursorpos) ch_length=5;
tintArea(x+length,y,ch_length,height-2, colorList.get(19));
}
color = colorList.get(20);
gEngfuncs.pfnDrawSetTextColor(color->onebased_r,color->onebased_g,color->onebased_b);
ColorEntry* c3 = colorList.get(48); // 48
consoleBorder(cvar.con_x,cvar.con_y,cvar.con_w,cvar.con_h,c3);
gEngfuncs.pfnDrawConsoleString(x,y,editbuf);
lines.reset();
for(;;)
{
y-=14;
if(y<con_y) break;
string& curLine = lines.read();
lines.prev();
drawConsoleLine(curLine,x,y);
}
}
now save.. and your done..