mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed how meters are initialized to avoid problems with referencing a Dynamic Section Variable before its meter options are read
This commit is contained in:
parent
4fe98ae296
commit
47781848e7
@ -2181,9 +2181,6 @@ bool CMeterWindow::ReadSkin()
|
|||||||
{
|
{
|
||||||
CMeter* meter = *iter;
|
CMeter* meter = *iter;
|
||||||
m_Meters.push_back(meter);
|
m_Meters.push_back(meter);
|
||||||
|
|
||||||
meter->ReadOptions(m_Parser);
|
|
||||||
meter->Initialize();
|
|
||||||
meter->SetRelativeMeter(prevMeter);
|
meter->SetRelativeMeter(prevMeter);
|
||||||
|
|
||||||
if (!meter->GetToolTipText().empty())
|
if (!meter->GetToolTipText().empty())
|
||||||
@ -2199,8 +2196,8 @@ bool CMeterWindow::ReadSkin()
|
|||||||
prevMeter = meter;
|
prevMeter = meter;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize measures. This is a separate loop to avoid errors caused by
|
// Initialize measures. Separate loop to avoid errors caused by
|
||||||
// referencing not-yet-existent [measures] in the options.
|
// referencing nonexistent [measures] in the measure options.
|
||||||
for (auto iter = measures.cbegin(); iter != measures.cend(); ++iter)
|
for (auto iter = measures.cbegin(); iter != measures.cend(); ++iter)
|
||||||
{
|
{
|
||||||
CMeasure* measure = *iter;
|
CMeasure* measure = *iter;
|
||||||
@ -2208,6 +2205,15 @@ bool CMeterWindow::ReadSkin()
|
|||||||
measure->Initialize();
|
measure->Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize meters. Separate loop to avoid errors caused by referencing
|
||||||
|
// nonexistent [Measures:] in the meter options. (Dynamic Section Variables)
|
||||||
|
for (auto iter = meters.cbegin(); iter != meters.cend(); ++iter)
|
||||||
|
{
|
||||||
|
CMeter* meter = *iter;
|
||||||
|
meter->ReadOptions(m_Parser);
|
||||||
|
meter->Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Meters.empty())
|
if (m_Meters.empty())
|
||||||
{
|
{
|
||||||
std::wstring text = GetFormattedString(ID_STR_NOMETERSINSKIN, m_FolderPath.c_str(), m_FileName.c_str());
|
std::wstring text = GetFormattedString(ID_STR_NOMETERSINSKIN, m_FolderPath.c_str(), m_FileName.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user