on multiple champs pick first
This commit is contained in:
parent
b66e6740d8
commit
a63143c3df
|
@ -201,7 +201,7 @@ const DataDragon::ChampData& DataDragon::getBestMatchingChamp(const std::string&
|
|||
}
|
||||
|
||||
if(count) *count = bestmatchingcount;
|
||||
if(bestmatchingcount == 1 && bestmatchingoffset >= 0)
|
||||
if(bestmatchingoffset >= 0)
|
||||
return champs.at(bestmatchingoffset);
|
||||
|
||||
return EMPTYCHAMP;
|
||||
|
|
|
@ -48,18 +48,23 @@ void StageSettings::resizeEvent([[maybe_unused]] QResizeEvent* event) {
|
|||
}
|
||||
|
||||
void StageSettings::championChangedinternal(const QString& str) {
|
||||
emit championChanged(str);
|
||||
QString emitting = str;
|
||||
|
||||
if(dd) {
|
||||
int count = 0;
|
||||
const DataDragon::ChampData& cd = dd->getBestMatchingChamp(str.toStdString(), &count);
|
||||
if(cd.key != currentdisplayedChampKey) {
|
||||
img = (cd.id.empty()) ? cv::Mat() : dd->getImage(cd.id);
|
||||
img = (cd.key < 0) ? cv::Mat() : dd->getImage(cd.id);
|
||||
currentdisplayedChampKey = cd.key;
|
||||
if(cd.key >= 0) {
|
||||
emitting = QString::fromStdString(cd.name);
|
||||
}
|
||||
}
|
||||
ui->champcount->setText(tr("Champions matched: %1").arg(QString::fromStdString(std::to_string(count))));
|
||||
rescaleImage();
|
||||
}
|
||||
|
||||
emit championChanged(emitting);
|
||||
}
|
||||
|
||||
void StageSettings::toggledinternal(int state) {
|
||||
|
|
Loading…
Reference in New Issue