QTfrontend/gamecfgwidget.cpp
changeset 697 44f167938201
parent 696 d6f32ed6edc8
child 703 424297e3165a
equal deleted inserted replaced
696:d6f32ed6edc8 697:44f167938201
    53 
    53 
    54 	L_TurnTime = new QLabel(QLabel::tr("Turn time"), GBoxOptions);
    54 	L_TurnTime = new QLabel(QLabel::tr("Turn time"), GBoxOptions);
    55 	L_InitHealth = new QLabel(QLabel::tr("Initial health"), GBoxOptions);
    55 	L_InitHealth = new QLabel(QLabel::tr("Initial health"), GBoxOptions);
    56 	GBoxOptionsLayout->addWidget(L_TurnTime, 1, 0);
    56 	GBoxOptionsLayout->addWidget(L_TurnTime, 1, 0);
    57 	GBoxOptionsLayout->addWidget(L_InitHealth, 2, 0);
    57 	GBoxOptionsLayout->addWidget(L_InitHealth, 2, 0);
       
    58 	GBoxOptionsLayout->addWidget(new QLabel(QLabel::tr("Weapons"), GBoxOptions), 3, 0);
    58 
    59 
    59 	SB_TurnTime = new QSpinBox(GBoxOptions);
    60 	SB_TurnTime = new QSpinBox(GBoxOptions);
    60 	SB_TurnTime->setRange(15, 90);
    61 	SB_TurnTime->setRange(15, 90);
    61 	SB_TurnTime->setValue(45);
    62 	SB_TurnTime->setValue(45);
    62 	SB_TurnTime->setSingleStep(15);
    63 	SB_TurnTime->setSingleStep(15);
    64 	SB_InitHealth->setRange(50, 200);
    65 	SB_InitHealth->setRange(50, 200);
    65 	SB_InitHealth->setValue(100);
    66 	SB_InitHealth->setValue(100);
    66 	SB_InitHealth->setSingleStep(25);
    67 	SB_InitHealth->setSingleStep(25);
    67 	GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1);
    68 	GBoxOptionsLayout->addWidget(SB_TurnTime, 1, 1);
    68 	GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1);
    69 	GBoxOptionsLayout->addWidget(SB_InitHealth, 2, 1);
    69 
    70 	WeaponsName = new QComboBox(GBoxOptions);
    70 	QGroupBox *GBoxWeapons = new QGroupBox(this);
    71 	GBoxOptionsLayout->addWidget(WeaponsName, 3, 1);
    71 	GBoxWeapons->setTitle(QGroupBox::tr("Weapons"));
       
    72 	QHBoxLayout* lt=new QHBoxLayout(GBoxWeapons);
       
    73 	WeaponsName = new QComboBox(GBoxWeapons);
       
    74 	lt->addWidget(WeaponsName);
       
    75 	mainLayout.addWidget(GBoxWeapons);
       
    76 
    72 
    77 	mainLayout.addWidget(new QWidget(this), 100);
    73 	mainLayout.addWidget(new QWidget(this), 100);
    78 
    74 
    79 	connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int)));
    75 	connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int)));
    80 	connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int)));
    76 	connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int)));
    81 	connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool)));
    77 	connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool)));
       
    78 	connect(WeaponsName, SIGNAL(activated(const QString&)), this, SIGNAL(newWeaponsName(const QString&)));
    82 
    79 
    83 	connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(onSeedChanged(const QString &)));
    80 	connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(onSeedChanged(const QString &)));
    84 	connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(onThemeChanged(const QString &)));
    81 	connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(onThemeChanged(const QString &)));
    85 	connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(onMapChanged(const QString &)));
    82 	connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(onMapChanged(const QString &)));
    86 }
    83 }
   114 }
   111 }
   115 
   112 
   116 quint32 GameCFGWidget::getTurnTime() const
   113 quint32 GameCFGWidget::getTurnTime() const
   117 {
   114 {
   118 	return SB_TurnTime->value();
   115 	return SB_TurnTime->value();
       
   116 }
       
   117 
       
   118 QString GameCFGWidget::getNetAmmo() const
       
   119 {
       
   120   return curNetAmmo;
   119 }
   121 }
   120 
   122 
   121 QStringList GameCFGWidget::getFullConfig() const
   123 QStringList GameCFGWidget::getFullConfig() const
   122 {
   124 {
   123 	QStringList sl;
   125 	QStringList sl;
   188 
   190 
   189 void GameCFGWidget::onThemeChanged(const QString & theme)
   191 void GameCFGWidget::onThemeChanged(const QString & theme)
   190 {
   192 {
   191 	emit themeChanged(theme);
   193 	emit themeChanged(theme);
   192 }
   194 }
       
   195 
       
   196 void GameCFGWidget::setNetAmmo(const QString& ammo)
       
   197 {
       
   198   curNetAmmo=ammo;
       
   199 }