64 for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
64 for(int i = 0; strlen(sdlkeys[i][1]) > 0; i++) |
65 { |
65 { |
66 binds << sdlkeys[i][1]; |
66 binds << sdlkeys[i][1]; |
67 } |
67 } |
68 |
68 |
69 for(int i = 0; i < BINDS_NUMBER; i++) |
69 quint16 widind = 0, top = 0; |
70 { |
70 for(quint8 i = 0; i < BINDS_NUMBER; i++) |
71 LBind[i] = new QLabel(ui.GBoxBinds); |
71 { |
72 LBind[i]->setGeometry(QRect(10, 23 + i * 30, 60, 20)); |
72 LBind[i] = new QLabel(ui.BindsBox->widget(widind)); |
|
73 LBind[i]->setGeometry(QRect(10, top + 3, 60, 20)); |
73 LBind[i]->setText(cbinds[i].name); |
74 LBind[i]->setText(cbinds[i].name); |
74 LBind[i]->setAlignment(Qt::AlignRight); |
75 LBind[i]->setAlignment(Qt::AlignRight); |
75 CBBind[i] = new QComboBox(ui.GBoxBinds); |
76 CBBind[i] = new QComboBox(ui.BindsBox->widget(widind)); |
76 CBBind[i]->setGeometry(QRect(80, 20 + i * 30, 80, 20)); |
77 CBBind[i]->setGeometry(QRect(80, top, 80, 20)); |
77 CBBind[i]->addItems(binds); |
78 CBBind[i]->addItems(binds); |
|
79 if (cbinds[i].chwidget) |
|
80 { |
|
81 top = 0; |
|
82 widind++; |
|
83 } else |
|
84 { |
|
85 top += 30; |
|
86 } |
78 } |
87 } |
79 |
88 |
80 QDir tmpdir; |
89 QDir tmpdir; |
81 tmpdir.cd(DATA_PATH); |
90 tmpdir.cd(DATA_PATH); |
82 tmpdir.cd("Forts"); |
91 tmpdir.cd("Forts"); |
134 ui.CBFullscreen->setChecked(str.toLong()); |
143 ui.CBFullscreen->setChecked(str.toLong()); |
135 } |
144 } |
136 } |
145 } |
137 settings.close(); |
146 settings.close(); |
138 } |
147 } |
|
148 |
139 connect(ui.BtnSPBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
149 connect(ui.BtnSPBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
|
150 connect(ui.BtnDemosBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
140 connect(ui.BtnSetupBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
151 connect(ui.BtnSetupBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
141 connect(ui.BtnMPBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
152 connect(ui.BtnMPBack, SIGNAL(clicked()), this, SLOT(GoToMain())); |
142 connect(ui.BtnSinglePlayer, SIGNAL(clicked()), this, SLOT(GoToSinglePlayer())); |
153 connect(ui.BtnSinglePlayer, SIGNAL(clicked()), this, SLOT(GoToSinglePlayer())); |
143 connect(ui.BtnSetup, SIGNAL(clicked()), this, SLOT(GoToSetup())); |
154 connect(ui.BtnSetup, SIGNAL(clicked()), this, SLOT(GoToSetup())); |
144 connect(ui.BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer())); |
155 connect(ui.BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer())); |
|
156 connect(ui.BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos())); |
145 connect(ui.BtnNewTeam, SIGNAL(clicked()), this, SLOT(NewTeam())); |
157 connect(ui.BtnNewTeam, SIGNAL(clicked()), this, SLOT(NewTeam())); |
146 connect(ui.BtnEditTeam, SIGNAL(clicked()), this, SLOT(EditTeam())); |
158 connect(ui.BtnEditTeam, SIGNAL(clicked()), this, SLOT(EditTeam())); |
147 connect(ui.BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave())); |
159 connect(ui.BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave())); |
148 connect(ui.BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard())); |
160 connect(ui.BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard())); |
149 connect(ui.BtnSimpleGame, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
161 connect(ui.BtnSimpleGame, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
150 connect(ui.BtnSaveOptions, SIGNAL(clicked()), this, SLOT(SaveOptions())); |
162 connect(ui.BtnSaveOptions, SIGNAL(clicked()), this, SLOT(SaveOptions())); |
|
163 connect(ui.BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); |
151 connect(ui.CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
164 connect(ui.CBGrave, SIGNAL(activated(const QString &)), this, SLOT(CBGrave_activated(const QString &))); |
152 connect(ui.CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
165 connect(ui.CBFort, SIGNAL(activated(const QString &)), this, SLOT(CBFort_activated(const QString &))); |
153 ui.Pages->setCurrentIndex(ID_PAGE_MAIN); |
166 ui.Pages->setCurrentIndex(ID_PAGE_MAIN); |
154 } |
167 } |
155 |
168 |
170 |
183 |
171 void HWForm::GoToMultiplayer() |
184 void HWForm::GoToMultiplayer() |
172 { |
185 { |
173 ui.Pages->setCurrentIndex(ID_PAGE_MULTIPLAYER); |
186 ui.Pages->setCurrentIndex(ID_PAGE_MULTIPLAYER); |
174 } |
187 } |
|
188 |
|
189 void HWForm::GoToDemos() |
|
190 { |
|
191 QDir tmpdir; |
|
192 tmpdir.cd(DATA_PATH); |
|
193 tmpdir.cd("Demos"); |
|
194 tmpdir.setFilter(QDir::Files); |
|
195 ui.DemosList->addItems(tmpdir.entryList(QStringList("*.hwd_1")).replaceInStrings(QRegExp("^(.*).hwd_1"), "\\1")); |
|
196 ui.Pages->setCurrentIndex(ID_PAGE_DEMOS); |
|
197 } |
|
198 |
175 void HWForm::NewTeam() |
199 void HWForm::NewTeam() |
176 { |
200 { |
177 tmpTeam = new HWTeam("unnamed"); |
201 tmpTeam = new HWTeam("unnamed"); |
178 tmpTeam->SetCfgDir(cfgdir.absolutePath()); |
202 tmpTeam->SetCfgDir(cfgdir.absolutePath()); |
179 tmpTeam->SetToPage(this); |
203 tmpTeam->SetToPage(this); |