1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00
Files
vcmi/mapeditor/PlayerSelectionDialog.h

46 lines
1.0 KiB
C++
Raw Normal View History

/*
* PlayerSelectionDialog.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include <QDialog>
2025-04-13 17:18:13 +02:00
#include <QVBoxLayout>
2025-04-05 18:13:24 +02:00
#include "../lib/constants/EntityIdentifiers.h"
class QRadioButton;
class QButtonGroup;
2025-04-05 18:13:24 +02:00
class MainWindow;
/// Dialog shown when a hero cannot be placed as NEUTRAL.
/// Allows the user to select a valid player via checkboxes,
/// or using the existing keyboard shortcuts from MainWindow's player QActions.
class PlayerSelectionDialog : public QDialog
{
Q_OBJECT
public:
explicit PlayerSelectionDialog(MainWindow * mainWindow);
PlayerColor getSelectedPlayer() const;
private:
2025-04-16 23:44:17 +02:00
const int dialogWidth = 320;
QButtonGroup * buttonGroup;
PlayerColor selectedPlayer;
QFont font;
QVBoxLayout mainLayout;
QVBoxLayout radioButtonsLayout;
2025-04-05 18:13:24 +02:00
void setupDialogComponents();
void addRadioButton(QAction * action, PlayerColor player);
};