mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-29 20:34:56 +01:00
Support explosive games in the Qt interface
This commit is contained in:
parent
8b9478542a
commit
d913be52a0
3 changed files with 79 additions and 4 deletions
|
@ -145,6 +145,8 @@ PublicGame * NewGame::createGame(const Dictionary &iDic) const
|
||||||
// Joker game?
|
// Joker game?
|
||||||
if (checkBoxJoker->isChecked())
|
if (checkBoxJoker->isChecked())
|
||||||
game->setVariant(PublicGame::kJOKER);
|
game->setVariant(PublicGame::kJOKER);
|
||||||
|
if (checkBoxExplosive->isChecked())
|
||||||
|
game->setVariant(PublicGame::kEXPLOSIVE);
|
||||||
|
|
||||||
return game;
|
return game;
|
||||||
}
|
}
|
||||||
|
@ -216,6 +218,18 @@ void NewGame::on_pushButtonRemove_clicked()
|
||||||
m_model->removeRow(indexList.front().row());
|
m_model->removeRow(indexList.front().row());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NewGame::on_checkBoxJoker_stateChanged(int newState)
|
||||||
|
{
|
||||||
|
if (newState == Qt::Checked)
|
||||||
|
checkBoxExplosive->setChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NewGame::on_checkBoxExplosive_stateChanged(int newState)
|
||||||
|
{
|
||||||
|
if (newState == Qt::Checked)
|
||||||
|
checkBoxJoker->setChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PlayersTypeDelegate::PlayersTypeDelegate(QObject *parent)
|
PlayersTypeDelegate::PlayersTypeDelegate(QObject *parent)
|
||||||
|
|
|
@ -57,6 +57,8 @@ private slots:
|
||||||
void on_comboBoxMode_activated(int);
|
void on_comboBoxMode_activated(int);
|
||||||
void on_pushButtonAdd_clicked();
|
void on_pushButtonAdd_clicked();
|
||||||
void on_pushButtonRemove_clicked();
|
void on_pushButtonRemove_clicked();
|
||||||
|
void on_checkBoxJoker_stateChanged(int);
|
||||||
|
void on_checkBoxExplosive_stateChanged(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Model of the players
|
/// Model of the players
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>470</width>
|
<width>473</width>
|
||||||
<height>390</height>
|
<height>425</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
@ -22,6 +22,12 @@
|
||||||
<string>_("Game type")</string>
|
<string>_("Game type")</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" >
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3" >
|
<widget class="QLabel" name="label_3" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
|
@ -62,12 +68,53 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBoxJoker" >
|
<widget class="QLabel" name="label_5" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>_("Joker game")</string>
|
<string>_("Variant:")</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxJoker" >
|
||||||
|
<property name="toolTip" >
|
||||||
|
<string>_("In a joker game, each rack contains a joker. When a word containing
|
||||||
|
the joker is played on the grid, the joker is then replaced by the
|
||||||
|
corresponding letter from the bag, and the joker stays in the rack.
|
||||||
|
When the corresponding letter is not present in the bag, the joker is
|
||||||
|
placed on the board.
|
||||||
|
This variant, particularly interesting in Duplicate mode, is good to train
|
||||||
|
using the joker.")</string>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>_("Joker game")</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxExplosive" >
|
||||||
|
<property name="toolTip" >
|
||||||
|
<string>_("An explosive game is a bit like a joker game, except than when the
|
||||||
|
computer chooses the rack (containing a joker), it performs a search and
|
||||||
|
finds the best word possible with the rack. Then, if possible, it replaces
|
||||||
|
the joker in the rack with the letter allowing to play this best word.
|
||||||
|
This variant, unlike the joker game, allows playing with a normal-looking
|
||||||
|
rack, but it usually gives much higher scores than in a normal game.")</string>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string>_("Explosive game")</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -195,6 +242,18 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>buttonBox</tabstop>
|
||||||
|
<tabstop>comboBoxMode</tabstop>
|
||||||
|
<tabstop>checkBoxJoker</tabstop>
|
||||||
|
<tabstop>checkBoxExplosive</tabstop>
|
||||||
|
<tabstop>treeViewPlayers</tabstop>
|
||||||
|
<tabstop>lineEditName</tabstop>
|
||||||
|
<tabstop>comboBoxType</tabstop>
|
||||||
|
<tabstop>spinBoxLevel</tabstop>
|
||||||
|
<tabstop>pushButtonAdd</tabstop>
|
||||||
|
<tabstop>pushButtonRemove</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
|
Loading…
Add table
Reference in a new issue