stoneage8.5/石器时代8.5客户端最新源代码/石器源码/system/ime.cpp

187 lines
5.0 KiB
C++
Raw Normal View History

2020-06-23 15:53:23 +08:00
/************************/
2020-06-23 15:27:59 +08:00
/* ime.cpp */
/************************/
#include "../systeminc/version.h"
#include "../systeminc/system.h"
#include "winnls32.h"
#include "../systeminc/font.h"
#include "../other/caryIme.h"
#include "../systeminc/menu.h"
#include "../systeminc/battleMenu.h"
#ifdef _TALK_WINDOW
#include "../systeminc/talkwindow.h"
#endif
#include "../systeminc/DirectDraw.h"
DWORD dwInfo;
void ShowBottomLineString(int iColor,LPSTR lpstr)
{
LPSTR lpstr1=GetImeString();
dwInfo = 0;
if(!lpstr1 && lpstr[0]!=0){
dwInfo = 1;
StockFontBuffer( 8, 460 + DISPLACEMENT_Y, FONT_PRIO_FRONT, iColor, lpstr, 0 );
}
}
2020-06-23 15:53:23 +08:00
// Terry add 2003/12/16 for 交易视窗开启时,显示物品说明不显示输入法
2020-06-23 15:27:59 +08:00
extern BOOL bShowItemExplain;
#ifdef _MO_SHOW_FPS
extern int framesToShow;
extern int skipFramesToShow;
#endif
// end
2020-06-23 15:53:23 +08:00
// 输入法的处理
2020-06-23 15:27:59 +08:00
void ImeProc()
{
2020-06-23 15:53:23 +08:00
// 显示输入法的名称
// Terry fix 2003/12/16 for 交易视窗开启时,显示物品说明不显示输入法
//if( TaskBarFlag == FALSE ){ 这行改成下一行
2020-06-23 15:27:59 +08:00
if(TaskBarFlag == FALSE && bShowItemExplain == FALSE){
// end
LPSTR lpstr=GetImeString();
LPSTR lpstr1;
if(lpstr){
#ifdef _TELLCHANNEL
StockFontBuffer(8,420 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,FONT_PAL_WHITE,lpstr,0);
#else
StockFontBuffer(8,460 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,FONT_PAL_WHITE,lpstr,0);
#endif
#ifdef _TALK_WINDOW
if(g_bTalkWindow) TalkWindow.Update();
#endif
}
lpstr1=GetImeDescString();
if( 1!=dwInfo){
if( lpstr1){
char* BIG5ToGB2312(const char* szBIG5String);
2020-06-23 15:53:23 +08:00
extern int ;
extern int ;
if(){
char [1024]={0};
LCMapString(0x804,0x4000000,lpstr1, strlen(lpstr1),,1024);
if(==950)
StockFontBuffer(530-strlen(lpstr1)*(FONT_SIZE>>1) + DISPLACEMENT_X,460 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,0,BIG5ToGB2312((const char *)),0);
2020-06-23 15:27:59 +08:00
else
2020-06-23 15:53:23 +08:00
StockFontBuffer(530-strlen(lpstr1)*(FONT_SIZE>>1) + DISPLACEMENT_X,460 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,0,,0);
2020-06-23 15:27:59 +08:00
}else{
2020-06-23 15:53:23 +08:00
if(==950)
2020-06-23 15:27:59 +08:00
StockFontBuffer(530-strlen(lpstr1)*(FONT_SIZE>>1) + DISPLACEMENT_X,460 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,0,BIG5ToGB2312((const char *)lpstr1),0);
else
StockFontBuffer(530-strlen(lpstr1)*(FONT_SIZE>>1) + DISPLACEMENT_X,460 + DISPLACEMENT_Y ,FONT_PRIO_FRONT,0,lpstr1,0);
}
}
char tmp[64];
extern DWORD dwPingTime, dwPingState;
if( dwPingState & 0x80000000){
wsprintf( tmp, "*%d", dwPingTime);
dwPingState++;
if( (dwPingState&0xff) > 40)
dwPingState = 0;
}else
wsprintf( tmp, " %d", dwPingTime);
StockFontBuffer( 605 + DISPLACEMENT_X, 460 + DISPLACEMENT_Y , FONT_PRIO_FRONT, FONT_PAL_WHITE, tmp, 0 );
#ifndef _REMAKE_20
2020-06-23 15:53:23 +08:00
lpstr = "玩家模式";
2020-06-23 15:27:59 +08:00
switch( AI){
case AI_ATTACK:
2020-06-23 15:53:23 +08:00
lpstr = "强制攻击";
2020-06-23 15:27:59 +08:00
break;
case AI_GUARD:
2020-06-23 15:53:23 +08:00
lpstr = "强制防御";
2020-06-23 15:27:59 +08:00
break;
case AI_SELECT:
2020-06-23 15:53:23 +08:00
lpstr = "AI模式";
2020-06-23 15:27:59 +08:00
break;
}
StockFontBuffer( 540 + DISPLACEMENT_X, 460 + DISPLACEMENT_Y , FONT_PRIO_FRONT, FONT_PAL_WHITE, lpstr, 0 );
#endif
#ifdef _CHANNEL_MODIFY
int FontColor = 0 ;
switch(TalkMode){
case 0:
2020-06-23 15:53:23 +08:00
lpstr1 = "一般频道";
2020-06-23 15:27:59 +08:00
break;
case 1:
FontColor = FONT_PAL_GREEN;
2020-06-23 15:53:23 +08:00
lpstr1 = "密语频道";
2020-06-23 15:27:59 +08:00
break;
case 2:
FontColor = FONT_PAL_AQUA;
2020-06-23 15:53:23 +08:00
lpstr1 = "队伍频道";
2020-06-23 15:27:59 +08:00
break;
case 3:
FontColor = FONT_PAL_PURPLE;
2020-06-23 15:53:23 +08:00
lpstr1 = "家族频道";
2020-06-23 15:27:59 +08:00
break;
#ifdef _CHAR_PROFESSION
case 4:
FontColor = FONT_PAL_BLUE2;
2020-06-23 15:53:23 +08:00
lpstr1 = "职业频道";
2020-06-23 15:27:59 +08:00
break;
#else
case 4:
FontColor = FONT_PAL_PURPLE;
2020-06-23 15:53:23 +08:00
lpstr1 = "聊天室频道";
2020-06-23 15:27:59 +08:00
break;
#endif
#ifdef _CHANNEL_WORLD
case 5:
FontColor = FONT_PAL_YELLOW;
2020-06-23 15:53:23 +08:00
lpstr1 = "世界频道";
2020-06-23 15:27:59 +08:00
break;
#endif
#ifdef _CHANNEL_ALL_SERV
case 6:
FontColor = FONT_PAL_GREEN2;
2020-06-23 15:53:23 +08:00
lpstr1 = "星球频道";
2020-06-23 15:27:59 +08:00
break;
#endif
}
StockFontBuffer( 10, 460 + DISPLACEMENT_Y, FONT_PRIO_FRONT, FontColor, lpstr1, 0 );
#else
#ifdef _TELLCHANNEL
int FontColor = 0 ;
switch(TalkMode){
case 0:
2020-06-23 15:53:23 +08:00
lpstr1 = "一般模式";
2020-06-23 15:27:59 +08:00
break;
case 1:
FontColor = FONT_PAL_GREEN;
2020-06-23 15:53:23 +08:00
lpstr1 = "密语模式";
2020-06-23 15:27:59 +08:00
break;
#ifdef _FRIENDCHANNEL
case 2:
FontColor = FONT_PAL_PURPLE;
2020-06-23 15:53:23 +08:00
lpstr1 = "频道模式";
2020-06-23 15:27:59 +08:00
break;
#endif
#ifdef _CHANNEL_WORLD
case 6:
FontColor = FONT_PAL_BLUE;
2020-06-23 15:53:23 +08:00
lpstr1 = "世界模式";
2020-06-23 15:27:59 +08:00
break;
#endif
#ifdef _CHANNEL_ALL_SERV
case 7:
FontColor = FONT_PAL_BLUE;
2020-06-23 15:53:23 +08:00
lpstr1 = "星球模式";
2020-06-23 15:27:59 +08:00
break;
#endif
}
StockFontBuffer( 10, 460 + DISPLACEMENT_Y, FONT_PRIO_FRONT, FontColor, lpstr1, 0 );
#endif
#endif
#ifdef _MO_SHOW_FPS
2020-06-23 15:53:23 +08:00
wsprintf(tmp, "当前FPS:%3d帧/秒 , 跳帧数: %d帧/秒", framesToShow, skipFramesToShow);
2020-06-23 15:27:59 +08:00
StockFontBuffer( 270, 460 + DISPLACEMENT_Y, FONT_PRIO_FRONT, FONT_PAL_YELLOW, tmp, 0 );
#endif
}
}
2020-06-23 15:53:23 +08:00
// Terry add 2003/12/16 for 交易视窗开启时,显示物品说明不显示输入法
2020-06-23 15:27:59 +08:00
bShowItemExplain = FALSE;
// end
}