forked from teamnwah/openmw-tes3coop
Merge branch 'master' into tooltips
This commit is contained in:
commit
cc365c5bcb
2 changed files with 20 additions and 2 deletions
|
@ -54,6 +54,20 @@ namespace
|
|||
return lowerCase;
|
||||
}
|
||||
|
||||
bool stringCompareNoCase (std::string first, std::string second)
|
||||
{
|
||||
unsigned int i=0;
|
||||
while ( (i<first.length()) && (i<second.length()) )
|
||||
{
|
||||
if (tolower(first[i])<tolower(second[i])) return true;
|
||||
else if (tolower(first[i])>tolower(second[i])) return false;
|
||||
++i;
|
||||
}
|
||||
if (first.length()<second.length())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T1, typename T2>
|
||||
bool selectCompare (char comp, T1 value1, T2 value2)
|
||||
|
@ -723,7 +737,11 @@ namespace MWDialogue
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sort again, because the previous sort was case-sensitive
|
||||
keywordList.sort(stringCompareNoCase);
|
||||
win->setKeywords(keywordList);
|
||||
|
||||
mChoice = choice;
|
||||
}
|
||||
|
||||
|
@ -815,7 +833,7 @@ namespace MWDialogue
|
|||
{
|
||||
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
||||
win->askQuestion(question);
|
||||
mChoiceMap[question] = choice;
|
||||
mChoiceMap[toLower(question)] = choice;
|
||||
mIsInChoice = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
|||
UString key = history->getColorTextAt(cursorPosition);
|
||||
if(color == "#686EBA") MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(key));
|
||||
|
||||
if(color == "#572D21") MWBase::Environment::get().getDialogueManager()->questionAnswered(key);
|
||||
if(color == "#572D21") MWBase::Environment::get().getDialogueManager()->questionAnswered(lower_string(key));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue