Commit ddf310afe3bd37bac4aacc09ea5910ef941564a7

Authored by Carlos Picanco
1 parent 84ecb738
Exists in master

experiment designer - improve gui and persistence

- Add Gui to OnStart A,B,Individual and Group Points
- Add Open and SaveAs MenuItems
- fix some persistence bugs
experiment_designer/form_main.lfm
1 object FormDesigner: TFormDesigner 1 object FormDesigner: TFormDesigner
2 - Left = 127 2 + Left = 0
3 Height = 712 3 Height = 712
4 Top = 29 4 Top = 29
5 Width = 674 5 Width = 674
6 - HorzScrollBar.Page = 387 6 + HorzScrollBar.Page = 346
7 VertScrollBar.Page = 693 7 VertScrollBar.Page = 693
8 AutoScroll = True 8 AutoScroll = True
9 Caption = 'Planejar Experimento' 9 Caption = 'Planejar Experimento'
@@ -13,17 +13,17 @@ object FormDesigner: TFormDesigner @@ -13,17 +13,17 @@ object FormDesigner: TFormDesigner
13 OnActivate = FormActivate 13 OnActivate = FormActivate
14 OnCreate = FormCreate 14 OnCreate = FormCreate
15 OnDestroy = FormDestroy 15 OnDestroy = FormDestroy
16 - SessionProperties = 'Caption;ComboCurrentCondition.ItemIndex;ComboCurrentCondition.Items;ComboCurrentCondition.Text;ComboCurrentContingency.ItemIndex;ComboCurrentContingency.Items;ComboCurrentContingency.Text;Height;LabelIf.Caption;Left;PageControl.TabIndex;RGContingencyType.ItemIndex;Top;Width;WindowState;LabelCsq3.Caption' 16 + SessionProperties = 'Caption;ComboCurrentCondition.ItemIndex;ComboCurrentCondition.Items;ComboCurrentCondition.Text;ComboCurrentContingency.ItemIndex;ComboCurrentContingency.Items;ComboCurrentContingency.Text;Height;LabelCsq3.Caption;LabelIf.Caption;Left;PageControl.TabIndex;RGContingencyType.ItemIndex;Top;Width;WindowState;XMLPropStorage.FileName;OpenDialog.InitialDir;SaveDialog.InitialDir'
17 ShowHint = True 17 ShowHint = True
18 LCLVersion = '1.6.2.0' 18 LCLVersion = '1.6.2.0'
19 object PageControl: TPageControl 19 object PageControl: TPageControl
20 Left = 0 20 Left = 0
21 - Height = 825 21 + Height = 744
22 Top = 0 22 Top = 0
23 Width = 664 23 Width = 664
24 - ActivePage = TabSheetContingencies 24 + ActivePage = TabSheetExperiment
25 Align = alClient 25 Align = alClient
26 - TabIndex = 2 26 + TabIndex = 0
27 TabOrder = 0 27 TabOrder = 0
28 object TabSheetExperiment: TTabSheet 28 object TabSheetExperiment: TTabSheet
29 Caption = 'Experimento' 29 Caption = 'Experimento'
@@ -32,13 +32,34 @@ object FormDesigner: TFormDesigner @@ -32,13 +32,34 @@ object FormDesigner: TFormDesigner
32 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 32 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
33 ChildSizing.Layout = cclLeftToRightThenTopToBottom 33 ChildSizing.Layout = cclLeftToRightThenTopToBottom
34 ChildSizing.ControlsPerLine = 1 34 ChildSizing.ControlsPerLine = 1
35 - ClientHeight = 792 35 + ClientHeight = 711
36 ClientWidth = 658 36 ClientWidth = 658
  37 + object GBConditions: TGroupBox
  38 + Left = 0
  39 + Height = 97
  40 + Top = 10
  41 + Width = 658
  42 + Caption = 'Condições'
  43 + ClientHeight = 80
  44 + ClientWidth = 654
  45 + TabOrder = 5
  46 + object ListBoxConditions: TListBox
  47 + Left = 0
  48 + Height = 80
  49 + Top = 0
  50 + Width = 654
  51 + Anchors = [akTop, akLeft, akRight]
  52 + ItemHeight = 0
  53 + ScrollWidth = 652
  54 + TabOrder = 0
  55 + TopIndex = -1
  56 + end
  57 + end
37 object LabelResearcherName: TLabel 58 object LabelResearcherName: TLabel
38 Left = 0 59 Left = 0
39 Height = 15 60 Height = 15
40 - Top = 10  
41 - Width = 640 61 + Top = 112
  62 + Width = 658
42 Caption = 'Nome do Pesquisador' 63 Caption = 'Nome do Pesquisador'
43 ParentColor = False 64 ParentColor = False
44 end 65 end
@@ -46,15 +67,16 @@ object FormDesigner: TFormDesigner @@ -46,15 +67,16 @@ object FormDesigner: TFormDesigner
46 Left = 0 67 Left = 0
47 Height = 25 68 Height = 25
48 Hint = 'Uma pasta será criada com o seu nome. Os seus experimentos serão salvos dentro dela.' 69 Hint = 'Uma pasta será criada com o seu nome. Os seus experimentos serão salvos dentro dela.'
49 - Top = 30  
50 - Width = 640 70 + Top = 132
  71 + Width = 658
  72 + OnEditingDone = EditExperimentEditingDone
51 TabOrder = 0 73 TabOrder = 0
52 end 74 end
53 object LabelExperimentName: TLabel 75 object LabelExperimentName: TLabel
54 Left = 0 76 Left = 0
55 Height = 15 77 Height = 15
56 - Top = 60  
57 - Width = 640 78 + Top = 162
  79 + Width = 658
58 Caption = 'Nome do Experimento' 80 Caption = 'Nome do Experimento'
59 ParentColor = False 81 ParentColor = False
60 end 82 end
@@ -62,26 +84,28 @@ object FormDesigner: TFormDesigner @@ -62,26 +84,28 @@ object FormDesigner: TFormDesigner
62 Left = 0 84 Left = 0
63 Height = 25 85 Height = 25
64 Hint = 'Uma pasta será criada com o nome do experimento. Os dados desse experimento serão salvos dentro dela.' 86 Hint = 'Uma pasta será criada com o nome do experimento. Os dados desse experimento serão salvos dentro dela.'
65 - Top = 80  
66 - Width = 640 87 + Top = 182
  88 + Width = 658
  89 + OnEditingDone = EditExperimentEditingDone
67 TabOrder = 1 90 TabOrder = 1
68 end 91 end
69 object GBExperimentAim: TGroupBox 92 object GBExperimentAim: TGroupBox
70 Left = 0 93 Left = 0
71 Height = 159 94 Height = 159
72 - Top = 110  
73 - Width = 640 95 + Top = 212
  96 + Width = 658
74 Caption = 'Objetivo do Experimento' 97 Caption = 'Objetivo do Experimento'
75 ClientHeight = 142 98 ClientHeight = 142
76 - ClientWidth = 636 99 + ClientWidth = 654
77 TabOrder = 2 100 TabOrder = 2
78 object MemoExperimentAim: TMemo 101 object MemoExperimentAim: TMemo
79 Left = 0 102 Left = 0
80 Height = 142 103 Height = 142
81 Top = 0 104 Top = 0
82 - Width = 636 105 + Width = 654
83 Align = alCustom 106 Align = alCustom
84 Anchors = [akTop, akLeft, akRight] 107 Anchors = [akTop, akLeft, akRight]
  108 + OnEditingDone = EditExperimentEditingDone
85 TabOrder = 0 109 TabOrder = 0
86 end 110 end
87 end 111 end
@@ -89,8 +113,8 @@ object FormDesigner: TFormDesigner @@ -89,8 +113,8 @@ object FormDesigner: TFormDesigner
89 Left = 0 113 Left = 0
90 Height = 113 114 Height = 113
91 Hint = 'Aplicáveis ao longo de todo o experimento' 115 Hint = 'Aplicáveis ao longo de todo o experimento'
92 - Top = 274  
93 - Width = 640 116 + Top = 376
  117 + Width = 658
94 AutoFill = True 118 AutoFill = True
95 Caption = 'Configurações globais' 119 Caption = 'Configurações globais'
96 ChildSizing.LeftRightSpacing = 6 120 ChildSizing.LeftRightSpacing = 6
@@ -102,13 +126,14 @@ object FormDesigner: TFormDesigner @@ -102,13 +126,14 @@ object FormDesigner: TFormDesigner
102 ChildSizing.Layout = cclLeftToRightThenTopToBottom 126 ChildSizing.Layout = cclLeftToRightThenTopToBottom
103 ChildSizing.ControlsPerLine = 1 127 ChildSizing.ControlsPerLine = 1
104 ClientHeight = 96 128 ClientHeight = 96
105 - ClientWidth = 636 129 + ClientWidth = 654
106 Items.Strings = ( 130 Items.Strings = (
107 'Enviar histórico do bate-papo a novos participantes' 131 'Enviar histórico do bate-papo a novos participantes'
108 'Gerar participantes automaticamente' 132 'Gerar participantes automaticamente'
109 'Habilitar matrix para o pesquisador jogar' 133 'Habilitar matrix para o pesquisador jogar'
110 'Habilitar bate-papo para o pesquisador' 134 'Habilitar bate-papo para o pesquisador'
111 ) 135 )
  136 + OnItemClick = CGGlobalItemClick
112 TabOrder = 3 137 TabOrder = 3
113 Data = { 138 Data = {
114 0400000002030202 139 0400000002030202
@@ -117,10 +142,10 @@ object FormDesigner: TFormDesigner @@ -117,10 +142,10 @@ object FormDesigner: TFormDesigner
117 object RGPoints: TRadioGroup 142 object RGPoints: TRadioGroup
118 Left = 0 143 Left = 0
119 Height = 59 144 Height = 59
120 - Top = 392  
121 - Width = 640 145 + Top = 494
  146 + Width = 658
122 AutoFill = True 147 AutoFill = True
123 - Caption = 'Tipo de pontuação' 148 + Caption = 'Tipo de pontuação Individual'
124 ChildSizing.LeftRightSpacing = 6 149 ChildSizing.LeftRightSpacing = 6
125 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 150 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
126 ChildSizing.EnlargeVertical = crsHomogenousChildResize 151 ChildSizing.EnlargeVertical = crsHomogenousChildResize
@@ -129,7 +154,7 @@ object FormDesigner: TFormDesigner @@ -129,7 +154,7 @@ object FormDesigner: TFormDesigner
129 ChildSizing.Layout = cclLeftToRightThenTopToBottom 154 ChildSizing.Layout = cclLeftToRightThenTopToBottom
130 ChildSizing.ControlsPerLine = 1 155 ChildSizing.ControlsPerLine = 1
131 ClientHeight = 42 156 ClientHeight = 42
132 - ClientWidth = 636 157 + ClientWidth = 654
133 ItemIndex = 0 158 ItemIndex = 0
134 Items.Strings = ( 159 Items.Strings = (
135 'A e B' 160 'A e B'
@@ -141,14 +166,14 @@ object FormDesigner: TFormDesigner @@ -141,14 +166,14 @@ object FormDesigner: TFormDesigner
141 object GBMatrix: TGroupBox 166 object GBMatrix: TGroupBox
142 Left = 0 167 Left = 0
143 Height = 143 168 Height = 143
144 - Top = 456  
145 - Width = 640 169 + Top = 558
  170 + Width = 658
146 Caption = 'Tipo da Matrix' 171 Caption = 'Tipo da Matrix'
147 ChildSizing.LeftRightSpacing = 5 172 ChildSizing.LeftRightSpacing = 5
148 ChildSizing.Layout = cclLeftToRightThenTopToBottom 173 ChildSizing.Layout = cclLeftToRightThenTopToBottom
149 ChildSizing.ControlsPerLine = 1 174 ChildSizing.ControlsPerLine = 1
150 ClientHeight = 126 175 ClientHeight = 126
151 - ClientWidth = 636 176 + ClientWidth = 654
152 TabOrder = 6 177 TabOrder = 6
153 object ChkColors: TCheckBox 178 object ChkColors: TCheckBox
154 Left = 5 179 Left = 5
@@ -158,6 +183,7 @@ object FormDesigner: TFormDesigner @@ -158,6 +183,7 @@ object FormDesigner: TFormDesigner
158 Caption = '5 cores' 183 Caption = '5 cores'
159 Checked = True 184 Checked = True
160 Enabled = False 185 Enabled = False
  186 + OnClick = ChkMatrixTypeClick
161 State = cbChecked 187 State = cbChecked
162 TabOrder = 0 188 TabOrder = 0
163 end 189 end
@@ -169,6 +195,7 @@ object FormDesigner: TFormDesigner @@ -169,6 +195,7 @@ object FormDesigner: TFormDesigner
169 Caption = '10 linhas' 195 Caption = '10 linhas'
170 Checked = True 196 Checked = True
171 Enabled = False 197 Enabled = False
  198 + OnClick = ChkMatrixTypeClick
172 State = cbChecked 199 State = cbChecked
173 TabOrder = 1 200 TabOrder = 1
174 end 201 end
@@ -178,6 +205,7 @@ object FormDesigner: TFormDesigner @@ -178,6 +205,7 @@ object FormDesigner: TFormDesigner
178 Top = 42 205 Top = 42
179 Width = 239 206 Width = 239
180 Caption = '10 colunas' 207 Caption = '10 colunas'
  208 + OnClick = ChkMatrixTypeClick
181 TabOrder = 2 209 TabOrder = 2
182 end 210 end
183 object ChkDots: TCheckBox 211 object ChkDots: TCheckBox
@@ -187,6 +215,7 @@ object FormDesigner: TFormDesigner @@ -187,6 +215,7 @@ object FormDesigner: TFormDesigner
187 Width = 239 215 Width = 239
188 Caption = 'Com Círculos Preechidos' 216 Caption = 'Com Círculos Preechidos'
189 OnChange = ChkDotsChange 217 OnChange = ChkDotsChange
  218 + OnClick = ChkMatrixTypeClick
190 TabOrder = 3 219 TabOrder = 3
191 end 220 end
192 object ChkCleanDots: TCheckBox 221 object ChkCleanDots: TCheckBox
@@ -196,6 +225,7 @@ object FormDesigner: TFormDesigner @@ -196,6 +225,7 @@ object FormDesigner: TFormDesigner
196 Width = 239 225 Width = 239
197 Caption = 'Com Círculos Vazados' 226 Caption = 'Com Círculos Vazados'
198 OnChange = ChkCleanDotsChange 227 OnChange = ChkCleanDotsChange
  228 + OnClick = ChkMatrixTypeClick
199 TabOrder = 4 229 TabOrder = 4
200 end 230 end
201 object ChkDotsCleanDots: TCheckBox 231 object ChkDotsCleanDots: TCheckBox
@@ -205,30 +235,10 @@ object FormDesigner: TFormDesigner @@ -205,30 +235,10 @@ object FormDesigner: TFormDesigner
205 Width = 239 235 Width = 239
206 Caption = 'Com Círculos Vazados e Preenchidos' 236 Caption = 'Com Círculos Vazados e Preenchidos'
207 OnChange = ChkDotsCleanDotsChange 237 OnChange = ChkDotsCleanDotsChange
  238 + OnClick = ChkMatrixTypeClick
208 TabOrder = 5 239 TabOrder = 5
209 end 240 end
210 end 241 end
211 - object GBConditions: TGroupBox  
212 - Left = 0  
213 - Height = 97  
214 - Top = 604  
215 - Width = 640  
216 - Caption = 'Condições'  
217 - ClientHeight = 80  
218 - ClientWidth = 636  
219 - TabOrder = 5  
220 - object ListBoxConditions: TListBox  
221 - Left = 0  
222 - Height = 80  
223 - Top = 0  
224 - Width = 636  
225 - Anchors = [akTop, akLeft, akRight]  
226 - ItemHeight = 0  
227 - ScrollWidth = 634  
228 - TabOrder = 0  
229 - TopIndex = -1  
230 - end  
231 - end  
232 end 242 end
233 object TabSheetConditions: TTabSheet 243 object TabSheetConditions: TTabSheet
234 Caption = 'Condições' 244 Caption = 'Condições'
@@ -237,13 +247,13 @@ object FormDesigner: TFormDesigner @@ -237,13 +247,13 @@ object FormDesigner: TFormDesigner
237 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 247 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
238 ChildSizing.Layout = cclLeftToRightThenTopToBottom 248 ChildSizing.Layout = cclLeftToRightThenTopToBottom
239 ChildSizing.ControlsPerLine = 1 249 ChildSizing.ControlsPerLine = 1
240 - ClientHeight = 792 250 + ClientHeight = 711
241 ClientWidth = 658 251 ClientWidth = 658
242 object ComboCurrentCondition: TComboBox 252 object ComboCurrentCondition: TComboBox
243 Left = 0 253 Left = 0
244 - Height = 23 254 + Height = 27
245 Top = 10 255 Top = 10
246 - Width = 640 256 + Width = 658
247 ItemHeight = 0 257 ItemHeight = 0
248 OnChange = ComboCurrentConditionChange 258 OnChange = ComboCurrentConditionChange
249 Style = csDropDownList 259 Style = csDropDownList
@@ -253,108 +263,199 @@ object FormDesigner: TFormDesigner @@ -253,108 +263,199 @@ object FormDesigner: TFormDesigner
253 Left = 0 263 Left = 0
254 Height = 26 264 Height = 26
255 Top = 42 265 Top = 42
256 - Width = 640 266 + Width = 658
257 ChildSizing.LeftRightSpacing = 25 267 ChildSizing.LeftRightSpacing = 25
258 ChildSizing.HorizontalSpacing = 50 268 ChildSizing.HorizontalSpacing = 50
259 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 269 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
260 ChildSizing.Layout = cclLeftToRightThenTopToBottom 270 ChildSizing.Layout = cclLeftToRightThenTopToBottom
261 ChildSizing.ControlsPerLine = 3 271 ChildSizing.ControlsPerLine = 3
262 ClientHeight = 26 272 ClientHeight = 26
263 - ClientWidth = 640 273 + ClientWidth = 658
264 TabOrder = 1 274 TabOrder = 1
265 object BtnAppendCond: TButton 275 object BtnAppendCond: TButton
266 Left = 25 276 Left = 25
267 Height = 25 277 Height = 25
  278 + Hint = 'Selecione contingências na lista abaixo se deseja inclui-las na condição a ser adicionada.'
268 Top = 0 279 Top = 0
269 - Width = 162 280 + Width = 168
270 Caption = 'Adicionar' 281 Caption = 'Adicionar'
271 OnClick = BtnAppendCondClick 282 OnClick = BtnAppendCondClick
272 TabOrder = 0 283 TabOrder = 0
273 end 284 end
274 object BtnRemoveCond: TButton 285 object BtnRemoveCond: TButton
275 - Left = 237 286 + Left = 243
276 Height = 25 287 Height = 25
277 Top = 0 288 Top = 0
278 - Width = 159 289 + Width = 165
279 Caption = 'Remover' 290 Caption = 'Remover'
280 OnClick = BtnRemoveCondClick 291 OnClick = BtnRemoveCondClick
281 TabOrder = 1 292 TabOrder = 1
282 end 293 end
283 object BtnReorderCond: TButton 294 object BtnReorderCond: TButton
284 - Left = 446 295 + Left = 458
285 Height = 25 296 Height = 25
286 Top = 0 297 Top = 0
287 - Width = 169 298 + Width = 175
288 Caption = 'Reordenar' 299 Caption = 'Reordenar'
289 OnClick = BtnReorderCondClick 300 OnClick = BtnReorderCondClick
290 TabOrder = 2 301 TabOrder = 2
  302 + Visible = False
  303 + end
  304 + end
  305 + object GBContingencies: TGroupBox
  306 + Left = 0
  307 + Height = 97
  308 + Top = 73
  309 + Width = 658
  310 + Caption = 'Contingências e Metacontingências da Condição Selecionada'
  311 + ClientHeight = 80
  312 + ClientWidth = 654
  313 + TabOrder = 8
  314 + object ListBoxContingencies: TListBox
  315 + Left = 0
  316 + Height = 80
  317 + Hint = 'CTRL+Clique para selecionar múltiplas contingências.'
  318 + Top = 0
  319 + Width = 654
  320 + Anchors = [akTop, akLeft, akRight]
  321 + ItemHeight = 0
  322 + MultiSelect = True
  323 + ScrollWidth = 652
  324 + TabOrder = 0
  325 + TopIndex = -1
291 end 326 end
292 end 327 end
293 object LabelConditionName: TLabel 328 object LabelConditionName: TLabel
294 Left = 0 329 Left = 0
295 Height = 15 330 Height = 15
296 Hint = 'Nome da condição no relatório.' 331 Hint = 'Nome da condição no relatório.'
297 - Top = 73  
298 - Width = 640 332 + Top = 175
  333 + Width = 658
299 Caption = 'Nome da Condição' 334 Caption = 'Nome da Condição'
300 ParentColor = False 335 ParentColor = False
301 end 336 end
302 object EditConditionName: TEdit 337 object EditConditionName: TEdit
303 Left = 0 338 Left = 0
304 Height = 25 339 Height = 25
305 - Top = 93  
306 - Width = 640 340 + Top = 195
  341 + Width = 658
307 OnEditingDone = EditConditionNameEditingDone 342 OnEditingDone = EditConditionNameEditingDone
308 TabOrder = 2 343 TabOrder = 2
309 end 344 end
310 object LabelTurnValue: TLabel 345 object LabelTurnValue: TLabel
311 Left = 0 346 Left = 0
312 Height = 15 347 Height = 15
313 - Top = 123  
314 - Width = 640 348 + Top = 225
  349 + Width = 658
315 Caption = 'Número de Jogadores / Turnos' 350 Caption = 'Número de Jogadores / Turnos'
316 ParentColor = False 351 ParentColor = False
317 end 352 end
318 object SpinEditTurnValue: TSpinEdit 353 object SpinEditTurnValue: TSpinEdit
319 Left = 0 354 Left = 0
320 Height = 25 355 Height = 25
321 - Top = 143  
322 - Width = 640 356 + Top = 245
  357 + Width = 658
323 MaxValue = 5 358 MaxValue = 5
324 MinValue = 2 359 MinValue = 2
325 OnEditingDone = SpinEditTurnValueEditingDone 360 OnEditingDone = SpinEditTurnValueEditingDone
326 TabOrder = 3 361 TabOrder = 3
327 Value = 2 362 Value = 2
328 end 363 end
329 - object LabelPointsOnConditionBegin: TLabel 364 + object GroupBox1: TGroupBox
330 Left = 0 365 Left = 0
331 - Height = 15  
332 - Top = 173  
333 - Width = 640  
334 - Caption = 'Pontos ao início da Condição'  
335 - ParentColor = False  
336 - end  
337 - object SpinEditOnConditionBegin: TSpinEdit  
338 - Left = 0  
339 - Height = 25  
340 - Top = 193  
341 - Width = 640  
342 - MaxValue = 0 366 + Height = 57
  367 + Top = 275
  368 + Width = 658
  369 + Caption = 'Somar pontos ao iniciar condição'
  370 + ChildSizing.LeftRightSpacing = 50
  371 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
  372 + ChildSizing.Layout = cclTopToBottomThenLeftToRight
  373 + ChildSizing.ControlsPerLine = 2
  374 + ClientHeight = 40
  375 + ClientWidth = 654
343 TabOrder = 9 376 TabOrder = 9
  377 + object LabelPA: TLabel
  378 + Left = 50
  379 + Height = 15
  380 + Top = 0
  381 + Width = 137
  382 + Caption = 'A'
  383 + ParentColor = False
  384 + end
  385 + object SpinEditOnConditionBeginA: TSpinEdit
  386 + Left = 50
  387 + Height = 25
  388 + Top = 15
  389 + Width = 137
  390 + MaxValue = 0
  391 + OnEditingDone = SpinEditOnConditionBeginAEditingDone
  392 + TabOrder = 0
  393 + end
  394 + object LabelPB: TLabel
  395 + Left = 187
  396 + Height = 15
  397 + Top = 0
  398 + Width = 137
  399 + Caption = 'B'
  400 + ParentColor = False
  401 + end
  402 + object SpinEditOnConditionBeginB: TSpinEdit
  403 + Left = 187
  404 + Height = 25
  405 + Top = 15
  406 + Width = 137
  407 + MaxValue = 0
  408 + OnEditingDone = SpinEditOnConditionBeginAEditingDone
  409 + TabOrder = 1
  410 + end
  411 + object LabelPI: TLabel
  412 + Left = 324
  413 + Height = 15
  414 + Top = 0
  415 + Width = 145
  416 + Caption = 'Individual'
  417 + ParentColor = False
  418 + end
  419 + object SpinEditOnConditionBeginI: TSpinEdit
  420 + Left = 324
  421 + Height = 25
  422 + Top = 15
  423 + Width = 145
  424 + MaxValue = 0
  425 + OnEditingDone = SpinEditOnConditionBeginAEditingDone
  426 + TabOrder = 2
  427 + end
  428 + object LabelPG: TLabel
  429 + Left = 469
  430 + Height = 15
  431 + Top = 0
  432 + Width = 135
  433 + Caption = 'Grupo'
  434 + ParentColor = False
  435 + end
  436 + object SpinEditOnConditionBeginG: TSpinEdit
  437 + Left = 469
  438 + Height = 25
  439 + Top = 15
  440 + Width = 135
  441 + MaxValue = 0
  442 + OnEditingDone = SpinEditOnConditionBeginAEditingDone
  443 + TabOrder = 3
  444 + end
344 end 445 end
345 object LabelCyclesValue: TLabel 446 object LabelCyclesValue: TLabel
346 Left = 0 447 Left = 0
347 Height = 15 448 Height = 15
348 - Top = 223  
349 - Width = 640 449 + Top = 337
  450 + Width = 658
350 Caption = 'Ciclos para mudança de geração / linhagem' 451 Caption = 'Ciclos para mudança de geração / linhagem'
351 ParentColor = False 452 ParentColor = False
352 end 453 end
353 object SpinEditCyclesValue: TSpinEdit 454 object SpinEditCyclesValue: TSpinEdit
354 Left = 0 455 Left = 0
355 Height = 25 456 Height = 25
356 - Top = 243  
357 - Width = 640 457 + Top = 357
  458 + Width = 658
358 MaxValue = 1000 459 MaxValue = 1000
359 MinValue = 1 460 MinValue = 1
360 OnEditingDone = SpinEditCyclesValueEditingDone 461 OnEditingDone = SpinEditCyclesValueEditingDone
@@ -364,8 +465,8 @@ object FormDesigner: TFormDesigner @@ -364,8 +465,8 @@ object FormDesigner: TFormDesigner
364 object GBQuestion: TGroupBox 465 object GBQuestion: TGroupBox
365 Left = 0 466 Left = 0
366 Height = 164 467 Height = 164
367 - Top = 273  
368 - Width = 640 468 + Top = 387
  469 + Width = 658
369 Caption = 'Apresentar pergunta ao final do ciclo' 470 Caption = 'Apresentar pergunta ao final do ciclo'
370 ChildSizing.LeftRightSpacing = 50 471 ChildSizing.LeftRightSpacing = 50
371 ChildSizing.VerticalSpacing = 5 472 ChildSizing.VerticalSpacing = 5
@@ -373,13 +474,13 @@ object FormDesigner: TFormDesigner @@ -373,13 +474,13 @@ object FormDesigner: TFormDesigner
373 ChildSizing.Layout = cclLeftToRightThenTopToBottom 474 ChildSizing.Layout = cclLeftToRightThenTopToBottom
374 ChildSizing.ControlsPerLine = 1 475 ChildSizing.ControlsPerLine = 1
375 ClientHeight = 147 476 ClientHeight = 147
376 - ClientWidth = 636 477 + ClientWidth = 654
377 TabOrder = 5 478 TabOrder = 5
378 object CheckBoxShouldAskQuestion: TCheckBox 479 object CheckBoxShouldAskQuestion: TCheckBox
379 Left = 50 480 Left = 50
380 Height = 21 481 Height = 21
381 Top = 0 482 Top = 0
382 - Width = 536 483 + Width = 554
383 Caption = 'Não' 484 Caption = 'Não'
384 OnChange = CheckBoxShouldAskQuestionChange 485 OnChange = CheckBoxShouldAskQuestionChange
385 TabOrder = 0 486 TabOrder = 0
@@ -388,7 +489,7 @@ object FormDesigner: TFormDesigner @@ -388,7 +489,7 @@ object FormDesigner: TFormDesigner
388 Left = 50 489 Left = 50
389 Height = 15 490 Height = 15
390 Top = 26 491 Top = 26
391 - Width = 536 492 + Width = 554
392 Caption = 'Texto da Pergunta' 493 Caption = 'Texto da Pergunta'
393 ParentColor = False 494 ParentColor = False
394 end 495 end
@@ -396,7 +497,7 @@ object FormDesigner: TFormDesigner @@ -396,7 +497,7 @@ object FormDesigner: TFormDesigner
396 Left = 50 497 Left = 50
397 Height = 25 498 Height = 25
398 Top = 46 499 Top = 46
399 - Width = 536 500 + Width = 554
400 OnEditingDone = EditQuestionEditingDone 501 OnEditingDone = EditQuestionEditingDone
401 TabOrder = 1 502 TabOrder = 1
402 Text = 'Um item escolar foi perdido, desejam recuperá-lo gastando pontos do Tipo A?' 503 Text = 'Um item escolar foi perdido, desejam recuperá-lo gastando pontos do Tipo A?'
@@ -406,7 +507,7 @@ object FormDesigner: TFormDesigner @@ -406,7 +507,7 @@ object FormDesigner: TFormDesigner
406 Left = 50 507 Left = 50
407 Height = 71 508 Height = 71
408 Top = 76 509 Top = 76
409 - Width = 536 510 + Width = 554
410 AutoFill = True 511 AutoFill = True
411 Caption = 'O que deve acontecer quando todos responderem sim?' 512 Caption = 'O que deve acontecer quando todos responderem sim?'
412 ChildSizing.LeftRightSpacing = 6 513 ChildSizing.LeftRightSpacing = 6
@@ -418,7 +519,7 @@ object FormDesigner: TFormDesigner @@ -418,7 +519,7 @@ object FormDesigner: TFormDesigner
418 ChildSizing.Layout = cclLeftToRightThenTopToBottom 519 ChildSizing.Layout = cclLeftToRightThenTopToBottom
419 ChildSizing.ControlsPerLine = 1 520 ChildSizing.ControlsPerLine = 1
420 ClientHeight = 54 521 ClientHeight = 54
421 - ClientWidth = 532 522 + ClientWidth = 550
422 Items.Strings = ( 523 Items.Strings = (
423 'Reverter consequências das metacontingências e contingências' 524 'Reverter consequências das metacontingências e contingências'
424 'Inverter pontos A e B quando pontos B forem consequências' 525 'Inverter pontos A e B quando pontos B forem consequências'
@@ -434,8 +535,8 @@ object FormDesigner: TFormDesigner @@ -434,8 +535,8 @@ object FormDesigner: TFormDesigner
434 object RGEndCriteriaStyle: TRadioGroup 535 object RGEndCriteriaStyle: TRadioGroup
435 Left = 0 536 Left = 0
436 Height = 80 537 Height = 80
437 - Top = 442  
438 - Width = 640 538 + Top = 556
  539 + Width = 658
439 AutoFill = True 540 AutoFill = True
440 Caption = 'Estilo do critério de finalização da condição' 541 Caption = 'Estilo do critério de finalização da condição'
441 ChildSizing.LeftRightSpacing = 6 542 ChildSizing.LeftRightSpacing = 6
@@ -446,7 +547,7 @@ object FormDesigner: TFormDesigner @@ -446,7 +547,7 @@ object FormDesigner: TFormDesigner
446 ChildSizing.Layout = cclLeftToRightThenTopToBottom 547 ChildSizing.Layout = cclLeftToRightThenTopToBottom
447 ChildSizing.ControlsPerLine = 1 548 ChildSizing.ControlsPerLine = 1
448 ClientHeight = 63 549 ClientHeight = 63
449 - ClientWidth = 636 550 + ClientWidth = 654
450 ItemIndex = 2 551 ItemIndex = 2
451 Items.Strings = ( 552 Items.Strings = (
452 'Finalizar após um número de ciclos' 553 'Finalizar após um número de ciclos'
@@ -459,8 +560,8 @@ object FormDesigner: TFormDesigner @@ -459,8 +560,8 @@ object FormDesigner: TFormDesigner
459 object GBEndCriteria: TGroupBox 560 object GBEndCriteria: TGroupBox
460 Left = 0 561 Left = 0
461 Height = 109 562 Height = 109
462 - Top = 527  
463 - Width = 640 563 + Top = 641
  564 + Width = 658
464 Caption = 'Valores do critério de finalização da condição' 565 Caption = 'Valores do critério de finalização da condição'
465 ChildSizing.LeftRightSpacing = 50 566 ChildSizing.LeftRightSpacing = 50
466 ChildSizing.VerticalSpacing = 5 567 ChildSizing.VerticalSpacing = 5
@@ -468,13 +569,13 @@ object FormDesigner: TFormDesigner @@ -468,13 +569,13 @@ object FormDesigner: TFormDesigner
468 ChildSizing.Layout = cclLeftToRightThenTopToBottom 569 ChildSizing.Layout = cclLeftToRightThenTopToBottom
469 ChildSizing.ControlsPerLine = 1 570 ChildSizing.ControlsPerLine = 1
470 ClientHeight = 92 571 ClientHeight = 92
471 - ClientWidth = 636 572 + ClientWidth = 654
472 TabOrder = 7 573 TabOrder = 7
473 object LabelEndCriteriaAbsCycles: TLabel 574 object LabelEndCriteriaAbsCycles: TLabel
474 Left = 50 575 Left = 50
475 Height = 15 576 Height = 15
476 Top = 0 577 Top = 0
477 - Width = 536 578 + Width = 554
478 Caption = 'Número de ciclos' 579 Caption = 'Número de ciclos'
479 ParentColor = False 580 ParentColor = False
480 end 581 end
@@ -482,7 +583,7 @@ object FormDesigner: TFormDesigner @@ -482,7 +583,7 @@ object FormDesigner: TFormDesigner
482 Left = 50 583 Left = 50
483 Height = 25 584 Height = 25
484 Top = 20 585 Top = 20
485 - Width = 536 586 + Width = 554
486 MaxValue = 1000 587 MaxValue = 1000
487 OnEditingDone = SpinEditEndCriteriaAbsCyclesEditingDone 588 OnEditingDone = SpinEditEndCriteriaAbsCyclesEditingDone
488 TabOrder = 0 589 TabOrder = 0
@@ -492,13 +593,13 @@ object FormDesigner: TFormDesigner @@ -492,13 +593,13 @@ object FormDesigner: TFormDesigner
492 Left = 50 593 Left = 50
493 Height = 42 594 Height = 42
494 Top = 50 595 Top = 50
495 - Width = 536 596 + Width = 554
496 Caption = 'Porcentagem de entrelaçamentos' 597 Caption = 'Porcentagem de entrelaçamentos'
497 ChildSizing.HorizontalSpacing = 5 598 ChildSizing.HorizontalSpacing = 5
498 ChildSizing.Layout = cclLeftToRightThenTopToBottom 599 ChildSizing.Layout = cclLeftToRightThenTopToBottom
499 ChildSizing.ControlsPerLine = 4 600 ChildSizing.ControlsPerLine = 4
500 ClientHeight = 25 601 ClientHeight = 25
501 - ClientWidth = 532 602 + ClientWidth = 550
502 TabOrder = 1 603 TabOrder = 1
503 object SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit 604 object SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit
504 Left = 0 605 Left = 0
@@ -542,27 +643,6 @@ object FormDesigner: TFormDesigner @@ -542,27 +643,6 @@ object FormDesigner: TFormDesigner
542 end 643 end
543 end 644 end
544 end 645 end
545 - object GBContingencies: TGroupBox  
546 - Left = 0  
547 - Height = 97  
548 - Top = 641  
549 - Width = 640  
550 - Caption = 'Contingências e Metacontingências'  
551 - ClientHeight = 80  
552 - ClientWidth = 636  
553 - TabOrder = 8  
554 - object ListBoxContingencies: TListBox  
555 - Left = 0  
556 - Height = 80  
557 - Top = 0  
558 - Width = 636  
559 - Anchors = [akTop, akLeft, akRight]  
560 - ItemHeight = 0  
561 - ScrollWidth = 634  
562 - TabOrder = 0  
563 - TopIndex = -1  
564 - end  
565 - end  
566 end 646 end
567 object TabSheetContingencies: TTabSheet 647 object TabSheetContingencies: TTabSheet
568 Caption = 'Contingências' 648 Caption = 'Contingências'
@@ -571,7 +651,7 @@ object FormDesigner: TFormDesigner @@ -571,7 +651,7 @@ object FormDesigner: TFormDesigner
571 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize 651 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
572 ChildSizing.Layout = cclLeftToRightThenTopToBottom 652 ChildSizing.Layout = cclLeftToRightThenTopToBottom
573 ChildSizing.ControlsPerLine = 1 653 ChildSizing.ControlsPerLine = 1
574 - ClientHeight = 792 654 + ClientHeight = 711
575 ClientWidth = 658 655 ClientWidth = 658
576 Enabled = False 656 Enabled = False
577 object RGContingencyType: TRadioGroup 657 object RGContingencyType: TRadioGroup
@@ -646,6 +726,7 @@ object FormDesigner: TFormDesigner @@ -646,6 +726,7 @@ object FormDesigner: TFormDesigner
646 Caption = 'Reordenar' 726 Caption = 'Reordenar'
647 OnClick = BtnReorderContingencyClick 727 OnClick = BtnReorderContingencyClick
648 TabOrder = 2 728 TabOrder = 2
  729 + Visible = False
649 end 730 end
650 end 731 end
651 object LabelContingencyName: TLabel 732 object LabelContingencyName: TLabel
@@ -765,15 +846,15 @@ object FormDesigner: TFormDesigner @@ -765,15 +846,15 @@ object FormDesigner: TFormDesigner
765 Left = 0 846 Left = 0
766 Height = 15 847 Height = 15
767 Top = 0 848 Top = 0
768 - Width = 416 849 + Width = 420
769 Caption = 'Pontos' 850 Caption = 'Pontos'
770 ParentColor = False 851 ParentColor = False
771 end 852 end
772 object LabelCsq2: TLabel 853 object LabelCsq2: TLabel
773 - Left = 416 854 + Left = 420
774 Height = 15 855 Height = 15
775 Top = 0 856 Top = 0
776 - Width = 238 857 + Width = 234
777 Caption = 'do Tipo' 858 Caption = 'do Tipo'
778 ParentColor = False 859 ParentColor = False
779 end 860 end
@@ -781,17 +862,16 @@ object FormDesigner: TFormDesigner @@ -781,17 +862,16 @@ object FormDesigner: TFormDesigner
781 Left = 0 862 Left = 0
782 Height = 27 863 Height = 27
783 Top = 15 864 Top = 15
784 - Width = 416 865 + Width = 420
785 MaxValue = 0 866 MaxValue = 0
786 OnEditingDone = ConsequenceStyleChange 867 OnEditingDone = ConsequenceStyleChange
787 TabOrder = 0 868 TabOrder = 0
788 - Value = 1  
789 end 869 end
790 object CBPointsType: TComboBox 870 object CBPointsType: TComboBox
791 - Left = 416 871 + Left = 420
792 Height = 27 872 Height = 27
793 Top = 15 873 Top = 15
794 - Width = 238 874 + Width = 234
795 ItemHeight = 0 875 ItemHeight = 0
796 OnChange = ConsequenceStyleChange 876 OnChange = ConsequenceStyleChange
797 Style = csDropDownList 877 Style = csDropDownList
@@ -801,13 +881,18 @@ object FormDesigner: TFormDesigner @@ -801,13 +881,18 @@ object FormDesigner: TFormDesigner
801 Left = 0 881 Left = 0
802 Height = 80 882 Height = 80
803 Top = 42 883 Top = 42
804 - Width = 416 884 + Width = 420
805 AutoFill = True 885 AutoFill = True
806 Caption = 'Apresentar mensagem de notificação' 886 Caption = 'Apresentar mensagem de notificação'
  887 + ChildSizing.LeftRightSpacing = 6
  888 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
  889 + ChildSizing.EnlargeVertical = crsHomogenousChildResize
  890 + ChildSizing.ShrinkHorizontal = crsScaleChilds
  891 + ChildSizing.ShrinkVertical = crsScaleChilds
807 ChildSizing.Layout = cclLeftToRightThenTopToBottom 892 ChildSizing.Layout = cclLeftToRightThenTopToBottom
808 ChildSizing.ControlsPerLine = 1 893 ChildSizing.ControlsPerLine = 1
809 ClientHeight = 63 894 ClientHeight = 63
810 - ClientWidth = 412 895 + ClientWidth = 416
811 ItemIndex = 0 896 ItemIndex = 0
812 Items.Strings = ( 897 Items.Strings = (
813 'a todos os participantes' 898 'a todos os participantes'
@@ -818,11 +903,11 @@ object FormDesigner: TFormDesigner @@ -818,11 +903,11 @@ object FormDesigner: TFormDesigner
818 TabOrder = 9 903 TabOrder = 9
819 end 904 end
820 object CheckBoxImutableMessage: TCheckBox 905 object CheckBoxImutableMessage: TCheckBox
821 - Left = 416 906 + Left = 420
822 Height = 80 907 Height = 80
823 Hint = 'Marque se deseja uma mensagem fixa; o programa não atualizará o texto da mensagem caso o valor da pontuação mude ao longo do experimento.' 908 Hint = 'Marque se deseja uma mensagem fixa; o programa não atualizará o texto da mensagem caso o valor da pontuação mude ao longo do experimento.'
824 Top = 42 909 Top = 42
825 - Width = 238 910 + Width = 234
826 AutoSize = False 911 AutoSize = False
827 Caption = 'imutável' 912 Caption = 'imutável'
828 OnChange = CheckBoxImutableMessageChange 913 OnChange = CheckBoxImutableMessageChange
@@ -832,15 +917,16 @@ object FormDesigner: TFormDesigner @@ -832,15 +917,16 @@ object FormDesigner: TFormDesigner
832 Left = 0 917 Left = 0
833 Height = 25 918 Height = 25
834 Top = 122 919 Top = 122
835 - Width = 416 920 + Width = 420
836 Caption = 'Texto no início da mensagem' 921 Caption = 'Texto no início da mensagem'
837 ParentColor = False 922 ParentColor = False
838 end 923 end
839 object EditMessPrefix: TEdit 924 object EditMessPrefix: TEdit
840 - Left = 416 925 + Left = 420
841 Height = 25 926 Height = 25
842 Top = 122 927 Top = 122
843 - Width = 238 928 + Width = 234
  929 + OnEditingDone = EditMessDone
844 TabOrder = 2 930 TabOrder = 2
845 Text = '$NICNAME' 931 Text = '$NICNAME'
846 end 932 end
@@ -848,15 +934,16 @@ object FormDesigner: TFormDesigner @@ -848,15 +934,16 @@ object FormDesigner: TFormDesigner
848 Left = 0 934 Left = 0
849 Height = 25 935 Height = 25
850 Top = 147 936 Top = 147
851 - Width = 416 937 + Width = 420
852 Caption = 'Prefixo ao perder pontos' 938 Caption = 'Prefixo ao perder pontos'
853 ParentColor = False 939 ParentColor = False
854 end 940 end
855 object EditMessPrefixLoss: TEdit 941 object EditMessPrefixLoss: TEdit
856 - Left = 416 942 + Left = 420
857 Height = 25 943 Height = 25
858 Top = 147 944 Top = 147
859 - Width = 238 945 + Width = 234
  946 + OnEditingDone = EditMessDone
860 TabOrder = 3 947 TabOrder = 3
861 Text = 'perdeu' 948 Text = 'perdeu'
862 end 949 end
@@ -864,15 +951,16 @@ object FormDesigner: TFormDesigner @@ -864,15 +951,16 @@ object FormDesigner: TFormDesigner
864 Left = 0 951 Left = 0
865 Height = 25 952 Height = 25
866 Top = 172 953 Top = 172
867 - Width = 416 954 + Width = 420
868 Caption = 'Sufixo ao perder pontos (Singular)' 955 Caption = 'Sufixo ao perder pontos (Singular)'
869 ParentColor = False 956 ParentColor = False
870 end 957 end
871 object EditMessSufixLossSingular: TEdit 958 object EditMessSufixLossSingular: TEdit
872 - Left = 416 959 + Left = 420
873 Height = 25 960 Height = 25
874 Top = 172 961 Top = 172
875 - Width = 238 962 + Width = 234
  963 + OnEditingDone = EditMessDone
876 TabOrder = 4 964 TabOrder = 4
877 Text = 'ponto.' 965 Text = 'ponto.'
878 end 966 end
@@ -880,15 +968,16 @@ object FormDesigner: TFormDesigner @@ -880,15 +968,16 @@ object FormDesigner: TFormDesigner
880 Left = 0 968 Left = 0
881 Height = 25 969 Height = 25
882 Top = 197 970 Top = 197
883 - Width = 416 971 + Width = 420
884 Caption = 'Sufixo ao perder pontos (Plural)' 972 Caption = 'Sufixo ao perder pontos (Plural)'
885 ParentColor = False 973 ParentColor = False
886 end 974 end
887 object EditMessSufixLossPlural: TEdit 975 object EditMessSufixLossPlural: TEdit
888 - Left = 416 976 + Left = 420
889 Height = 25 977 Height = 25
890 Top = 197 978 Top = 197
891 - Width = 238 979 + Width = 234
  980 + OnEditingDone = EditMessDone
892 TabOrder = 5 981 TabOrder = 5
893 Text = 'pontos.' 982 Text = 'pontos.'
894 end 983 end
@@ -896,15 +985,16 @@ object FormDesigner: TFormDesigner @@ -896,15 +985,16 @@ object FormDesigner: TFormDesigner
896 Left = 0 985 Left = 0
897 Height = 25 986 Height = 25
898 Top = 222 987 Top = 222
899 - Width = 416 988 + Width = 420
900 Caption = 'Prefixo ao ganhar pontos' 989 Caption = 'Prefixo ao ganhar pontos'
901 ParentColor = False 990 ParentColor = False
902 end 991 end
903 object EditMessPrefixEarn: TEdit 992 object EditMessPrefixEarn: TEdit
904 - Left = 416 993 + Left = 420
905 Height = 25 994 Height = 25
906 Top = 222 995 Top = 222
907 - Width = 238 996 + Width = 234
  997 + OnEditingDone = EditMessDone
908 TabOrder = 6 998 TabOrder = 6
909 Text = 'ganhou' 999 Text = 'ganhou'
910 end 1000 end
@@ -912,15 +1002,16 @@ object FormDesigner: TFormDesigner @@ -912,15 +1002,16 @@ object FormDesigner: TFormDesigner
912 Left = 0 1002 Left = 0
913 Height = 25 1003 Height = 25
914 Top = 247 1004 Top = 247
915 - Width = 416 1005 + Width = 420
916 Caption = 'Sufixo ao ganhar pontos (Singular)' 1006 Caption = 'Sufixo ao ganhar pontos (Singular)'
917 ParentColor = False 1007 ParentColor = False
918 end 1008 end
919 object EditMessSufixEarnSingular: TEdit 1009 object EditMessSufixEarnSingular: TEdit
920 - Left = 416 1010 + Left = 420
921 Height = 25 1011 Height = 25
922 Top = 247 1012 Top = 247
923 - Width = 238 1013 + Width = 234
  1014 + OnEditingDone = EditMessDone
924 TabOrder = 7 1015 TabOrder = 7
925 Text = 'ponto.' 1016 Text = 'ponto.'
926 end 1017 end
@@ -928,15 +1019,16 @@ object FormDesigner: TFormDesigner @@ -928,15 +1019,16 @@ object FormDesigner: TFormDesigner
928 Left = 0 1019 Left = 0
929 Height = 25 1020 Height = 25
930 Top = 272 1021 Top = 272
931 - Width = 416 1022 + Width = 420
932 Caption = 'Sufixo ao ganhar pontos (Plural)' 1023 Caption = 'Sufixo ao ganhar pontos (Plural)'
933 ParentColor = False 1024 ParentColor = False
934 end 1025 end
935 object EditMessSufixEarnPlural: TEdit 1026 object EditMessSufixEarnPlural: TEdit
936 - Left = 416 1027 + Left = 420
937 Height = 25 1028 Height = 25
938 Top = 272 1029 Top = 272
939 - Width = 238 1030 + Width = 234
  1031 + OnEditingDone = EditMessDone
940 TabOrder = 8 1032 TabOrder = 8
941 Text = 'pontos.' 1033 Text = 'pontos.'
942 end 1034 end
@@ -944,16 +1036,16 @@ object FormDesigner: TFormDesigner @@ -944,16 +1036,16 @@ object FormDesigner: TFormDesigner
944 Left = 0 1036 Left = 0
945 Height = 25 1037 Height = 25
946 Top = 297 1038 Top = 297
947 - Width = 416  
948 - Caption = 'Sufixo ao ganhar pontos (Plural)' 1039 + Width = 420
  1040 + Caption = 'Sufixo 0 pontos'
949 ParentColor = False 1041 ParentColor = False
950 end 1042 end
951 object EditMessSufixZero: TEdit 1043 object EditMessSufixZero: TEdit
952 - Left = 416 1044 + Left = 420
953 Height = 25 1045 Height = 25
954 Top = 297 1046 Top = 297
955 - Width = 238  
956 - OnChange = EditMessSufixZeroChange 1047 + Width = 234
  1048 + OnEditingDone = EditMessDone
957 TabOrder = 11 1049 TabOrder = 11
958 Text = 'não ganhou nem perdeu pontos.' 1050 Text = 'não ganhou nem perdeu pontos.'
959 end 1051 end
@@ -961,7 +1053,7 @@ object FormDesigner: TFormDesigner @@ -961,7 +1053,7 @@ object FormDesigner: TFormDesigner
961 Left = 0 1053 Left = 0
962 Height = 25 1054 Height = 25
963 Top = 322 1055 Top = 322
964 - Width = 416 1056 + Width = 420
965 Caption = 'Ver como a mensagem pode ser apresentada' 1057 Caption = 'Ver como a mensagem pode ser apresentada'
966 OnClick = ButtonPreviewMessageClick 1058 OnClick = ButtonPreviewMessageClick
967 TabOrder = 12 1059 TabOrder = 12
@@ -978,6 +1070,10 @@ object FormDesigner: TFormDesigner @@ -978,6 +1070,10 @@ object FormDesigner: TFormDesigner
978 Caption = 'Abrir' 1070 Caption = 'Abrir'
979 OnClick = MenuItemOpenClick 1071 OnClick = MenuItemOpenClick
980 end 1072 end
  1073 + object MenuItemSaveAs: TMenuItem
  1074 + Caption = 'Salvar Como'
  1075 + OnClick = MenuItemSaveAsClick
  1076 + end
981 object MenuItemSeparator1: TMenuItem 1077 object MenuItemSeparator1: TMenuItem
982 Caption = '-' 1078 Caption = '-'
983 end 1079 end
@@ -988,21 +1084,31 @@ object FormDesigner: TFormDesigner @@ -988,21 +1084,31 @@ object FormDesigner: TFormDesigner
988 end 1084 end
989 end 1085 end
990 object OpenDialog: TOpenDialog 1086 object OpenDialog: TOpenDialog
991 - left = 464 1087 + Title = 'Abrir arquivo de configuração'
  1088 + DefaultExt = '.ini'
  1089 + Filter = 'ini|*.ini|txt|*.txt'
  1090 + Options = [ofFileMustExist]
  1091 + left = 376
992 top = 8 1092 top = 8
993 end 1093 end
994 object XMLPropStorage: TXMLPropStorage 1094 object XMLPropStorage: TXMLPropStorage
995 StoredValues = < 1095 StoredValues = <
996 item 1096 item
997 - Name = 'FileName'  
998 - Value = 'persistence.ini' 1097 + Name = 'Filename'
999 OnSave = XMLPropStorageStoredValuesFileNameSave 1098 OnSave = XMLPropStorageStoredValuesFileNameSave
1000 OnRestore = XMLPropStorageStoredValuesFileNameRestore 1099 OnRestore = XMLPropStorageStoredValuesFileNameRestore
1001 end> 1100 end>
1002 - FileName = 'persistence.xml'  
1003 OnSavingProperties = XMLPropStorageSavingProperties 1101 OnSavingProperties = XMLPropStorageSavingProperties
1004 OnRestoreProperties = XMLPropStorageRestoreProperties 1102 OnRestoreProperties = XMLPropStorageRestoreProperties
1005 left = 464 1103 left = 464
1006 - top = 64 1104 + top = 8
  1105 + end
  1106 + object SaveDialog: TSaveDialog
  1107 + Width = 862
  1108 + Height = 468
  1109 + DefaultExt = '.ini'
  1110 + Filter = 'ini|*.ini|txt|*.txt'
  1111 + left = 304
  1112 + top = 8
1007 end 1113 end
1008 end 1114 end
experiment_designer/form_main.pas
@@ -11,6 +11,8 @@ unit form_main; @@ -11,6 +11,8 @@ unit form_main;
11 11
12 {$mode objfpc}{$H+} 12 {$mode objfpc}{$H+}
13 13
  14 +{$DEFINE DEBUG}
  15 +
14 interface 16 interface
15 17
16 uses 18 uses
@@ -66,6 +68,11 @@ type @@ -66,6 +68,11 @@ type
66 GBContingencyRows: TGroupBox; 68 GBContingencyRows: TGroupBox;
67 GBContingencyConsequence: TGroupBox; 69 GBContingencyConsequence: TGroupBox;
68 GBMatrix: TGroupBox; 70 GBMatrix: TGroupBox;
  71 + GroupBox1: TGroupBox;
  72 + LabelPA: TLabel;
  73 + LabelPB: TLabel;
  74 + LabelPI: TLabel;
  75 + LabelPG: TLabel;
69 LabelCsq10: TLabel; 76 LabelCsq10: TLabel;
70 LabelCsq3: TLabel; 77 LabelCsq3: TLabel;
71 LabelCsq5: TLabel; 78 LabelCsq5: TLabel;
@@ -75,7 +82,6 @@ type @@ -75,7 +82,6 @@ type
75 LabelCsq4: TLabel; 82 LabelCsq4: TLabel;
76 LabelCsq7: TLabel; 83 LabelCsq7: TLabel;
77 LabelQuestion: TLabel; 84 LabelQuestion: TLabel;
78 - LabelPointsOnConditionBegin: TLabel;  
79 LabelCsq1: TLabel; 85 LabelCsq1: TLabel;
80 LabelCsq2: TLabel; 86 LabelCsq2: TLabel;
81 LabelThen: TLabel; 87 LabelThen: TLabel;
@@ -94,6 +100,7 @@ type @@ -94,6 +100,7 @@ type
94 ListBoxContingencies: TListBox; 100 ListBoxContingencies: TListBox;
95 MainMenu1: TMainMenu; 101 MainMenu1: TMainMenu;
96 MemoExperimentAim: TMemo; 102 MemoExperimentAim: TMemo;
  103 + MenuItemSaveAs: TMenuItem;
97 MenuItemFile: TMenuItem; 104 MenuItemFile: TMenuItem;
98 MenuItemExit: TMenuItem; 105 MenuItemExit: TMenuItem;
99 MenuItemOpen: TMenuItem; 106 MenuItemOpen: TMenuItem;
@@ -107,12 +114,16 @@ type @@ -107,12 +114,16 @@ type
107 RGContingencyStyle: TRadioGroup; 114 RGContingencyStyle: TRadioGroup;
108 RGEndCriteriaStyle: TRadioGroup; 115 RGEndCriteriaStyle: TRadioGroup;
109 RGPoints: TRadioGroup; 116 RGPoints: TRadioGroup;
  117 + SaveDialog: TSaveDialog;
110 SpinEditContingencyPoints: TSpinEdit; 118 SpinEditContingencyPoints: TSpinEdit;
111 SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit; 119 SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit;
112 SpinEditEndCriteriaLastCycles: TSpinEdit; 120 SpinEditEndCriteriaLastCycles: TSpinEdit;
113 SpinEditEndCriteriaAbsCycles: TSpinEdit; 121 SpinEditEndCriteriaAbsCycles: TSpinEdit;
114 SpinEditCyclesValue: TSpinEdit; 122 SpinEditCyclesValue: TSpinEdit;
115 - SpinEditOnConditionBegin: TSpinEdit; 123 + SpinEditOnConditionBeginA: TSpinEdit;
  124 + SpinEditOnConditionBeginB: TSpinEdit;
  125 + SpinEditOnConditionBeginI: TSpinEdit;
  126 + SpinEditOnConditionBeginG: TSpinEdit;
116 SpinEditTurnValue: TSpinEdit; 127 SpinEditTurnValue: TSpinEdit;
117 TabSheetContingencies: TTabSheet; 128 TabSheetContingencies: TTabSheet;
118 TabSheetConditions: TTabSheet; 129 TabSheetConditions: TTabSheet;
@@ -125,7 +136,9 @@ type @@ -125,7 +136,9 @@ type
125 procedure BtnReorderCondClick(Sender: TObject); 136 procedure BtnReorderCondClick(Sender: TObject);
126 procedure BtnReorderContingencyClick(Sender: TObject); 137 procedure BtnReorderContingencyClick(Sender: TObject);
127 procedure ButtonPreviewMessageClick(Sender: TObject); 138 procedure ButtonPreviewMessageClick(Sender: TObject);
  139 + procedure CGGlobalItemClick(Sender: TObject; Index: integer);
128 procedure CheckBoxImutableMessageChange(Sender: TObject); 140 procedure CheckBoxImutableMessageChange(Sender: TObject);
  141 + procedure ChkMatrixTypeClick(Sender: TObject);
129 procedure ChkDotsCleanDotsChange(Sender: TObject); 142 procedure ChkDotsCleanDotsChange(Sender: TObject);
130 // 143 //
131 procedure ConsequenceMessageEditingDone(Sender: TObject); 144 procedure ConsequenceMessageEditingDone(Sender: TObject);
@@ -140,13 +153,15 @@ type @@ -140,13 +153,15 @@ type
140 procedure ComboCurrentContingencyChange(Sender: TObject); 153 procedure ComboCurrentContingencyChange(Sender: TObject);
141 procedure EditConditionNameEditingDone(Sender: TObject); 154 procedure EditConditionNameEditingDone(Sender: TObject);
142 procedure EditContingencyNameEditingDone(Sender: TObject); 155 procedure EditContingencyNameEditingDone(Sender: TObject);
143 - procedure EditMessSufixZeroChange(Sender: TObject); 156 + procedure EditMessDone(Sender: TObject);
144 procedure EditQuestionEditingDone(Sender: TObject); 157 procedure EditQuestionEditingDone(Sender: TObject);
  158 + procedure EditExperimentEditingDone(Sender: TObject);
145 procedure FormActivate(Sender: TObject); 159 procedure FormActivate(Sender: TObject);
146 procedure FormCreate(Sender: TObject); 160 procedure FormCreate(Sender: TObject);
147 procedure FormDestroy(Sender: TObject); 161 procedure FormDestroy(Sender: TObject);
148 procedure MenuItemExitClick(Sender: TObject); 162 procedure MenuItemExitClick(Sender: TObject);
149 procedure MenuItemOpenClick(Sender: TObject); 163 procedure MenuItemOpenClick(Sender: TObject);
  164 + procedure MenuItemSaveAsClick(Sender: TObject);
150 procedure RGBroadcastMessageClick(Sender: TObject); 165 procedure RGBroadcastMessageClick(Sender: TObject);
151 procedure RGContingencyStyleClick(Sender: TObject); 166 procedure RGContingencyStyleClick(Sender: TObject);
152 procedure RGContingencyStyleExit(Sender: TObject); 167 procedure RGContingencyStyleExit(Sender: TObject);
@@ -158,6 +173,7 @@ type @@ -158,6 +173,7 @@ type
158 procedure SpinEditEndCriteriaAbsCyclesEditingDone(Sender: TObject); 173 procedure SpinEditEndCriteriaAbsCyclesEditingDone(Sender: TObject);
159 procedure SpinEditEndCriteriaInterlockingEditingDone( 174 procedure SpinEditEndCriteriaInterlockingEditingDone(
160 Sender: TObject); 175 Sender: TObject);
  176 + procedure SpinEditOnConditionBeginAEditingDone(Sender: TObject);
161 procedure SpinEditTurnValueEditingDone(Sender: TObject); 177 procedure SpinEditTurnValueEditingDone(Sender: TObject);
162 procedure XMLPropStorageRestoreProperties(Sender: TObject); 178 procedure XMLPropStorageRestoreProperties(Sender: TObject);
163 procedure XMLPropStorageSavingProperties(Sender: TObject); 179 procedure XMLPropStorageSavingProperties(Sender: TObject);
@@ -170,7 +186,7 @@ type @@ -170,7 +186,7 @@ type
170 procedure LoadExperiment; 186 procedure LoadExperiment;
171 procedure LoadSectionExperiment; 187 procedure LoadSectionExperiment;
172 procedure LoadSectionCondition(ASection: string); 188 procedure LoadSectionCondition(ASection: string);
173 - procedure LoadContingency(ASection, AContingency: string);// A condition section and a contingency key prefix 189 + procedure LoadContingency(ASection, AContingency: string);// LabelPA condition section and LabelPA contingency key prefix
174 procedure SaveExperiment; 190 procedure SaveExperiment;
175 procedure SaveSectionExperiment; 191 procedure SaveSectionExperiment;
176 procedure SaveSectionCondition(ASection: string); 192 procedure SaveSectionCondition(ASection: string);
@@ -192,9 +208,11 @@ type @@ -192,9 +208,11 @@ type
192 procedure UpdateContingencyCombo(ASection: String); 208 procedure UpdateContingencyCombo(ASection: String);
193 private 209 private
194 FLoading : Boolean; 210 FLoading : Boolean;
  211 + FPersistentTXTFilename : string;
195 function GetContingencyName(IsMeta:Boolean; MustIncrement:Boolean=True):string; 212 function GetContingencyName(IsMeta:Boolean; MustIncrement:Boolean=True):string;
196 procedure IncContingencyName(var AContingency : string; N : integer = 1); 213 procedure IncContingencyName(var AContingency : string; N : integer = 1);
197 procedure ReadContingencyNames(ASection, AContingency, AKeySuffix:string; S:TStrings); 214 procedure ReadContingencyNames(ASection, AContingency, AKeySuffix:string; S:TStrings);
  215 + procedure ReadContingencyValuesInSection(LS, LC : string; Keys:TStrings);
198 public 216 public
199 { public declarations } 217 { public declarations }
200 end; 218 end;
@@ -206,6 +224,8 @@ implementation @@ -206,6 +224,8 @@ implementation
206 224
207 uses game_resources, game_actors, game_actors_point, string_methods, strutils; 225 uses game_resources, game_actors, game_actors_point, string_methods, strutils;
208 226
  227 +const SV_FILENAME : string = 'Filename';
  228 +
209 {$R *.lfm} 229 {$R *.lfm}
210 230
211 { TFormDesigner } 231 { TFormDesigner }
@@ -213,13 +233,41 @@ uses game_resources, game_actors, game_actors_point, string_methods, strutils; @@ -213,13 +233,41 @@ uses game_resources, game_actors, game_actors_point, string_methods, strutils;
213 procedure TFormDesigner.MenuItemOpenClick(Sender: TObject); 233 procedure TFormDesigner.MenuItemOpenClick(Sender: TObject);
214 begin 234 begin
215 if OpenDialog.Execute then 235 if OpenDialog.Execute then
216 - begin  
217 - if FExperiment.FileName = OpenDialog.FileName then  
218 - Exit;  
219 - FExperiment.Free;  
220 - FExperiment := TIniFile.Create(OpenDialog.FileName);  
221 - XMLPropStorage.StoredValue['FileName'] := FExperiment.FileName;  
222 - end; 236 + begin
  237 + if FExperiment.FileName = OpenDialog.FileName then
  238 + Exit;
  239 + SaveExperiment;
  240 + FExperiment.Free;
  241 + FExperiment := TIniFile.Create(OpenDialog.FileName);
  242 + XMLPropStorage.StoredValue[SV_FILENAME] := FExperiment.FileName;
  243 + XMLPropStorage.FileName := ExtractFilePath(FExperiment.FileName)+'persistence.xml';
  244 + LoadExperiment;
  245 +
  246 + OpenDialog.InitialDir:=ExtractFilePath(FExperiment.FileName);
  247 + SaveDialog.InitialDir:=ExtractFilePath(FExperiment.FileName);
  248 + end;
  249 +end;
  250 +
  251 +procedure TFormDesigner.MenuItemSaveAsClick(Sender: TObject);
  252 +var
  253 + LOldExperimentPath : string;
  254 +begin
  255 + if SaveDialog.Execute then
  256 + begin
  257 + if FExperiment.FileName = SaveDialog.FileName then
  258 + Exit;
  259 + LOldExperimentPath := FExperiment.FileName;
  260 + SaveExperiment;
  261 + FExperiment.Free;
  262 + CopyFile(LOldExperimentPath,SaveDialog.FileName);
  263 + FExperiment := TIniFile.Create(SaveDialog.FileName);
  264 + XMLPropStorage.StoredValue[SV_FILENAME] := FExperiment.FileName;
  265 +
  266 + XMLPropStorage.FileName := ExtractFilePath(FExperiment.FileName)+'persistence.xml';
  267 +
  268 + OpenDialog.InitialDir:=ExtractFilePath(FExperiment.FileName);
  269 + SaveDialog.InitialDir:=ExtractFilePath(FExperiment.FileName);
  270 + end;
223 end; 271 end;
224 272
225 procedure TFormDesigner.RGBroadcastMessageClick(Sender: TObject); 273 procedure TFormDesigner.RGBroadcastMessageClick(Sender: TObject);
@@ -427,6 +475,8 @@ begin @@ -427,6 +475,8 @@ begin
427 end; 475 end;
428 476
429 procedure TFormDesigner.RGPointsClick(Sender: TObject); 477 procedure TFormDesigner.RGPointsClick(Sender: TObject);
  478 +var
  479 + LVisible : Boolean;
430 begin 480 begin
431 if Sender = RGPoints then 481 if Sender = RGPoints then
432 case TRadioGroup(Sender).ItemIndex of 482 case TRadioGroup(Sender).ItemIndex of
@@ -436,6 +486,13 @@ begin @@ -436,6 +486,13 @@ begin
436 CBPointsType.Items.Append('Individual A'); 486 CBPointsType.Items.Append('Individual A');
437 CBPointsType.Items.Append('Individual B'); 487 CBPointsType.Items.Append('Individual B');
438 CBPointsType.Items.Append('Para o Grupo'); 488 CBPointsType.Items.Append('Para o Grupo');
  489 + LVisible := True;
  490 + SpinEditOnConditionBeginA.Visible:=LVisible;
  491 + SpinEditOnConditionBeginB.Visible:=LVisible;
  492 + SpinEditOnConditionBeginI.Visible:=not LVisible;
  493 + LabelPA.Visible:=LVisible;
  494 + LabelPB.Visible:=LVisible;
  495 + LabelPI.Visible:=not LVisible;
439 end; 496 end;
440 497
441 1: 498 1:
@@ -443,8 +500,22 @@ begin @@ -443,8 +500,22 @@ begin
443 CBPointsType.Items.Clear; 500 CBPointsType.Items.Clear;
444 CBPointsType.Items.Append('Individual'); 501 CBPointsType.Items.Append('Individual');
445 CBPointsType.Items.Append('Para o Grupo'); 502 CBPointsType.Items.Append('Para o Grupo');
  503 + LVisible := False;
  504 + SpinEditOnConditionBeginA.Visible:=LVisible;
  505 + SpinEditOnConditionBeginB.Visible:=LVisible;
  506 + SpinEditOnConditionBeginI.Visible:=not LVisible;
  507 + LabelPA.Visible:=LVisible;
  508 + LabelPB.Visible:=LVisible;
  509 + LabelPI.Visible:=not LVisible;
446 end; 510 end;
447 end; 511 end;
  512 +
  513 + if not FLoading then
  514 + with FExperiment do
  515 + case RGPoints.ItemIndex of
  516 + 0: WriteBool(SEC_EXPERIMENT, KEY_POINTS_TYPE, True);
  517 + 1: WriteBool(SEC_EXPERIMENT, KEY_POINTS_TYPE, False);
  518 + end;
448 end; 519 end;
449 520
450 procedure TFormDesigner.SpinEditCyclesValueEditingDone(Sender: TObject); 521 procedure TFormDesigner.SpinEditCyclesValueEditingDone(Sender: TObject);
@@ -485,6 +556,30 @@ begin @@ -485,6 +556,30 @@ begin
485 end; 556 end;
486 end; 557 end;
487 558
  559 +procedure TFormDesigner.SpinEditOnConditionBeginAEditingDone(Sender: TObject);
  560 +var
  561 + LS: string;
  562 +begin
  563 + if Sender is TSpinEdit then
  564 + with FExperiment do
  565 + if ComboCurrentCondition.ItemIndex <> -1 then
  566 + begin
  567 + LS := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1);
  568 +
  569 + if TSpinEdit(Sender) = SpinEditOnConditionBeginA then
  570 + WriteInteger(LS, KEY_POINTS_ONSTART_A, SpinEditOnConditionBeginA.Value);
  571 +
  572 + if TSpinEdit(Sender) = SpinEditOnConditionBeginB then
  573 + WriteInteger(LS, KEY_POINTS_ONSTART_B, SpinEditOnConditionBeginB.Value);
  574 +
  575 + if TSpinEdit(Sender) = SpinEditOnConditionBeginI then
  576 + WriteInteger(LS, KEY_POINTS_ONSTART_I, SpinEditOnConditionBeginI.Value);
  577 +
  578 + if TSpinEdit(Sender) = SpinEditOnConditionBeginG then
  579 + WriteInteger(LS, KEY_POINTS_ONSTART_G, SpinEditOnConditionBeginG.Value);
  580 + end;
  581 +end;
  582 +
488 procedure TFormDesigner.SpinEditTurnValueEditingDone(Sender: TObject); 583 procedure TFormDesigner.SpinEditTurnValueEditingDone(Sender: TObject);
489 var 584 var
490 LS: string; 585 LS: string;
@@ -498,17 +593,31 @@ begin @@ -498,17 +593,31 @@ begin
498 end; 593 end;
499 594
500 procedure TFormDesigner.XMLPropStorageRestoreProperties(Sender: TObject); 595 procedure TFormDesigner.XMLPropStorageRestoreProperties(Sender: TObject);
  596 +
501 begin 597 begin
502 LoadExperiment; 598 LoadExperiment;
503 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; 599 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text;
504 - ListBoxContingencies.Items.Text := ComboCurrentContingency.Items.Text;  
505 - RGPointsClick(RGPoints);  
506 - RGEndCriteriaStyleClick(RGEndCriteriaStyle); 600 + UpdateContingencyList(ExtractDelimited(1,ComboCurrentCondition.Text,['|']));
  601 + //RGPointsClick(RGPoints);
  602 + //RGEndCriteriaStyleClick(RGEndCriteriaStyle);
507 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; 603 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0;
508 end; 604 end;
509 605
510 procedure TFormDesigner.XMLPropStorageSavingProperties(Sender: TObject); 606 procedure TFormDesigner.XMLPropStorageSavingProperties(Sender: TObject);
  607 + procedure SavePropStorageFilename;
  608 + var
  609 + S : TStringList;
  610 + begin
  611 + S := TStringList.Create;
  612 + try
  613 + S.Text := XMLPropStorage.FileName;
  614 + S.SaveToFile(FPersistentTXTFilename);
  615 + finally
  616 + S.Free;
  617 + end;
  618 + end;
511 begin 619 begin
  620 + SavePropStorageFilename;
512 SaveExperiment; 621 SaveExperiment;
513 end; 622 end;
514 623
@@ -738,9 +847,9 @@ begin @@ -738,9 +847,9 @@ begin
738 SpinEditContingencyPoints.Value := LPoints; 847 SpinEditContingencyPoints.Value := LPoints;
739 848
740 SCode := ExtractDelimited(2,S,['|']); 849 SCode := ExtractDelimited(2,S,['|']);
741 - CS := GetConsequenceStylesFromString(SCode); 850 + CS := GetConsequenceStyleFromString(SCode);
742 case RGPoints.ItemIndex of 851 case RGPoints.ItemIndex of
743 - 0: { A & B } 852 + 0: { LabelPA & B }
744 begin 853 begin
745 if gscA in CS then CBPointsType.ItemIndex := 0; 854 if gscA in CS then CBPointsType.ItemIndex := 0;
746 if gscB in CS then CBPointsType.ItemIndex := 1; 855 if gscB in CS then CBPointsType.ItemIndex := 1;
@@ -768,8 +877,6 @@ begin @@ -768,8 +877,6 @@ begin
768 RGBroadcastMessage.ItemIndex := 1 877 RGBroadcastMessage.ItemIndex := 1
769 else 878 else
770 RGBroadcastMessage.ItemIndex := 2; 879 RGBroadcastMessage.ItemIndex := 2;
771 -  
772 -  
773 end; 880 end;
774 881
775 procedure TFormDesigner.UpdateContingencyList(ASection: String); 882 procedure TFormDesigner.UpdateContingencyList(ASection: String);
@@ -831,6 +938,27 @@ begin @@ -831,6 +938,27 @@ begin
831 end; 938 end;
832 end; 939 end;
833 940
  941 +procedure TFormDesigner.ReadContingencyValuesInSection(LS, LC: string;
  942 + Keys: TStrings);
  943 +begin
  944 + with FExperiment do
  945 + begin
  946 + Keys.BeginUpdate;
  947 + Keys.Values[LC + KEY_CONT_NAME] := ReadString(LS,LC+KEY_CONT_NAME,'');
  948 + Keys.Values[LC + KEY_CRITERIA] := ReadString(LS, LC + KEY_CRITERIA,'');
  949 + Keys.Values[LC + KEY_CONSEQUE] := ReadString(LS, LC + KEY_CONSEQUE,'');
  950 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND,'');
  951 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,'');
  952 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,'');
  953 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,'');
  954 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,'');
  955 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,'');
  956 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,'');
  957 + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO,'');
  958 + Keys.EndUpdate;
  959 + end;
  960 +end;
  961 +
834 procedure TFormDesigner.SaveSectionExperiment; 962 procedure TFormDesigner.SaveSectionExperiment;
835 begin 963 begin
836 with FExperiment do 964 with FExperiment do
@@ -857,8 +985,7 @@ begin @@ -857,8 +985,7 @@ begin
857 EditResearcherName.Text := ReadString(SEC_EXPERIMENT, KEY_RESEARCHER, ''); 985 EditResearcherName.Text := ReadString(SEC_EXPERIMENT, KEY_RESEARCHER, '');
858 EditExperimentName.Text := ReadString(SEC_EXPERIMENT, KEY_NAME, ''); 986 EditExperimentName.Text := ReadString(SEC_EXPERIMENT, KEY_NAME, '');
859 MemoExperimentAim.Text := ReadString(SEC_EXPERIMENT, KEY_AIM, ''); 987 MemoExperimentAim.Text := ReadString(SEC_EXPERIMENT, KEY_AIM, '');
860 - CGGlobal.Checked[0] :=  
861 - ReadBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, False); 988 + CGGlobal.Checked[0] := ReadBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, False);
862 CGGlobal.Checked[1] := ReadBool(SEC_EXPERIMENT, KEY_GEN_PLAYER_AS_NEEDED, False); 989 CGGlobal.Checked[1] := ReadBool(SEC_EXPERIMENT, KEY_GEN_PLAYER_AS_NEEDED, False);
863 CGGlobal.Checked[2] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANPLAY, False); 990 CGGlobal.Checked[2] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANPLAY, False);
864 CGGlobal.Checked[3] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANCHAT, False); 991 CGGlobal.Checked[3] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANCHAT, False);
@@ -877,7 +1004,10 @@ begin @@ -877,7 +1004,10 @@ begin
877 begin 1004 begin
878 WriteString(ASection, KEY_COND_NAME, EditConditionName.Text); 1005 WriteString(ASection, KEY_COND_NAME, EditConditionName.Text);
879 WriteInteger(ASection, KEY_TURN_VALUE, SpinEditTurnValue.Value); 1006 WriteInteger(ASection, KEY_TURN_VALUE, SpinEditTurnValue.Value);
880 - WriteInteger(ASection, KEY_POINTS_ONSTART,SpinEditOnConditionBegin.Value); 1007 + WriteInteger(ASection, KEY_POINTS_ONSTART_A,SpinEditOnConditionBeginA.Value);
  1008 + WriteInteger(ASection, KEY_POINTS_ONSTART_B,SpinEditOnConditionBeginB.Value);
  1009 + WriteInteger(ASection, KEY_POINTS_ONSTART_I,SpinEditOnConditionBeginI.Value);
  1010 + WriteInteger(ASection, KEY_POINTS_ONSTART_G,SpinEditOnConditionBeginG.Value);
881 WriteInteger(ASection, KEY_CYCLES_VALUE, SpinEditCyclesValue.Value); 1011 WriteInteger(ASection, KEY_CYCLES_VALUE, SpinEditCyclesValue.Value);
882 WriteString(ASection, KEY_PROMPT_MESSAGE, EditQuestion.Text); 1012 WriteString(ASection, KEY_PROMPT_MESSAGE, EditQuestion.Text);
883 WriteString(ASection, KEY_PROMPT_STYLE, GetPromptQuestionStringFromCGQuestion); 1013 WriteString(ASection, KEY_PROMPT_STYLE, GetPromptQuestionStringFromCGQuestion);
@@ -1007,7 +1137,7 @@ var @@ -1007,7 +1137,7 @@ var
1007 begin 1137 begin
1008 CS := [gscMessage,gscPoints]; 1138 CS := [gscMessage,gscPoints];
1009 case RGPoints.ItemIndex of 1139 case RGPoints.ItemIndex of
1010 - 0: { A & B } 1140 + 0: { LabelPA & B }
1011 case CBPointsType.ItemIndex of 1141 case CBPointsType.ItemIndex of
1012 0 {'Individual A'} : CS += [gscA]; 1142 0 {'Individual A'} : CS += [gscA];
1013 1 {'Individual B'} : CS += [gscB]; 1143 1 {'Individual B'} : CS += [gscB];
@@ -1027,7 +1157,7 @@ begin @@ -1027,7 +1157,7 @@ begin
1027 end; 1157 end;
1028 1158
1029 Result := IntToStr(SpinEditContingencyPoints.Value)+',0|'; 1159 Result := IntToStr(SpinEditContingencyPoints.Value)+',0|';
1030 - Result += GetConsequenceStylesString(CS); 1160 + Result += GetConsequenceStyleString(CS);
1031 end; 1161 end;
1032 1162
1033 function TFormDesigner.GetContingencyCriteria: string; 1163 function TFormDesigner.GetContingencyCriteria: string;
@@ -1112,7 +1242,6 @@ begin @@ -1112,7 +1242,6 @@ begin
1112 begin 1242 begin
1113 EditConditionName.Text := ReadString(ASection, KEY_COND_NAME, ASection); 1243 EditConditionName.Text := ReadString(ASection, KEY_COND_NAME, ASection);
1114 SpinEditTurnValue.Value := ReadInteger(ASection, KEY_TURN_VALUE, 2); 1244 SpinEditTurnValue.Value := ReadInteger(ASection, KEY_TURN_VALUE, 2);
1115 - SpinEditOnConditionBegin.Value := ReadInteger(ASection, KEY_POINTS_ONSTART,0);  
1116 SpinEditCyclesValue.Value := ReadInteger(ASection, KEY_CYCLES_VALUE, 2); 1245 SpinEditCyclesValue.Value := ReadInteger(ASection, KEY_CYCLES_VALUE, 2);
1117 1246
1118 CheckBoxShouldAskQuestion.Checked := False; 1247 CheckBoxShouldAskQuestion.Checked := False;
@@ -1123,6 +1252,11 @@ begin @@ -1123,6 +1252,11 @@ begin
1123 if (EditQuestion.Text <> '') or (ReadString(ASection, KEY_PROMPT_STYLE, '') <> '') then 1252 if (EditQuestion.Text <> '') or (ReadString(ASection, KEY_PROMPT_STYLE, '') <> '') then
1124 CheckBoxShouldAskQuestion.Checked := True; 1253 CheckBoxShouldAskQuestion.Checked := True;
1125 end; 1254 end;
  1255 + LabelQuestion.Visible:= CheckBoxShouldAskQuestion.Checked;
  1256 + SpinEditOnConditionBeginA.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_A, 0);
  1257 + SpinEditOnConditionBeginB.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_B, 0);
  1258 + SpinEditOnConditionBeginI.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_I, 0);
  1259 + SpinEditOnConditionBeginG.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_G, 0);
1126 1260
1127 SetRGEndCriteriaStyle(ReadString(ASection, KEY_ENDCRITERIA, 'O QUE OCORRER PRIMEIRO')); 1261 SetRGEndCriteriaStyle(ReadString(ASection, KEY_ENDCRITERIA, 'O QUE OCORRER PRIMEIRO'));
1128 SpinEditEndCriteriaAbsCycles.Value := ReadInteger(ASection, KEY_ENDCRITERIA_CYCLES, 20); 1262 SpinEditEndCriteriaAbsCycles.Value := ReadInteger(ASection, KEY_ENDCRITERIA_CYCLES, 20);
@@ -1180,8 +1314,47 @@ begin @@ -1180,8 +1314,47 @@ begin
1180 end; 1314 end;
1181 1315
1182 procedure TFormDesigner.FormCreate(Sender: TObject); 1316 procedure TFormDesigner.FormCreate(Sender: TObject);
  1317 +var
  1318 + LRootPath: RawByteString;
  1319 +
  1320 + function ReadLnFromFile(AFilename:string;ALine : integer):string;
  1321 + var
  1322 + S : TStringList;
  1323 + begin
  1324 + Result := '';
  1325 + if FileExists(AFilename) then
  1326 + begin
  1327 + S := TStringList.Create;
  1328 + try
  1329 + S.LoadFromFile(AFilename);
  1330 + if S.Count > 0 then
  1331 + Result := S[ALine];
  1332 + finally
  1333 + S.Free;
  1334 + end;
  1335 + end
  1336 + end;
1183 begin 1337 begin
  1338 + // TRadioGroup OnClick events are triggered programmatically by LCL code, not by us
  1339 + // FLoading is a temporary workaround to avoid
  1340 + // calls for SaveProcedures while loading FExperiment
1184 FLoading := True; 1341 FLoading := True;
  1342 +
  1343 +
  1344 + LRootPath := ExtractFilePath(Application.ExeName);
  1345 +
  1346 + // FPersistentTXTFilename must not change during runtime.
  1347 + FPersistentTXTFilename := LRootPath+'persistence.txt';
  1348 +
  1349 + // XMLPropStorage.FileName may change during runtime
  1350 + XMLPropStorage.FileName := ReadLnFromFile(FPersistentTXTFilename,0);
  1351 + if XMLPropStorage.FileName = '' then
  1352 + XMLPropStorage.FileName := LRootPath+'persistence.xml';
  1353 +
  1354 + // XMLPropStorage.StoredValue[SV_FILENAME] may change during runtime
  1355 + XMLPropStorage.StoredValue[SV_FILENAME] := LRootPath+'persistence.ini';
  1356 + OpenDialog.InitialDir:=LRootPath;
  1357 + SaveDialog.InitialDir:=LRootPath;
1185 end; 1358 end;
1186 1359
1187 procedure TFormDesigner.FormDestroy(Sender: TObject); 1360 procedure TFormDesigner.FormDestroy(Sender: TObject);
@@ -1202,11 +1375,12 @@ begin @@ -1202,11 +1375,12 @@ begin
1202 if ComboCurrentCondition.ItemIndex <> -1 then 1375 if ComboCurrentCondition.ItemIndex <> -1 then
1203 begin 1376 begin
1204 LS := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1); 1377 LS := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1);
  1378 + EditQuestion.Text:='';
1205 WriteString(LS, KEY_PROMPT_MESSAGE, ''); 1379 WriteString(LS, KEY_PROMPT_MESSAGE, '');
1206 WriteString(LS, KEY_PROMPT_STYLE, ''); 1380 WriteString(LS, KEY_PROMPT_STYLE, '');
1207 end; 1381 end;
1208 end; 1382 end;
1209 - 1383 + LabelQuestion.Visible:= CheckBoxShouldAskQuestion.Checked;
1210 EditQuestion.Visible := CheckBoxShouldAskQuestion.Checked; 1384 EditQuestion.Visible := CheckBoxShouldAskQuestion.Checked;
1211 CGQuestion.Visible := CheckBoxShouldAskQuestion.Checked; 1385 CGQuestion.Visible := CheckBoxShouldAskQuestion.Checked;
1212 end; 1386 end;
@@ -1239,8 +1413,22 @@ begin @@ -1239,8 +1413,22 @@ begin
1239 end; 1413 end;
1240 1414
1241 procedure TFormDesigner.ComboCurrentConditionChange(Sender: TObject); 1415 procedure TFormDesigner.ComboCurrentConditionChange(Sender: TObject);
  1416 +var
  1417 + LS, LC: String;
1242 begin 1418 begin
1243 - LoadSectionCondition(SEC_CONDITION + IntToStr(ComboCurrentCondition.ItemIndex + 1)); 1419 + LS := SEC_CONDITION + IntToStr(ComboCurrentCondition.ItemIndex + 1);
  1420 + LoadSectionCondition(LS);
  1421 + UpdateContingencyList(LS);
  1422 + if ListBoxContingencies.Items.Count > 0 then
  1423 + begin
  1424 + LC := ExtractDelimited(1,ListBoxContingencies.Items[0],['|']);
  1425 + if Pos(KEY_METACONTINGENCY,LC) > 0 then
  1426 + RGContingencyType.ItemIndex := 1
  1427 + else
  1428 + RGContingencyType.ItemIndex := 0;
  1429 + RGContingencyTypeClick(ComboCurrentCondition);
  1430 + LoadContingency(LS,LC);
  1431 + end;
1244 end; 1432 end;
1245 1433
1246 procedure TFormDesigner.ComboCurrentContingencyChange(Sender: TObject); 1434 procedure TFormDesigner.ComboCurrentContingencyChange(Sender: TObject);
@@ -1275,13 +1463,44 @@ begin @@ -1275,13 +1463,44 @@ begin
1275 WriteString(LS, LC+ KEY_CONT_NAME, EditContingencyName.Text); 1463 WriteString(LS, LC+ KEY_CONT_NAME, EditContingencyName.Text);
1276 ComboCurrentContingency.Items[ComboCurrentContingency.ItemIndex] := 1464 ComboCurrentContingency.Items[ComboCurrentContingency.ItemIndex] :=
1277 LC + '|' + EditContingencyName.Text; 1465 LC + '|' + EditContingencyName.Text;
1278 - ListBoxContingencies.Items.Text := ComboCurrentContingency.Items.Text; 1466 + UpdateContingencyList(LS);
1279 end; 1467 end;
1280 end; 1468 end;
1281 1469
1282 -procedure TFormDesigner.EditMessSufixZeroChange(Sender: TObject); 1470 +procedure TFormDesigner.EditMessDone(Sender: TObject);
  1471 +var
  1472 + LSection, LContingency: String;
1283 begin 1473 begin
  1474 + LSection := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1);
  1475 + LContingency := ExtractDelimited(1,ComboCurrentContingency.Text,['|']);
  1476 +
  1477 + if Sender is TEdit then
  1478 + with FExperiment do
  1479 + begin
  1480 + if TEdit(Sender) = EditMessPrefix then
  1481 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND, EditMessPrefix.Text);
  1482 +
  1483 + if TEdit(Sender) = EditMessPrefixLoss then
  1484 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,EditMessPrefixLoss.Text);
  1485 +
  1486 + if TEdit(Sender) = EditMessSufixLossSingular then
  1487 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,EditMessSufixLossSingular.Text);
1284 1488
  1489 + if TEdit(Sender) = EditMessSufixLossPlural then
  1490 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,EditMessSufixLossPlural.Text);
  1491 +
  1492 + if TEdit(Sender) = EditMessPrefixEarn then
  1493 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,EditMessPrefixEarn.Text);
  1494 +
  1495 + if TEdit(Sender) = EditMessSufixEarnSingular then
  1496 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,EditMessSufixEarnSingular.Text);
  1497 +
  1498 + if TEdit(Sender) = EditMessSufixEarnPlural then
  1499 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,EditMessSufixEarnPlural.Text);
  1500 +
  1501 + if TEdit(Sender) = EditMessSufixZero then
  1502 + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_ZERO, EditMessSufixZero.Text);
  1503 + end;
1285 end; 1504 end;
1286 1505
1287 procedure TFormDesigner.ConsequenceMessageEditingDone(Sender: TObject); 1506 procedure TFormDesigner.ConsequenceMessageEditingDone(Sender: TObject);
@@ -1305,6 +1524,27 @@ begin @@ -1305,6 +1524,27 @@ begin
1305 end; 1524 end;
1306 end; 1525 end;
1307 1526
  1527 +procedure TFormDesigner.EditExperimentEditingDone(Sender: TObject);
  1528 +begin
  1529 + with FExperiment do
  1530 + begin
  1531 + if Sender is TEdit then
  1532 + begin
  1533 + if TEdit(Sender) = EditResearcherName then
  1534 + WriteString(SEC_EXPERIMENT, KEY_RESEARCHER, EditResearcherName.Text);
  1535 +
  1536 + if TEdit(Sender) = EditExperimentName then
  1537 + WriteString(SEC_EXPERIMENT, KEY_NAME, EditExperimentName.Text);
  1538 + end;
  1539 +
  1540 + if Sender is TMemo then
  1541 + begin
  1542 + if TMemo(Sender) = MemoExperimentAim then
  1543 + WriteString(SEC_EXPERIMENT, KEY_AIM, MemoExperimentAim.Text);
  1544 + end;
  1545 + end;
  1546 +end;
  1547 +
1308 procedure TFormDesigner.FormActivate(Sender: TObject); 1548 procedure TFormDesigner.FormActivate(Sender: TObject);
1309 begin 1549 begin
1310 FLoading := False; 1550 FLoading := False;
@@ -1313,15 +1553,48 @@ end; @@ -1313,15 +1553,48 @@ end;
1313 1553
1314 procedure TFormDesigner.BtnAppendCondClick(Sender: TObject); 1554 procedure TFormDesigner.BtnAppendCondClick(Sender: TObject);
1315 var 1555 var
1316 - i: integer; 1556 + i, LOldSection: integer;
  1557 + LContingency : TStringList;
  1558 + LS, KeyNameValue, LSectionToRead, LContingencyToRead, KeyName: String;
1317 begin 1559 begin
  1560 + // make LabelPA copy of old components
  1561 + LOldSection := ComboCurrentCondition.ItemIndex;
  1562 +
  1563 + // add new condition
1318 i := ComboCurrentCondition.Items.Add(''); 1564 i := ComboCurrentCondition.Items.Add('');
1319 ComboCurrentCondition.Items[i] := 1565 ComboCurrentCondition.Items[i] :=
1320 SEC_CONDITION + IntToStr(i + 1) + '|' + EditConditionName.Text; 1566 SEC_CONDITION + IntToStr(i + 1) + '|' + EditConditionName.Text;
1321 ComboCurrentCondition.ItemIndex := i; 1567 ComboCurrentCondition.ItemIndex := i;
1322 - SaveSectionCondition(SEC_CONDITION + IntToStr(i + 1)); 1568 + LS := SEC_CONDITION + IntToStr(i + 1);
  1569 + SaveSectionCondition(LS);
1323 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; 1570 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text;
1324 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; 1571 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0;
  1572 +
  1573 + // handle selection of contingencies
  1574 + if LOldSection > -1 then
  1575 + if ListBoxContingencies.Items.Count > 0 then
  1576 + if ListBoxContingencies.SelCount > 0 then
  1577 + begin
  1578 + LContingency := TStringList.Create;
  1579 + LSectionToRead := SEC_CONDITION+IntToStr(LOldSection+1);
  1580 + try
  1581 + for i := 0 to ListBoxContingencies.Items.Count -1 do
  1582 + if ListBoxContingencies.Selected[i] then
  1583 + begin
  1584 + LContingency.Clear;
  1585 + LContingencyToRead := ExtractDelimited(1,ListBoxContingencies.Items[i],['|']);
  1586 + ReadContingencyValuesInSection(LSectionToRead,LContingencyToRead,LContingency);
  1587 + for KeyNameValue in LContingency do
  1588 + begin
  1589 + KeyName := LContingency.ExtractName(KeyNameValue);
  1590 + FExperiment.WriteString(LS,KeyName,LContingency.Values[KeyName]);
  1591 + end;
  1592 + end;
  1593 + finally
  1594 + LContingency.Free;
  1595 + end;
  1596 + end;
  1597 + UpdateContingencyList(LS);
1325 end; 1598 end;
1326 1599
1327 procedure TFormDesigner.BtnAppendContingencyClick(Sender: TObject); 1600 procedure TFormDesigner.BtnAppendContingencyClick(Sender: TObject);
@@ -1344,7 +1617,7 @@ procedure TFormDesigner.BtnRemoveCondClick(Sender: TObject); @@ -1344,7 +1617,7 @@ procedure TFormDesigner.BtnRemoveCondClick(Sender: TObject);
1344 var 1617 var
1345 i: integer; 1618 i: integer;
1346 MustReorder: boolean; 1619 MustReorder: boolean;
1347 - LS: String; 1620 + LS, LC: String;
1348 1621
1349 procedure Reorder(index : integer); 1622 procedure Reorder(index : integer);
1350 var 1623 var
@@ -1396,6 +1669,18 @@ begin @@ -1396,6 +1669,18 @@ begin
1396 end; 1669 end;
1397 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; 1670 ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text;
1398 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; 1671 TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0;
  1672 + if ComboCurrentCondition.Items.Count > 0 then
  1673 + if ComboCurrentCondition.ItemIndex <> -1 then
  1674 + begin
  1675 + LS := ExtractDelimited(1, ComboCurrentCondition.Text, ['|']);
  1676 + LoadSectionCondition(LS);
  1677 + UpdateContingencyList(LS);
  1678 + if ListBoxContingencies.Items.Count > 0 then
  1679 + begin
  1680 + LC := ExtractDelimited(1, ListBoxContingencies.Items[0], ['|']);
  1681 + LoadContingency(LS,LC);
  1682 + end;
  1683 + end;
1399 end; 1684 end;
1400 end; 1685 end;
1401 1686
@@ -1405,25 +1690,6 @@ var @@ -1405,25 +1690,6 @@ var
1405 MustReorder: boolean; 1690 MustReorder: boolean;
1406 LS, LC: String; 1691 LS, LC: String;
1407 1692
1408 - procedure ReadContingencyValuesInSection(LS,LC : string; var Keys : TStringList);  
1409 - begin  
1410 - Keys.BeginUpdate;  
1411 - with FExperiment do  
1412 - begin  
1413 - Keys.Values[LC + KEY_CONT_NAME] := ReadString(LS,LC+KEY_CONT_NAME,'');  
1414 - Keys.Values[LC + KEY_CRITERIA] := ReadString(LS, LC + KEY_CRITERIA,'');  
1415 - Keys.Values[LC + KEY_CONSEQUE] := ReadString(LS, LC + KEY_CONSEQUE,'');  
1416 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND,'');  
1417 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,'');  
1418 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,'');  
1419 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,'');  
1420 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,'');  
1421 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,'');  
1422 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,'');  
1423 - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO,'');  
1424 - end;  
1425 - Keys.EndUpdate;  
1426 - end;  
1427 //todo:fix bug in here 1693 //todo:fix bug in here
1428 procedure Reorder(Index:integer); 1694 procedure Reorder(Index:integer);
1429 var 1695 var
@@ -1476,12 +1742,19 @@ begin @@ -1476,12 +1742,19 @@ begin
1476 ComboCurrentContingency.ItemIndex := i -1; 1742 ComboCurrentContingency.ItemIndex := i -1;
1477 end; 1743 end;
1478 UpdateContingencyList(LS); 1744 UpdateContingencyList(LS);
  1745 + if ComboCurrentContingency.Items.Count > 0 then
  1746 + if (ComboCurrentContingency.ItemIndex > -1) and
  1747 + (ComboCurrentContingency.ItemIndex < ComboCurrentContingency.Items.Count) then
  1748 + begin
  1749 + LC := ExtractDelimited(1, ComboCurrentContingency.Text, ['|']);
  1750 + LoadContingency(LS,LC);
  1751 + end;
1479 end; 1752 end;
1480 end; 1753 end;
1481 1754
1482 procedure TFormDesigner.BtnReorderCondClick(Sender: TObject); 1755 procedure TFormDesigner.BtnReorderCondClick(Sender: TObject);
1483 begin 1756 begin
1484 - // todo: custom reorder contingencies 1757 + // todo: custom reorder conditions
1485 ShowMessage('Não implementado.'); 1758 ShowMessage('Não implementado.');
1486 end; 1759 end;
1487 1760
@@ -1522,6 +1795,26 @@ begin @@ -1522,6 +1795,26 @@ begin
1522 CreateMessage(i); 1795 CreateMessage(i);
1523 end; 1796 end;
1524 1797
  1798 +procedure TFormDesigner.CGGlobalItemClick(Sender: TObject; Index: integer);
  1799 +begin
  1800 + if not FLoading then
  1801 + if Sender is TCheckGroup then
  1802 + with FExperiment do
  1803 + begin
  1804 + if Index = 0 then
  1805 + WriteBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, CGGlobal.Checked[Index]);
  1806 +
  1807 + if Index = 1 then
  1808 + WriteBool(SEC_EXPERIMENT, KEY_GEN_PLAYER_AS_NEEDED, CGGlobal.Checked[Index]);
  1809 +
  1810 + if Index = 2 then
  1811 + WriteBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANPLAY, CGGlobal.Checked[Index]);
  1812 +
  1813 + if Index = 3 then
  1814 + WriteBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANCHAT, CGGlobal.Checked[Index]);
  1815 + end;
  1816 +end;
  1817 +
1525 procedure TFormDesigner.CheckBoxImutableMessageChange(Sender: TObject); 1818 procedure TFormDesigner.CheckBoxImutableMessageChange(Sender: TObject);
1526 var 1819 var
1527 LVisible : Boolean; 1820 LVisible : Boolean;
@@ -1531,24 +1824,46 @@ begin @@ -1531,24 +1824,46 @@ begin
1531 if LVisible then 1824 if LVisible then
1532 begin 1825 begin
1533 LabelCsq3.Caption := 'Texto da mensagem de notificação'; 1826 LabelCsq3.Caption := 'Texto da mensagem de notificação';
1534 - LGamePoint := TGamePoint.Create(Self,IntToStr(SpinEditContingencyPoints.Value));  
1535 - if not FLoading then  
1536 - case RGContingencyType.ItemIndex of  
1537 - 0:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',False);  
1538 - 1:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',True);  
1539 - end;  
1540 - LGamePoint.Free;  
1541 ButtonPreviewMessage.Caption:= 'Ver como a mensagem será apresentada'; 1827 ButtonPreviewMessage.Caption:= 'Ver como a mensagem será apresentada';
  1828 + LGamePoint := TGamePoint.Create(nil,IntToStr(SpinEditContingencyPoints.Value));
  1829 + try
  1830 + if not FLoading then
  1831 + begin
  1832 + case RGContingencyType.ItemIndex of
  1833 + 0:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',False);
  1834 + 1:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',True);
  1835 + end;
  1836 +
  1837 + EditMessPrefixLoss.Text := '';
  1838 + EditMessSufixLossPlural.Text := '';
  1839 + EditMessSufixLossSingular.Text := '';
  1840 + EditMessPrefixEarn.Text := '';
  1841 + EditMessSufixEarnPlural.Text := '';
  1842 + EditMessSufixEarnSingular.Text := '';
  1843 + EditMessSufixZero.Text := '';
  1844 + end;
  1845 + finally
  1846 + LGamePoint.Free;
  1847 + end;
1542 end 1848 end
1543 else 1849 else
1544 begin 1850 begin
1545 LabelCsq3.Caption := 'Texto no início da mensagem'; 1851 LabelCsq3.Caption := 'Texto no início da mensagem';
1546 if not FLoading then 1852 if not FLoading then
1547 - case RGContingencyType.ItemIndex of  
1548 - 0:EditMessPrefix.Text := '$NICNAME';  
1549 - 1:EditMessPrefix.Text := 'Vocês';  
1550 - end;  
1551 - ButtonPreviewMessage.Caption:= 'Ver como a mensagem pode ser apresentada'; 1853 + begin
  1854 + case RGContingencyType.ItemIndex of
  1855 + 0:EditMessPrefix.Text := '$NICNAME';
  1856 + 1:EditMessPrefix.Text := 'Vocês';
  1857 + end;
  1858 + EditMessPrefixLoss.Text := 'retiraram';
  1859 + EditMessSufixLossSingular.Text := 'item escolar de uma escola pública.';
  1860 + EditMessSufixLossPlural.Text := 'itens escolares de uma escola pública.';
  1861 + EditMessPrefixEarn.Text := 'doaram';
  1862 + EditMessSufixEarnSingular.Text := 'item escolar a uma escola pública.';
  1863 + EditMessSufixEarnPlural.Text := 'itens escolares a uma escola pública.';
  1864 + EditMessSufixZero.Text := 'não doaram nem retiram itens escolares.';
  1865 + ButtonPreviewMessage.Caption:= 'Ver como a mensagem poderá ser apresentada';
  1866 + end;
1552 end; 1867 end;
1553 1868
1554 LabelCsq4.Visible := not LVisible; 1869 LabelCsq4.Visible := not LVisible;
@@ -1559,19 +1874,26 @@ begin @@ -1559,19 +1874,26 @@ begin
1559 LabelCsq9.Visible := not LVisible; 1874 LabelCsq9.Visible := not LVisible;
1560 LabelCsq10.Visible := not LVisible; 1875 LabelCsq10.Visible := not LVisible;
1561 EditMessPrefixLoss.Visible:= not LVisible; 1876 EditMessPrefixLoss.Visible:= not LVisible;
1562 - EditMessPrefixLoss.Text := '';  
1563 EditMessSufixLossPlural.Visible:= not LVisible; 1877 EditMessSufixLossPlural.Visible:= not LVisible;
1564 - EditMessSufixLossPlural.Text := '';  
1565 EditMessSufixLossSingular.Visible:= not LVisible; 1878 EditMessSufixLossSingular.Visible:= not LVisible;
1566 - EditMessSufixLossSingular.Text := '';  
1567 EditMessPrefixEarn.Visible:= not LVisible; 1879 EditMessPrefixEarn.Visible:= not LVisible;
1568 - EditMessPrefixEarn.Text := '';  
1569 EditMessSufixEarnPlural.Visible:= not LVisible; 1880 EditMessSufixEarnPlural.Visible:= not LVisible;
1570 - EditMessSufixEarnPlural.Text := '';  
1571 EditMessSufixEarnSingular.Visible:= not LVisible; 1881 EditMessSufixEarnSingular.Visible:= not LVisible;
1572 - EditMessSufixEarnSingular.Text := '';  
1573 EditMessSufixZero.Visible:= not LVisible; 1882 EditMessSufixZero.Visible:= not LVisible;
1574 - EditMessSufixZero.Text := ''; 1883 + EditMessDone(EditMessPrefix);
  1884 + EditMessDone(EditMessPrefixLoss);
  1885 + EditMessDone(EditMessSufixLossSingular);
  1886 + EditMessDone(EditMessSufixLossPlural);
  1887 + EditMessDone(EditMessPrefixEarn);
  1888 + EditMessDone(EditMessSufixEarnSingular);
  1889 + EditMessDone(EditMessSufixEarnPlural);
  1890 + EditMessDone(EditMessSufixZero);
  1891 +end;
  1892 +
  1893 +procedure TFormDesigner.ChkMatrixTypeClick(Sender: TObject);
  1894 +begin
  1895 + if Sender is TCheckBox then
  1896 + FExperiment.WriteString(SEC_EXPERIMENT, KEY_MATRIX_TYPE, GetMatrixTypeStringFromCGMatrix);
1575 end; 1897 end;
1576 1898
1577 1899
units/game_actors.pas
@@ -107,7 +107,7 @@ type @@ -107,7 +107,7 @@ type
107 procedure StopTimer(Sender:TObject;var ACloseAction:TCloseAction); 107 procedure StopTimer(Sender:TObject;var ACloseAction:TCloseAction);
108 procedure SelfDestroy(Sender:TOBject);virtual; 108 procedure SelfDestroy(Sender:TOBject);virtual;
109 public 109 public
110 - constructor Create(AOwner:TComponent; AP:TGamePoint; AStyle:TConsequenceStyle; ANicname, 110 + constructor Create(AOwner:TComponent; ACsqString, ANicname,
111 APrependLoss,AAppendiceLossSingular,AAppendiceLossPlural, 111 APrependLoss,AAppendiceLossSingular,AAppendiceLossPlural,
112 APrependEarn,AAppendiceEarnSingular,AAppendiceEarnPlural,AAppendiceZero:string);overload; 112 APrependEarn,AAppendiceEarnSingular,AAppendiceEarnPlural,AAppendiceZero:string);overload;
113 constructor Create(AOwner:TComponent; AP:integer; AStyle: TConsequenceStyle; AMessage:array of string);overload; 113 constructor Create(AOwner:TComponent; AP:integer; AStyle: TConsequenceStyle; AMessage:array of string);overload;
@@ -533,7 +533,7 @@ var @@ -533,7 +533,7 @@ var
533 533
534 LConsequence := S + '+' + 534 LConsequence := S + '+' +
535 IntToStr(Pts) +'|'+ 535 IntToStr(Pts) +'|'+
536 - GetConsequenceStylesString(LCsqStyle) +'|'+ 536 + GetConsequenceStyleString(LCsqStyle) +'|'+
537 ExtractDelimited(3,LConsequence, ['|']) +'|'+ 537 ExtractDelimited(3,LConsequence, ['|']) +'|'+
538 LPrependLoss +'|'+ 538 LPrependLoss +'|'+
539 LAppendiceLossSingular +'|'+ 539 LAppendiceLossSingular +'|'+
@@ -554,7 +554,7 @@ begin @@ -554,7 +554,7 @@ begin
554 begin 554 begin
555 LID := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Names[j]; 555 LID := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Names[j];
556 LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID]; 556 LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID];
557 - LCsqStyle := GetConsequenceStylesFromString(ExtractDelimited(2,LConsequence, ['|'])); 557 + LCsqStyle := GetConsequenceStyleFromString(ExtractDelimited(2,LConsequence, ['|']));
558 558
559 // BasA must revert message variables 559 // BasA must revert message variables
560 LPrependLoss := ExtractDelimited(4,LConsequence, ['|']); 560 LPrependLoss := ExtractDelimited(4,LConsequence, ['|']);
@@ -582,12 +582,15 @@ end; @@ -582,12 +582,15 @@ end;
582 582
583 { TConsequence } 583 { TConsequence }
584 584
585 -constructor TConsequence.Create(AOwner: TComponent; AP: TGamePoint;AStyle: TConsequenceStyle; ANicname,  
586 - APrependLoss, AAppendiceLossSingular, AAppendiceLossPlural,  
587 - APrependEarn, AAppendiceEarnSingular, AAppendiceEarnPlural, AAppendiceZero: string); 585 +constructor TConsequence.Create(AOwner: TComponent; ACsqString, ANicname,
  586 + APrependLoss, AAppendiceLossSingular, AAppendiceLossPlural, APrependEarn,
  587 + AAppendiceEarnSingular, AAppendiceEarnPlural, AAppendiceZero: string);
  588 +var
  589 + LP : string;
588 begin 590 begin
589 inherited Create(AOwner); 591 inherited Create(AOwner);
590 - FStyle:=AStyle; 592 +
  593 + // custom message
591 FNicname:=ANicname; 594 FNicname:=ANicname;
592 FPrependLoss:=APrependLoss; 595 FPrependLoss:=APrependLoss;
593 FAppendiceLossSingular:=AAppendiceLossSingular; 596 FAppendiceLossSingular:=AAppendiceLossSingular;
@@ -597,7 +600,15 @@ begin @@ -597,7 +600,15 @@ begin
597 FAppendiceEarnPlural:=AAppendiceEarnPlural; 600 FAppendiceEarnPlural:=AAppendiceEarnPlural;
598 FAppendiceZero:=AAppendiceZero; 601 FAppendiceZero:=AAppendiceZero;
599 602
600 - FP := AP; 603 + // extract game point string
  604 + LP := ExtractDelimited(1,ACsqString,['|']);
  605 +
  606 + // [value,variation]
  607 + FP := TGamePoint.Create(AOwner,[StrToInt(ExtractDelimited(1,LP,[','])),StrToInt(ExtractDelimited(2,LP,[',']))]);
  608 +
  609 + // consequesen style string
  610 + FStyle := GetConsequenceStyleFromString(ExtractDelimited(2,ACsqString,['|']));
  611 +
601 FMessage := TPopupNotifier.Create(AOwner); 612 FMessage := TPopupNotifier.Create(AOwner);
602 FConsequenceByPlayerID := TStringList.Create; 613 FConsequenceByPlayerID := TStringList.Create;
603 end; 614 end;
@@ -625,7 +636,7 @@ constructor TConsequence.Create(AOwner: TComponent; @@ -625,7 +636,7 @@ constructor TConsequence.Create(AOwner: TComponent;
625 begin 636 begin
626 inherited Create(AOwner); 637 inherited Create(AOwner);
627 FP := TGamePoint.Create(AOwner,ExtractDelimited(1,AConsequenceString,['|'])); 638 FP := TGamePoint.Create(AOwner,ExtractDelimited(1,AConsequenceString,['|']));
628 - FStyle:=GetConsequenceStylesFromString(ExtractDelimited(2,AConsequenceString,['|'])); 639 + FStyle:=GetConsequenceStyleFromString(ExtractDelimited(2,AConsequenceString,['|']));
629 FNicname:=ExtractDelimited(3,AConsequenceString,['|']); 640 FNicname:=ExtractDelimited(3,AConsequenceString,['|']);
630 FPrependLoss:=ExtractDelimited(4,AConsequenceString,['|']); 641 FPrependLoss:=ExtractDelimited(4,AConsequenceString,['|']);
631 FAppendiceLossSingular:=ExtractDelimited(5,AConsequenceString,['|']); 642 FAppendiceLossSingular:=ExtractDelimited(5,AConsequenceString,['|']);
@@ -652,7 +663,7 @@ end; @@ -652,7 +663,7 @@ end;
652 function TConsequence.AsString(AID: string): string; 663 function TConsequence.AsString(AID: string): string;
653 begin 664 begin
654 Result := IntToStr(FP.ValueWithVariation) + '|'; 665 Result := IntToStr(FP.ValueWithVariation) + '|';
655 - Result += GetConsequenceStylesString(FStyle)+'|'; 666 + Result += GetConsequenceStyleString(FStyle)+'|';
656 Result += FNicname +'|'; 667 Result += FNicname +'|';
657 Result += FPrependLoss + '|'; 668 Result += FPrependLoss + '|';
658 Result += FAppendiceLossSingular + '|'; 669 Result += FAppendiceLossSingular + '|';
units/game_file_methods.pas
@@ -202,8 +202,21 @@ var @@ -202,8 +202,21 @@ var
202 with LIniFile do 202 with LIniFile do
203 while ValueExists(LS, LCK+KEY_CONSEQUE) and ValueExists(LS, LCK+KEY_CRITERIA)do 203 while ValueExists(LS, LCK+KEY_CONSEQUE) and ValueExists(LS, LCK+KEY_CRITERIA)do
204 begin 204 begin
205 - LConsequence := TConsequence.Create(AExperiment,ReadString(LS,LCK+KEY_CONSEQUE,DEF_CONSEQUENCE));  
206 - LCriteria := GetCriteriaFromString(ReadString(LS,LCK+KEY_CRITERIA,DEF_CRITERIA)); 205 + AExperiment.Condition[ACondition].Contingencies[i].ContingencyName := ReadString(LS, LCK+KEY_CONT_NAME, '');
  206 + ReadString(LS, LCK+KEY_CONSEQUE, '');
  207 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND,'');
  208 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,'');
  209 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,'');
  210 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,'');
  211 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND_EARN,'');
  212 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,'');
  213 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,'');
  214 + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_ZERO, '');
  215 +
  216 +
  217 + LConsequence := TConsequence.Create(AExperiment,
  218 + ReadString(LS,LCK+KEY_CONSEQUE,DEF_CONSEQUENCE));
  219 + LCriteria := GetCriteriaFromString(ReadString(LS, LCK+KEY_CRITERIA, ''));
207 AExperiment.Condition[ACondition].Contingencies[i] := TContingency.Create(AExperiment,LConsequence,LCriteria,IsMeta); 220 AExperiment.Condition[ACondition].Contingencies[i] := TContingency.Create(AExperiment,LConsequence,LCriteria,IsMeta);
208 i := AExperiment.AppendContingency(ACondition); 221 i := AExperiment.AppendContingency(ACondition);
209 SetLCK(i); 222 SetLCK(i);
@@ -277,11 +290,13 @@ var @@ -277,11 +290,13 @@ var
277 Choice := GetChoiceFromString(ReadString(LS,KEY_PLAYER_CHOICE_LAST,'0,NONE,')); 290 Choice := GetChoiceFromString(ReadString(LS,KEY_PLAYER_CHOICE_LAST,'0,NONE,'));
278 ID := ReadString(LS,KEY_PLAYER_ID,'ID'); 291 ID := ReadString(LS,KEY_PLAYER_ID,'ID');
279 Nicname := ReadString(LS,KEY_PLAYER_NICNAME,GenResourceName(i)); 292 Nicname := ReadString(LS,KEY_PLAYER_NICNAME,GenResourceName(i));
280 - Login := ReadString(LS,KEY_PLAYER_LOGIN,'jogador'+IntToStr(i+1));  
281 - Password := ReadString(LS,KEY_PLAYER_PASSWORD,'1234');  
282 - Points := GetPPointsFromString(ReadString(LS,KEY_PLAYER_POINTS,'0,0,'));  
283 - Status := GetStatusFromString(ReadString(LS,KEY_PLAYER_STATUS,'esperando'));  
284 - Data.Values[KEY_PLAYER_TEMP] := ReadString(LS,KEY_PLAYER_TEMP,''); 293 +
  294 + // currently not in use
  295 + //Login := ReadString(LS,KEY_PLAYER_LOGIN,'jogador'+IntToStr(i+1));
  296 + //Password := ReadString(LS,KEY_PLAYER_PASSWORD,'1234');
  297 + //Points := GetPPointsFromString(ReadString(LS,KEY_PLAYER_POINTS,'0,0,'));
  298 + //Status := GetStatusFromString(ReadString(LS,KEY_PLAYER_STATUS,'esperando'));
  299 + //Data.Values[KEY_PLAYER_TEMP] := ReadString(LS,KEY_PLAYER_TEMP,'');
285 end; 300 end;
286 AExperiment.Player[i] := P; 301 AExperiment.Player[i] := P;
287 i := AExperiment.AppendPlayer; 302 i := AExperiment.AppendPlayer;
units/game_resources.pas
@@ -52,7 +52,10 @@ resourcestring @@ -52,7 +52,10 @@ resourcestring
52 KEY_TURN_RANDOM = 'Rodada.OrdemDeJogadaAleatória'; // Sim 52 KEY_TURN_RANDOM = 'Rodada.OrdemDeJogadaAleatória'; // Sim
53 53
54 KEY_POINTS_COUNT = 'Pontos.AoRecomeço'; 54 KEY_POINTS_COUNT = 'Pontos.AoRecomeço';
55 - KEY_POINTS_ONSTART = 'Pontos.SomarAoComeço'; 55 + KEY_POINTS_ONSTART_A = 'Pontos.Somar_ao_iniciar_condição.A';
  56 + KEY_POINTS_ONSTART_B = 'Pontos.Somar_ao_iniciar_condição.B';
  57 + KEY_POINTS_ONSTART_I = 'Pontos.Somar_ao_iniciar_condição.I';
  58 + KEY_POINTS_ONSTART_G = 'Pontos.Somar_ao_iniciar_condição.G';
56 59
57 KEY_CYCLES_VALUE = 'Ciclos.MudançaDeGeração'; 60 KEY_CYCLES_VALUE = 'Ciclos.MudançaDeGeração';
58 KEY_CYCLES_COUNT = 'Ciclos.AoRecomeço'; 61 KEY_CYCLES_COUNT = 'Ciclos.AoRecomeço';
units/string_methods.pas
@@ -33,10 +33,10 @@ function GetPromptStyleFromString(S : string) : TPromptStyle; @@ -33,10 +33,10 @@ function GetPromptStyleFromString(S : string) : TPromptStyle;
33 function GetPromptStyleString(AStyle : TPromptStyle) : string; 33 function GetPromptStyleString(AStyle : TPromptStyle) : string;
34 function GetGamePromptStyleFromString(S : string) : TGamePromptStyle; 34 function GetGamePromptStyleFromString(S : string) : TGamePromptStyle;
35 35
36 -function GetConsequenceStyleFromString(s : string):TGameConsequenceStyle;  
37 -function GetConsequenceStyleString(AStyle : TGameConsequenceStyle): string;  
38 -function GetConsequenceStylesFromString(S : string):TConsequenceStyle;  
39 -function GetConsequenceStylesString(CS : TConsequenceStyle): string; 36 +function GetGConsequenceStyleFromString(s : string):TGameConsequenceStyle;
  37 +function GetGConsequenceStyleString(AStyle : TGameConsequenceStyle): string;
  38 +function GetConsequenceStyleFromString(S : string):TConsequenceStyle;
  39 +function GetConsequenceStyleString(CS : TConsequenceStyle): string;
40 40
41 function GetCriteriaString(ACriteria : TCriteria) : string; 41 function GetCriteriaString(ACriteria : TCriteria) : string;
42 function GetCriteriaFromString(S : string) : TCriteria; 42 function GetCriteriaFromString(S : string) : TCriteria;
@@ -236,7 +236,7 @@ begin @@ -236,7 +236,7 @@ begin
236 end; 236 end;
237 end; 237 end;
238 238
239 -function GetConsequenceStyleFromString(s: string): TGameConsequenceStyle; 239 +function GetGConsequenceStyleFromString(s: string): TGameConsequenceStyle;
240 begin 240 begin
241 case UpperCase(S) of 241 case UpperCase(S) of
242 'NADA': Result:= gscNone; 242 'NADA': Result:= gscNone;
@@ -251,7 +251,7 @@ begin @@ -251,7 +251,7 @@ begin
251 end; 251 end;
252 end; 252 end;
253 253
254 -function GetConsequenceStyleString(AStyle: TGameConsequenceStyle): string; 254 +function GetGConsequenceStyleString(AStyle: TGameConsequenceStyle): string;
255 begin 255 begin
256 Result := ''; 256 Result := '';
257 case AStyle of 257 case AStyle of
@@ -343,7 +343,7 @@ begin @@ -343,7 +343,7 @@ begin
343 end; 343 end;
344 end; 344 end;
345 345
346 -function GetConsequenceStylesFromString(S:string):TConsequenceStyle; 346 +function GetConsequenceStyleFromString(S:string):TConsequenceStyle;
347 var 347 var
348 LCount, 348 LCount,
349 i : integer; 349 i : integer;
@@ -363,7 +363,7 @@ begin @@ -363,7 +363,7 @@ begin
363 end; 363 end;
364 end; 364 end;
365 365
366 -function GetConsequenceStylesString(CS: TConsequenceStyle): string; 366 +function GetConsequenceStyleString(CS: TConsequenceStyle): string;
367 var ConsequenceStyle : TGameConsequenceStyle; 367 var ConsequenceStyle : TGameConsequenceStyle;
368 begin 368 begin
369 Result := ''; 369 Result := '';