Skip to content

Commit

Permalink
fix 'Track as %' not being checked when opening an active achievement…
Browse files Browse the repository at this point in the history
… using it
  • Loading branch information
Jamiras committed Mar 6, 2022
1 parent 4f2ff6a commit c5f2fe6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/viewmodels/TriggerViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void TriggerViewModel::InitializeGroups(const rc_trigger_t& pTrigger)
m_vGroups.RemoveNotifyTarget(*this);
m_vGroups.BeginUpdate();

SetMeasuredTrackedAsPercent(m_pTrigger != nullptr ? m_pTrigger->measured_as_percent : false);
SetMeasuredTrackedAsPercent(pTrigger.measured_as_percent);

// this will not update the conditions collection because OnValueChange ignores it when m_vGroups.IsUpdating
SetSelectedGroupIndex(0);
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/viewmodels/TriggerViewModel_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ TEST_CLASS(TriggerViewModel_Tests)
ParseAndRegenerate("0xH1234=0xH2345"); // one condition
ParseAndRegenerate("0xH1234=0xH2345_0xX5555=1.3._R:0x face=678"); // several conditions
ParseAndRegenerate("I:0x 1234_A:0xH2345_0xH7777=345"); // addsource/addaddress chain
ParseAndRegenerate("M:0xH1234>3"); // measured (not as percent)
ParseAndRegenerate("Q:0xH1234>3"); // measured (as percent)
}

TEST_METHOD(TestParseAndRegenerateWithAlts)
Expand Down

0 comments on commit c5f2fe6

Please sign in to comment.