Added "*" to !UpdateMeasure/!UpdateMeter to update all measures/meters forcibly

This commit is contained in:
spx 2012-11-30 10:57:35 +09:00
parent 2b45f7301d
commit 411f53b1f9

View File

@ -1212,13 +1212,19 @@ void CMeterWindow::MoveMeter(const std::wstring& name, int x, int y)
void CMeterWindow::UpdateMeter(const std::wstring& name, bool group) void CMeterWindow::UpdateMeter(const std::wstring& name, bool group)
{ {
const WCHAR* meter = name.c_str(); const WCHAR* meter = name.c_str();
bool all = false;
if (!group && meter[0] == L'*' && meter[1] == L'\0') // Allow [!UpdateMeter *]
{
all = true;
group = true;
}
bool bActiveTransition = false; bool bActiveTransition = false;
bool bContinue = true; bool bContinue = true;
std::vector<CMeter*>::const_iterator j = m_Meters.begin(); for (auto j = m_Meters.cbegin(); j != m_Meters.cend(); ++j)
for ( ; j != m_Meters.end(); ++j)
{ {
if (bContinue && CompareName((*j), meter, group)) if (all || (bContinue && CompareName((*j), meter, group)))
{ {
UpdateMeter((*j), bActiveTransition, true); UpdateMeter((*j), bActiveTransition, true);
SetResizeWindowMode(RESIZEMODE_CHECK); // Need to recalculate the window size SetResizeWindowMode(RESIZEMODE_CHECK); // Need to recalculate the window size
@ -1322,12 +1328,18 @@ void CMeterWindow::ToggleMeasure(const std::wstring& name, bool group)
void CMeterWindow::UpdateMeasure(const std::wstring& name, bool group) void CMeterWindow::UpdateMeasure(const std::wstring& name, bool group)
{ {
const WCHAR* measure = name.c_str(); const WCHAR* measure = name.c_str();
bool all = false;
if (!group && measure[0] == L'*' && measure[1] == L'\0') // Allow [!UpdateMeasure *]
{
all = true;
group = true;
}
bool bNetStats = m_HasNetMeasures; bool bNetStats = m_HasNetMeasures;
std::vector<CMeasure*>::const_iterator i = m_Measures.begin(); for (auto i = m_Measures.cbegin(); i != m_Measures.cend(); ++i)
for ( ; i != m_Measures.end(); ++i)
{ {
if (CompareName((*i), measure, group)) if (all || CompareName((*i), measure, group))
{ {
if (bNetStats && (*i)->GetTypeID() == TypeID<CMeasureNet>()) if (bNetStats && (*i)->GetTypeID() == TypeID<CMeasureNet>())
{ {