mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Merge pull request #1934 from IvanSavenko/beta_fixes
Fixed bugs for 1.2 release
This commit is contained in:
@@ -128,6 +128,7 @@ void BattleActionsController::endCastingSpell()
|
|||||||
if(owner.stacksController->getActiveStack())
|
if(owner.stacksController->getActiveStack())
|
||||||
possibleActions = getPossibleActionsForStack(owner.stacksController->getActiveStack()); //restore actions after they were cleared
|
possibleActions = getPossibleActionsForStack(owner.stacksController->getActiveStack()); //restore actions after they were cleared
|
||||||
|
|
||||||
|
selectedStack = nullptr;
|
||||||
GH.fakeMouseMove();
|
GH.fakeMouseMove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -712,7 +712,11 @@ void CGuiHandler::moveCursorToPosition(const Point & position)
|
|||||||
|
|
||||||
bool CGuiHandler::isKeyboardCtrlDown() const
|
bool CGuiHandler::isKeyboardCtrlDown() const
|
||||||
{
|
{
|
||||||
|
#ifdef VCMI_MAC
|
||||||
|
return SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_LGUI] || SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_RGUI];
|
||||||
|
#else
|
||||||
return SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_LCTRL] || SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_RCTRL];
|
return SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_LCTRL] || SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_RCTRL];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGuiHandler::isKeyboardAltDown() const
|
bool CGuiHandler::isKeyboardAltDown() const
|
||||||
|
@@ -553,7 +553,10 @@ void MainWindow::loadObjectsTree()
|
|||||||
connect(b, &QPushButton::clicked, this, [this, terrain]{ terrainButtonClicked(terrain->getId()); });
|
connect(b, &QPushButton::clicked, this, [this, terrain]{ terrainButtonClicked(terrain->getId()); });
|
||||||
|
|
||||||
//filter
|
//filter
|
||||||
ui->terrainFilterCombo->addItem(QString::fromStdString(terrain->getNameTranslated()));
|
QString displayName = QString::fromStdString(terrain->getNameTranslated());
|
||||||
|
QString uniqueName = QString::fromStdString(terrain->getJsonKey());
|
||||||
|
|
||||||
|
ui->terrainFilterCombo->addItem(displayName, QVariant(uniqueName));
|
||||||
}
|
}
|
||||||
//add spacer to keep terrain button on the top
|
//add spacer to keep terrain button on the top
|
||||||
ui->terrainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
ui->terrainLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
@@ -929,23 +932,24 @@ void MainWindow::treeViewSelected(const QModelIndex & index, const QModelIndex &
|
|||||||
preparePreview(index);
|
preparePreview(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_terrainFilterCombo_currentTextChanged(const QString &arg1)
|
void MainWindow::on_terrainFilterCombo_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if(!objectBrowser)
|
if(!objectBrowser)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QString uniqueName = ui->terrainFilterCombo->itemData(index).toString();
|
||||||
|
|
||||||
objectBrowser->terrain = TerrainId(ETerrainId::ANY_TERRAIN);
|
objectBrowser->terrain = TerrainId(ETerrainId::ANY_TERRAIN);
|
||||||
if (!arg1.isEmpty())
|
if (!uniqueName.isEmpty())
|
||||||
{
|
{
|
||||||
for (auto const & terrain : VLC->terrainTypeHandler->objects)
|
for (auto const & terrain : VLC->terrainTypeHandler->objects)
|
||||||
if (terrain->getJsonKey() == arg1.toStdString())
|
if (terrain->getJsonKey() == uniqueName.toStdString())
|
||||||
objectBrowser->terrain = terrain->getId();
|
objectBrowser->terrain = terrain->getId();
|
||||||
}
|
}
|
||||||
objectBrowser->invalidate();
|
objectBrowser->invalidate();
|
||||||
objectBrowser->sort(0);
|
objectBrowser->sort(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_filter_textChanged(const QString &arg1)
|
void MainWindow::on_filter_textChanged(const QString &arg1)
|
||||||
{
|
{
|
||||||
if(!objectBrowser)
|
if(!objectBrowser)
|
||||||
|
@@ -83,7 +83,7 @@ private slots:
|
|||||||
|
|
||||||
void on_toolErase_clicked();
|
void on_toolErase_clicked();
|
||||||
|
|
||||||
void on_terrainFilterCombo_currentTextChanged(const QString &arg1);
|
void on_terrainFilterCombo_currentIndexChanged(int index);
|
||||||
|
|
||||||
void on_filter_textChanged(const QString &arg1);
|
void on_filter_textChanged(const QString &arg1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user