📄 new console look code.txt
字号:
just go to console.cpp and at the top under Code:
OgcConsole gConsole
add Code:
void DrawHudString (int x, int y, int r, int g, int b, const char *fmt, ... );
void tintArea(int x,int y,int w,int h, struct ColorEntry* clr);
and find
Code:
void OgcConsole::draw(int con_x, int con_y, int con_w, int con_h)
and replace this with the code
Code:
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));
}
int x5=cvar.con_x, y5=cvar.con_y, w=cvar.con_w;
int frame_y = cvar.con_y;
int frame_h = cvar.con_h;
register int c = 200;
gEngfuncs.pfnFillRGBA(x5,frame_y,w,1 ,c,c,c,c);
gEngfuncs.pfnFillRGBA(x5,frame_y,1,frame_h ,c,c,c,c);
gEngfuncs.pfnFillRGBA(x5+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(x5,cvar.con_y,w+1,1 ,c,c,c,c);
color = colorList.get(20);
gEngfuncs.pfnDrawSetTextColor(color->onebased_r,color->onebased_g,color->onebased_b);
DrawHudString(x,y,255,255,255,editbuf);
lines.reset();
for(;;)
{
y-=14;
if(y<con_y) break;
string& curLine = lines.read();
lines.prev();
drawConsoleLine(curLine,x,y);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -