File indexing completed on 2024-04-21 04:03:43

0001 /*
0002     SPDX-FileCopyrightText: 2003 Russell Steffen <rsteffen@bayarea.net>
0003     SPDX-FileCopyrightText: 2003 Stephan Zehetner <s.zehetner@nevox.org>
0004     SPDX-FileCopyrightText: 2006 Dmitry Suzdalev <dimsuz@gmail.com>
0005     SPDX-FileCopyrightText: 2006 Inge Wallin <inge@lysator.liu.se>
0006     SPDX-FileCopyrightText: 2006 Pierre Ducroquet <pinaraf@gmail.com>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef KONQUEST_NEWGAMEDLG_H
0012 #define KONQUEST_NEWGAMEDLG_H
0013 
0014 
0015 #include <QDialog>
0016 
0017 #include "planet.h"
0018 #include "minimapview.h"
0019 #include "ui_newGameDialog.h"
0020 #include "../players/player.h"
0021 #include "../players/player_gui.h"
0022 
0023 
0024 // Maximum Number of Players
0025 #define MAX_PLAYERS 10
0026 
0027 
0028 class NewGameDlgUI : public QWidget, public Ui::newGameDialog
0029 {
0030 public:
0031     explicit NewGameDlgUI( QWidget *parent ) : QWidget( parent ) {
0032     setupUi( this );
0033     }
0034         ~NewGameDlgUI() override {}
0035 };
0036 
0037 
0038 /*************************************************************************
0039  New Game Dialog
0040  ************************************************************************/
0041 
0042 
0043 class NewGameDlg : public QDialog
0044 {
0045 public:
0046     NewGameDlg( QWidget *parent, Game *game);
0047     ~NewGameDlg() override;
0048 
0049     void  save();
0050 
0051 protected:
0052     void  slotNewMap();
0053     void  slotUpdateNeutrals(int);
0054     void  slotAddPlayer(int);
0055     void  slotRemovePlayer();
0056 
0057     void  slotUpdateSelection(const Coordinate &coord);
0058     void  slotNewOwner(int);
0059     void  slotNewKillPercentage(double);
0060     void  slotNewProduction(int);
0061 
0062 public:
0063     void  updateButtonOk();
0064 
0065 private:
0066     void  updateOwnerCB();
0067     void  init();
0068 
0069     QList<PlayerGui *> m_selectablePlayer;
0070     QMenu            *m_playerTypeChooser;
0071     QPushButton      *okButton;
0072 
0073     Game             *m_game;
0074     Player           *m_neutral;
0075 
0076     NewGameDlgUI     *m_w;
0077 };
0078 
0079 #endif // KONQUEST_NEWGAMEDLG_H