mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- Script: Fixed that AutoScale/Scale/Percentual/NumOfDecimals were not applied for MeasureName=ScriptMeasure
- NowPlayingPlugin: OpenPlayer bang with foobar2000 now opens foobar2000 maximized regardless of previous state
This commit is contained in:
parent
b16d3d0762
commit
6dfb307636
@ -98,11 +98,8 @@ bool CMeasureScript::Update()
|
||||
if (!(m_HasUpdateFunction && m_LuaScript->RunFunctionWithReturn(g_UpdateFunctionName, m_Value, m_StringValue)) &&
|
||||
!(m_HasGetStringFunction && m_LuaScript->RunFunctionWithReturn(g_GetStringFunctionName, m_Value, m_StringValue)))
|
||||
{
|
||||
if (!m_StringValue.empty())
|
||||
{
|
||||
m_Value = 0;
|
||||
m_StringValue.clear();
|
||||
}
|
||||
m_Value = 0;
|
||||
m_StringValue.clear();
|
||||
}
|
||||
|
||||
return PostUpdate();
|
||||
@ -116,7 +113,12 @@ bool CMeasureScript::Update()
|
||||
*/
|
||||
const WCHAR* CMeasureScript::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual)
|
||||
{
|
||||
return CheckSubstitute(m_StringValue.c_str());
|
||||
if (!m_StringValue.empty())
|
||||
{
|
||||
return CheckSubstitute(m_StringValue.c_str());
|
||||
}
|
||||
|
||||
return CMeasure::GetStringValue(autoScale, scale, decimals, percentual);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -146,7 +146,7 @@ void LuaScript::RunFunction(const char* funcName)
|
||||
/*
|
||||
** RunFunctionWithReturn
|
||||
**
|
||||
** Runs given function in script file and stores the retruned number and/or string.
|
||||
** Runs given function in script file and stores the retruned number or string.
|
||||
** Returns true if the executed function returns a valid value.
|
||||
**
|
||||
*/
|
||||
@ -169,15 +169,19 @@ bool LuaScript::RunFunctionWithReturn(const char* funcName, double& numValue, st
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lua_isstring(m_State, -1))
|
||||
if (lua_isnumber(m_State, -1))
|
||||
{
|
||||
numValue = lua_tonumber(m_State, -1);
|
||||
|
||||
strValue.clear();
|
||||
ret = true;
|
||||
}
|
||||
else if (lua_isstring(m_State, -1))
|
||||
{
|
||||
// Type is LUA_TSTRING or LUA_TNUMBER
|
||||
const char* str = lua_tostring(m_State, -1);
|
||||
strValue = ConvertToWide(str);
|
||||
|
||||
// lua_tonumber() returns 0 when type is non-number
|
||||
numValue = lua_tonumber(m_State, -1);
|
||||
|
||||
numValue = 0;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,8 @@ extern HINSTANCE g_Instance;
|
||||
*/
|
||||
CPlayerFoobar::CPlayerFoobar() : CPlayer(),
|
||||
m_Window(),
|
||||
m_FooWindow()
|
||||
m_FooWindow(),
|
||||
m_MaximizeOnStart(false)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@ -178,6 +179,12 @@ LRESULT CALLBACK CPlayerFoobar::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
|
||||
case FOO_PLAYERSTART:
|
||||
player->m_Initialized = true;
|
||||
player->m_FooWindow = (HWND)wParam;
|
||||
|
||||
if (player->m_MaximizeOnStart)
|
||||
{
|
||||
SendMessage(player->m_FooWindow, WM_USER, 0, FOO_SHOWPLAYER);
|
||||
player->m_MaximizeOnStart = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case FOO_PLAYERQUIT:
|
||||
@ -430,6 +437,7 @@ void CPlayerFoobar::OpenPlayer(std::wstring& path)
|
||||
else
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
m_MaximizeOnStart = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -81,6 +81,7 @@ private:
|
||||
|
||||
HWND m_Window; // Our reciever window
|
||||
HWND m_FooWindow; // Foobar receiver window
|
||||
bool m_MaximizeOnStart;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user