author | waspe <waspe> | 2003-03-30 11:30:54 (UTC) |
---|---|---|
committer | waspe <waspe> | 2003-03-30 11:30:54 (UTC) |
commit | 3065a1c13bec5d0b101bec48ff666d45a02ce8a6 (patch) (unidiff) | |
tree | f8fe8d3eba81ef4e371c12f530be9cd4debc895b /noncore/games/backgammon/rulesdialog.cpp | |
parent | 87ba3646367397e149979a8477a33239cb341e99 (diff) | |
download | opie-3065a1c13bec5d0b101bec48ff666d45a02ce8a6.zip opie-3065a1c13bec5d0b101bec48ff666d45a02ce8a6.tar.gz opie-3065a1c13bec5d0b101bec48ff666d45a02ce8a6.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/games/backgammon/rulesdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/backgammon/rulesdialog.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/noncore/games/backgammon/rulesdialog.cpp b/noncore/games/backgammon/rulesdialog.cpp new file mode 100644 index 0000000..85c3db3 --- a/dev/null +++ b/noncore/games/backgammon/rulesdialog.cpp | |||
@@ -0,0 +1,77 @@ | |||
1 | #include "rulesdialog.h" | ||
2 | |||
3 | #include <qgroupbox.h> | ||
4 | #include <qlabel.h> | ||
5 | |||
6 | RulesDialog::RulesDialog(QWidget* parent,const char* name,bool modal,WFlags f) | ||
7 | : QDialog(parent,name,modal,f) | ||
8 | { | ||
9 | setCaption("Rules Configuration"); | ||
10 | QLabel* header=new QLabel("<b>Change the game rules here</b>",this); | ||
11 | header->setGeometry(10,10,200,20); | ||
12 | |||
13 | // | ||
14 | QGroupBox* pieces_out_box=new QGroupBox("Movement",this); | ||
15 | pieces_out_box->setGeometry(10,10,220,120); | ||
16 | |||
17 | pieces_out=new QCheckBox("Don't care about others",pieces_out_box); | ||
18 | pieces_out->setGeometry(10,20,200,20); | ||
19 | connect(pieces_out,SIGNAL(clicked()),this,SLOT(pieces_out_clicked())); | ||
20 | |||
21 | QLabel* pieces_out_help=new QLabel("allow movement of the pieses\neven if there are pieces knocked\nout by the opponent",pieces_out_box); | ||
22 | pieces_out_help->setGeometry(10,40,200,60); | ||
23 | |||
24 | // | ||
25 | QGroupBox* nice_dice_box=new QGroupBox("Dice",this); | ||
26 | nice_dice_box->setGeometry(10,140,220,120); | ||
27 | |||
28 | nice_dice=new QCheckBox("Big dice for small numbers",nice_dice_box); | ||
29 | nice_dice->setGeometry(10,20,200,20); | ||
30 | connect(nice_dice,SIGNAL(clicked()),this,SLOT(nice_dice_clicked())); | ||
31 | |||
32 | QLabel* nice_dice_help=new QLabel("allow to rescue pieces with dice\nvalues graeter than the distance\nto the players endzone.",nice_dice_box); | ||
33 | nice_dice_help->setGeometry(10,40,200,60); | ||
34 | |||
35 | showMaximized(); | ||
36 | } | ||
37 | |||
38 | |||
39 | RulesDialog::~RulesDialog() | ||
40 | { | ||
41 | } | ||
42 | |||
43 | void RulesDialog::pieces_out_clicked() | ||
44 | { | ||
45 | if(pieces_out->isChecked()) | ||
46 | rules.move_with_pieces_out=true; | ||
47 | else | ||
48 | rules.move_with_pieces_out=false; | ||
49 | } | ||
50 | |||
51 | void RulesDialog::nice_dice_clicked() | ||
52 | { | ||
53 | if(nice_dice->isChecked()) | ||
54 | rules.generous_dice=true; | ||
55 | else | ||
56 | rules.generous_dice=false; | ||
57 | } | ||
58 | |||
59 | void RulesDialog::setRules(const Rules& new_rules) | ||
60 | { | ||
61 | rules=new_rules; | ||
62 | if(rules.move_with_pieces_out) | ||
63 | pieces_out->setChecked(true); | ||
64 | else | ||
65 | pieces_out->setChecked(false); | ||
66 | |||
67 | if(rules.generous_dice) | ||
68 | nice_dice->setChecked(true); | ||
69 | else | ||
70 | nice_dice->setChecked(false); | ||
71 | } | ||
72 | |||
73 | Rules RulesDialog::getRules() | ||
74 | { | ||
75 | return rules; | ||
76 | } | ||
77 | |||