mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
FIXED: DynamicVariables=1 disables UpdateDivider (issue 123)
FIXED: LineColor does not use values of Dynamic Variables in the Line meter (issue 138)
This commit is contained in:
parent
f9d45c7e3b
commit
df3215c487
@ -63,7 +63,7 @@ CMeasure::CMeasure(CMeterWindow* meterWindow)
|
|||||||
m_IfEqualCommited = false;
|
m_IfEqualCommited = false;
|
||||||
m_Disabled = false;
|
m_Disabled = false;
|
||||||
m_UpdateDivider = 1;
|
m_UpdateDivider = 1;
|
||||||
m_UpdateCounter = 0;
|
m_UpdateCounter = 1;
|
||||||
m_MedianPos = 0;
|
m_MedianPos = 0;
|
||||||
m_AveragePos = 0;
|
m_AveragePos = 0;
|
||||||
m_AverageSize = 0;
|
m_AverageSize = 0;
|
||||||
@ -98,8 +98,12 @@ void CMeasure::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
|||||||
|
|
||||||
m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0);
|
m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0);
|
||||||
m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0);
|
m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0);
|
||||||
m_UpdateDivider = parser.ReadInt(section, L"UpdateDivider", 1);
|
|
||||||
m_UpdateCounter = m_UpdateDivider;
|
UINT updateDivider = parser.ReadInt(section, L"UpdateDivider", 1);
|
||||||
|
if (updateDivider != m_UpdateDivider)
|
||||||
|
{
|
||||||
|
m_UpdateCounter = m_UpdateDivider = updateDivider;
|
||||||
|
}
|
||||||
|
|
||||||
m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue);
|
m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue);
|
||||||
m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue);
|
m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue);
|
||||||
|
@ -61,10 +61,26 @@ void CMeterLine::Initialize()
|
|||||||
{
|
{
|
||||||
CMeter::Initialize();
|
CMeter::Initialize();
|
||||||
|
|
||||||
std::vector<Color>::iterator i = m_Colors.begin();
|
if (m_Colors.size() != m_AllValues.size())
|
||||||
for ( ; i != m_Colors.end(); i++)
|
{
|
||||||
|
if (m_Colors.size() > m_AllValues.size())
|
||||||
|
{
|
||||||
|
size_t num = (!m_AllValues.empty()) ? m_AllValues[0].size() : 0;
|
||||||
|
|
||||||
|
for (size_t i = m_AllValues.size(), end = m_Colors.size(); i < end; i++)
|
||||||
{
|
{
|
||||||
m_AllValues.push_back(std::vector<double>());
|
m_AllValues.push_back(std::vector<double>());
|
||||||
|
|
||||||
|
if (num > 0)
|
||||||
|
{
|
||||||
|
m_AllValues.back().assign(num, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_AllValues.resize(m_Colors.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +95,9 @@ void CMeterLine::ReadConfig(const WCHAR* section)
|
|||||||
int i;
|
int i;
|
||||||
WCHAR tmpName[256];
|
WCHAR tmpName[256];
|
||||||
|
|
||||||
|
// Store the current number of lines so we know if the buffer needs to be updated
|
||||||
|
int oldLineCount = (int)m_Colors.size();
|
||||||
|
|
||||||
// Read common configs
|
// Read common configs
|
||||||
CMeter::ReadConfig(section);
|
CMeter::ReadConfig(section);
|
||||||
|
|
||||||
@ -86,6 +105,10 @@ void CMeterLine::ReadConfig(const WCHAR* section)
|
|||||||
|
|
||||||
int lineCount = parser.ReadInt(section, L"LineCount", 1);
|
int lineCount = parser.ReadInt(section, L"LineCount", 1);
|
||||||
|
|
||||||
|
m_Colors.clear();
|
||||||
|
m_ScaleValues.clear();
|
||||||
|
m_MeasureNames.clear();
|
||||||
|
|
||||||
for (i = 0; i < lineCount; i++)
|
for (i = 0; i < lineCount; i++)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
@ -123,6 +146,12 @@ void CMeterLine::ReadConfig(const WCHAR* section)
|
|||||||
m_HorizontalLines = 0!=parser.ReadInt(section, L"HorizontalLines", 0);
|
m_HorizontalLines = 0!=parser.ReadInt(section, L"HorizontalLines", 0);
|
||||||
m_HorizontalColor = parser.ReadColor(section, L"HorizontalColor", Color::Black); // This is left here for backwards compatibility
|
m_HorizontalColor = parser.ReadColor(section, L"HorizontalColor", Color::Black); // This is left here for backwards compatibility
|
||||||
m_HorizontalColor = parser.ReadColor(section, L"HorizontalLineColor", m_HorizontalColor); // This is what it should be
|
m_HorizontalColor = parser.ReadColor(section, L"HorizontalLineColor", m_HorizontalColor); // This is what it should be
|
||||||
|
|
||||||
|
if (m_Initialized &&
|
||||||
|
oldLineCount != lineCount)
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user