mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Script: Add default value support for SKIN:GetVariable
This commit is contained in:
parent
5fd98509cf
commit
7558666b13
@ -104,13 +104,17 @@ static int GetMeasure(lua_State* L)
|
||||
static int GetVariable(lua_State* L)
|
||||
{
|
||||
DECLARE_SELF(L)
|
||||
std::wstring strTmp = LuaManager::ToWide(2);
|
||||
|
||||
const std::wstring* value = self->GetParser().GetVariable(strTmp);
|
||||
const std::wstring name = LuaManager::ToWide(2);
|
||||
const std::wstring* value = self->GetParser().GetVariable(name);
|
||||
if (value)
|
||||
{
|
||||
LuaManager::PushWide(*value);
|
||||
}
|
||||
else if (lua_gettop(L) >= 3)
|
||||
{
|
||||
lua_pushvalue(L, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pushnil(L);
|
||||
|
Loading…
Reference in New Issue
Block a user