mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweaks
This commit is contained in:
@ -69,16 +69,19 @@ void LuaManager::ReportErrors(lua_State* L, const std::wstring& file)
|
||||
}
|
||||
|
||||
std::wstring str(file, file.find_last_of(L'\\') + 1);
|
||||
str += ConvertToWide(error);
|
||||
str += StringUtil::Widen(error);
|
||||
LogWithArgs(LOG_ERROR, L"Script: %s", str.c_str());
|
||||
}
|
||||
|
||||
void LuaManager::PushWide(lua_State* L, const WCHAR* str)
|
||||
{
|
||||
lua_pushstring(L, ConvertToAscii(str).c_str());
|
||||
const std::string tmpStr = StringUtil::Narrow(str);
|
||||
lua_pushlstring(L, tmpStr.c_str(), tmpStr.length());
|
||||
}
|
||||
|
||||
std::wstring LuaManager::ToWide(lua_State* L, int narg)
|
||||
{
|
||||
return ConvertToWide(lua_tostring(L, narg));
|
||||
size_t strLen = 0;
|
||||
const char* str = lua_tolstring(L, narg, &strLen);
|
||||
return StringUtil::Widen(str, (int)strLen);
|
||||
}
|
||||
|
@ -206,8 +206,9 @@ int LuaScript::RunFunctionWithReturn(const char* funcName, double& numValue, std
|
||||
}
|
||||
else if (type == LUA_TSTRING)
|
||||
{
|
||||
const char* str = lua_tostring(L, -1);
|
||||
strValue = ConvertToWide(str);
|
||||
size_t strLen = 0;
|
||||
const char* str = lua_tolstring(L, -1, &strLen);
|
||||
strValue = StringUtil::Widen(str, (int)strLen);
|
||||
numValue = strtod(str, NULL);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ static int Print(lua_State* L)
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
Log(LOG_DEBUG, ConvertToWide(message.c_str()).c_str());
|
||||
Log(LOG_DEBUG, StringUtil::Widen(message).c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user