11
This commit is contained in:
@@ -935,6 +935,44 @@ int squirrel::RegisterItemColor_STL(uint32_t v)
|
||||
}
|
||||
#endif
|
||||
|
||||
//设置文字HOOK
|
||||
#ifdef CODEDRAW
|
||||
struct CodeDrawObj
|
||||
{
|
||||
int Color;
|
||||
std::string str;
|
||||
};
|
||||
std::map< std::string , CodeDrawObj>CodeDrawMap;
|
||||
int squirrel::RegisterCodeDraw_STL(uint32_t v)
|
||||
{
|
||||
int Clolr;
|
||||
wchar_t* Key;
|
||||
wchar_t* OutPutBuffer;
|
||||
int ParameterNum = SQGetTop(v);
|
||||
if (ParameterNum == 4)
|
||||
{
|
||||
SQGetString(v, 2, &Key);
|
||||
SQGetInt(v, 3, &Clolr);
|
||||
SQGetString(v, 4, &OutPutBuffer);
|
||||
|
||||
char* OutPutKey = DNFTOOL::SquirrelU2W(Key);
|
||||
std::string BufferKey = OutPutKey;
|
||||
delete[]OutPutKey;
|
||||
|
||||
char* OutPutText = DNFTOOL::SquirrelU2W(OutPutBuffer);
|
||||
std::string str = OutPutText;
|
||||
delete[]OutPutText;
|
||||
|
||||
CodeDrawObj buffobj;
|
||||
buffobj.Color = Clolr;
|
||||
buffobj.str = str;
|
||||
CodeDrawMap[BufferKey] = buffobj;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//普通 STL
|
||||
#if defined NORMAL_STL
|
||||
//查询 类型容器
|
||||
@@ -1904,6 +1942,11 @@ void squirrel::R_Register_Nut()
|
||||
RegisterNutApi(L"L_RegisterItemColor_STL", squirrel::RegisterItemColor_STL);//注册Item颜色
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CODEDRAW
|
||||
RegisterNutApi(L"L_RegisterCodeDraw_STL", squirrel::RegisterCodeDraw_STL);//注册文字绘制HOOK
|
||||
#endif
|
||||
|
||||
//龙盒
|
||||
#if defined DRAGONBOX_SWITCH
|
||||
//RegisterNutApi(L"L_Get_DragonModel", squirrel::Get_DragonModel);//获取龙盒模式
|
||||
@@ -1917,6 +1960,8 @@ void squirrel::R_Register_Nut()
|
||||
//线程循环调用Sqr回调函数
|
||||
void squirrel::SqrCallBackFunc()
|
||||
{
|
||||
#ifndef DOFILE_HOOK
|
||||
#ifndef SELL
|
||||
static int SqrCallBackFuncTimer = clock();
|
||||
int NowTime = clock();
|
||||
if ((NowTime - SqrCallBackFuncTimer) >= 2000)
|
||||
@@ -1935,7 +1980,8 @@ void squirrel::SqrCallBackFunc()
|
||||
|
||||
SqrCallBackFuncTimer = NowTime;
|
||||
}
|
||||
|
||||
#endif // !DOFILE_HOOK
|
||||
#endif // !DOFILE_HOOK
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user