1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

vcmi: actually implement AUTO for CInfoWindow

This is possible to use infobar interactions now.
This commit is contained in:
Konstantin
2023-03-07 03:29:04 +03:00
parent 75358a68a7
commit a0c644a0e5
10 changed files with 138 additions and 21 deletions

View File

@@ -1034,11 +1034,18 @@ void CPlayerInterface::yourTacticPhase(int distance)
void CPlayerInterface::showInfoDialog(EInfoWindowMode type, const std::string &text, const std::vector<Component> & components, int soundID)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
if(type == InfoWindow::INFO) {
adventureInt->infoBar->showComponents(components, text);
if (makingTurn && GH.listInt.size() && LOCPLINT == this)
CCS->soundh->playSound(static_cast<soundBase::soundID>(soundID));
return;
bool autoTryHover = settings["gameTweaks"]["infoBarPick"].Bool() && type == EInfoWindowMode::AUTO;
auto timer = type == EInfoWindowMode::INFO ? 3000 : 4500; //Implement long info windows like in HD mod
if(autoTryHover || type == EInfoWindowMode::INFO)
{
if(adventureInt->infoBar->tryShowComponents(components, text, timer))
{
if (makingTurn && GH.listInt.size() && LOCPLINT == this)
CCS->soundh->playSound(static_cast<soundBase::soundID>(soundID));
return;
}
}
if (settings["session"]["autoSkip"].Bool() && !GH.isKeyboardShiftDown())