mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-02 23:07:36 +02:00
Quest Log: block hide complete button when it useless
We only want to to be checkable when there is actually any complete quests in list.
This commit is contained in:
parent
ae20499854
commit
c0b78de6b4
@ -150,14 +150,21 @@ void CQuestLog::recreateLabelList()
|
|||||||
if (labels.size())
|
if (labels.size())
|
||||||
labels.clear();
|
labels.clear();
|
||||||
|
|
||||||
|
bool completeMissing = true;
|
||||||
int currentLabel = 0;
|
int currentLabel = 0;
|
||||||
for (int i = 0; i < quests.size(); ++i)
|
for (int i = 0; i < quests.size(); ++i)
|
||||||
{
|
{
|
||||||
// Quests with MISSION_NONE type don't have text for them and can't be displayed
|
// Quests with MISSION_NONE type don't have text for them and can't be displayed
|
||||||
if (quests[i].quest->missionType == CQuest::MISSION_NONE
|
if (quests[i].quest->missionType == CQuest::MISSION_NONE)
|
||||||
|| (hideComplete && quests[i].quest->progress == CQuest::COMPLETE))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (quests[i].quest->progress == CQuest::COMPLETE)
|
||||||
|
{
|
||||||
|
completeMissing = false;
|
||||||
|
if (hideComplete)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
MetaString text;
|
MetaString text;
|
||||||
quests[i].quest->getRolloverText (text, false);
|
quests[i].quest->getRolloverText (text, false);
|
||||||
if (quests[i].obj)
|
if (quests[i].obj)
|
||||||
@ -185,6 +192,9 @@ void CQuestLog::recreateLabelList()
|
|||||||
currentLabel = labels.size();
|
currentLabel = labels.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (completeMissing) // We can't use block(completeMissing) because if false button state reset to NORMAL
|
||||||
|
hideCompleteButton->block(true);
|
||||||
|
|
||||||
slider->setAmount(currentLabel);
|
slider->setAmount(currentLabel);
|
||||||
if (currentLabel > QUEST_COUNT)
|
if (currentLabel > QUEST_COUNT)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user