diff --git a/experiment_designer/form_main.lfm b/experiment_designer/form_main.lfm index 310c633..edd9590 100644 --- a/experiment_designer/form_main.lfm +++ b/experiment_designer/form_main.lfm @@ -1,9 +1,9 @@ object FormDesigner: TFormDesigner - Left = 127 + Left = 0 Height = 712 Top = 29 Width = 674 - HorzScrollBar.Page = 387 + HorzScrollBar.Page = 346 VertScrollBar.Page = 693 AutoScroll = True Caption = 'Planejar Experimento' @@ -13,17 +13,17 @@ object FormDesigner: TFormDesigner OnActivate = FormActivate OnCreate = FormCreate OnDestroy = FormDestroy - 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' + 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' ShowHint = True LCLVersion = '1.6.2.0' object PageControl: TPageControl Left = 0 - Height = 825 + Height = 744 Top = 0 Width = 664 - ActivePage = TabSheetContingencies + ActivePage = TabSheetExperiment Align = alClient - TabIndex = 2 + TabIndex = 0 TabOrder = 0 object TabSheetExperiment: TTabSheet Caption = 'Experimento' @@ -32,13 +32,34 @@ object FormDesigner: TFormDesigner ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 792 + ClientHeight = 711 ClientWidth = 658 + object GBConditions: TGroupBox + Left = 0 + Height = 97 + Top = 10 + Width = 658 + Caption = 'Condições' + ClientHeight = 80 + ClientWidth = 654 + TabOrder = 5 + object ListBoxConditions: TListBox + Left = 0 + Height = 80 + Top = 0 + Width = 654 + Anchors = [akTop, akLeft, akRight] + ItemHeight = 0 + ScrollWidth = 652 + TabOrder = 0 + TopIndex = -1 + end + end object LabelResearcherName: TLabel Left = 0 Height = 15 - Top = 10 - Width = 640 + Top = 112 + Width = 658 Caption = 'Nome do Pesquisador' ParentColor = False end @@ -46,15 +67,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Hint = 'Uma pasta será criada com o seu nome. Os seus experimentos serão salvos dentro dela.' - Top = 30 - Width = 640 + Top = 132 + Width = 658 + OnEditingDone = EditExperimentEditingDone TabOrder = 0 end object LabelExperimentName: TLabel Left = 0 Height = 15 - Top = 60 - Width = 640 + Top = 162 + Width = 658 Caption = 'Nome do Experimento' ParentColor = False end @@ -62,26 +84,28 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Hint = 'Uma pasta será criada com o nome do experimento. Os dados desse experimento serão salvos dentro dela.' - Top = 80 - Width = 640 + Top = 182 + Width = 658 + OnEditingDone = EditExperimentEditingDone TabOrder = 1 end object GBExperimentAim: TGroupBox Left = 0 Height = 159 - Top = 110 - Width = 640 + Top = 212 + Width = 658 Caption = 'Objetivo do Experimento' ClientHeight = 142 - ClientWidth = 636 + ClientWidth = 654 TabOrder = 2 object MemoExperimentAim: TMemo Left = 0 Height = 142 Top = 0 - Width = 636 + Width = 654 Align = alCustom Anchors = [akTop, akLeft, akRight] + OnEditingDone = EditExperimentEditingDone TabOrder = 0 end end @@ -89,8 +113,8 @@ object FormDesigner: TFormDesigner Left = 0 Height = 113 Hint = 'Aplicáveis ao longo de todo o experimento' - Top = 274 - Width = 640 + Top = 376 + Width = 658 AutoFill = True Caption = 'Configurações globais' ChildSizing.LeftRightSpacing = 6 @@ -102,13 +126,14 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 96 - ClientWidth = 636 + ClientWidth = 654 Items.Strings = ( 'Enviar histórico do bate-papo a novos participantes' 'Gerar participantes automaticamente' 'Habilitar matrix para o pesquisador jogar' 'Habilitar bate-papo para o pesquisador' ) + OnItemClick = CGGlobalItemClick TabOrder = 3 Data = { 0400000002030202 @@ -117,10 +142,10 @@ object FormDesigner: TFormDesigner object RGPoints: TRadioGroup Left = 0 Height = 59 - Top = 392 - Width = 640 + Top = 494 + Width = 658 AutoFill = True - Caption = 'Tipo de pontuação' + Caption = 'Tipo de pontuação Individual' ChildSizing.LeftRightSpacing = 6 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.EnlargeVertical = crsHomogenousChildResize @@ -129,7 +154,7 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 42 - ClientWidth = 636 + ClientWidth = 654 ItemIndex = 0 Items.Strings = ( 'A e B' @@ -141,14 +166,14 @@ object FormDesigner: TFormDesigner object GBMatrix: TGroupBox Left = 0 Height = 143 - Top = 456 - Width = 640 + Top = 558 + Width = 658 Caption = 'Tipo da Matrix' ChildSizing.LeftRightSpacing = 5 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 126 - ClientWidth = 636 + ClientWidth = 654 TabOrder = 6 object ChkColors: TCheckBox Left = 5 @@ -158,6 +183,7 @@ object FormDesigner: TFormDesigner Caption = '5 cores' Checked = True Enabled = False + OnClick = ChkMatrixTypeClick State = cbChecked TabOrder = 0 end @@ -169,6 +195,7 @@ object FormDesigner: TFormDesigner Caption = '10 linhas' Checked = True Enabled = False + OnClick = ChkMatrixTypeClick State = cbChecked TabOrder = 1 end @@ -178,6 +205,7 @@ object FormDesigner: TFormDesigner Top = 42 Width = 239 Caption = '10 colunas' + OnClick = ChkMatrixTypeClick TabOrder = 2 end object ChkDots: TCheckBox @@ -187,6 +215,7 @@ object FormDesigner: TFormDesigner Width = 239 Caption = 'Com Círculos Preechidos' OnChange = ChkDotsChange + OnClick = ChkMatrixTypeClick TabOrder = 3 end object ChkCleanDots: TCheckBox @@ -196,6 +225,7 @@ object FormDesigner: TFormDesigner Width = 239 Caption = 'Com Círculos Vazados' OnChange = ChkCleanDotsChange + OnClick = ChkMatrixTypeClick TabOrder = 4 end object ChkDotsCleanDots: TCheckBox @@ -205,30 +235,10 @@ object FormDesigner: TFormDesigner Width = 239 Caption = 'Com Círculos Vazados e Preenchidos' OnChange = ChkDotsCleanDotsChange + OnClick = ChkMatrixTypeClick TabOrder = 5 end end - object GBConditions: TGroupBox - Left = 0 - Height = 97 - Top = 604 - Width = 640 - Caption = 'Condições' - ClientHeight = 80 - ClientWidth = 636 - TabOrder = 5 - object ListBoxConditions: TListBox - Left = 0 - Height = 80 - Top = 0 - Width = 636 - Anchors = [akTop, akLeft, akRight] - ItemHeight = 0 - ScrollWidth = 634 - TabOrder = 0 - TopIndex = -1 - end - end end object TabSheetConditions: TTabSheet Caption = 'Condições' @@ -237,13 +247,13 @@ object FormDesigner: TFormDesigner ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 792 + ClientHeight = 711 ClientWidth = 658 object ComboCurrentCondition: TComboBox Left = 0 - Height = 23 + Height = 27 Top = 10 - Width = 640 + Width = 658 ItemHeight = 0 OnChange = ComboCurrentConditionChange Style = csDropDownList @@ -253,108 +263,199 @@ object FormDesigner: TFormDesigner Left = 0 Height = 26 Top = 42 - Width = 640 + Width = 658 ChildSizing.LeftRightSpacing = 25 ChildSizing.HorizontalSpacing = 50 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 ClientHeight = 26 - ClientWidth = 640 + ClientWidth = 658 TabOrder = 1 object BtnAppendCond: TButton Left = 25 Height = 25 + Hint = 'Selecione contingências na lista abaixo se deseja inclui-las na condição a ser adicionada.' Top = 0 - Width = 162 + Width = 168 Caption = 'Adicionar' OnClick = BtnAppendCondClick TabOrder = 0 end object BtnRemoveCond: TButton - Left = 237 + Left = 243 Height = 25 Top = 0 - Width = 159 + Width = 165 Caption = 'Remover' OnClick = BtnRemoveCondClick TabOrder = 1 end object BtnReorderCond: TButton - Left = 446 + Left = 458 Height = 25 Top = 0 - Width = 169 + Width = 175 Caption = 'Reordenar' OnClick = BtnReorderCondClick TabOrder = 2 + Visible = False + end + end + object GBContingencies: TGroupBox + Left = 0 + Height = 97 + Top = 73 + Width = 658 + Caption = 'Contingências e Metacontingências da Condição Selecionada' + ClientHeight = 80 + ClientWidth = 654 + TabOrder = 8 + object ListBoxContingencies: TListBox + Left = 0 + Height = 80 + Hint = 'CTRL+Clique para selecionar múltiplas contingências.' + Top = 0 + Width = 654 + Anchors = [akTop, akLeft, akRight] + ItemHeight = 0 + MultiSelect = True + ScrollWidth = 652 + TabOrder = 0 + TopIndex = -1 end end object LabelConditionName: TLabel Left = 0 Height = 15 Hint = 'Nome da condição no relatório.' - Top = 73 - Width = 640 + Top = 175 + Width = 658 Caption = 'Nome da Condição' ParentColor = False end object EditConditionName: TEdit Left = 0 Height = 25 - Top = 93 - Width = 640 + Top = 195 + Width = 658 OnEditingDone = EditConditionNameEditingDone TabOrder = 2 end object LabelTurnValue: TLabel Left = 0 Height = 15 - Top = 123 - Width = 640 + Top = 225 + Width = 658 Caption = 'Número de Jogadores / Turnos' ParentColor = False end object SpinEditTurnValue: TSpinEdit Left = 0 Height = 25 - Top = 143 - Width = 640 + Top = 245 + Width = 658 MaxValue = 5 MinValue = 2 OnEditingDone = SpinEditTurnValueEditingDone TabOrder = 3 Value = 2 end - object LabelPointsOnConditionBegin: TLabel + object GroupBox1: TGroupBox Left = 0 - Height = 15 - Top = 173 - Width = 640 - Caption = 'Pontos ao início da Condição' - ParentColor = False - end - object SpinEditOnConditionBegin: TSpinEdit - Left = 0 - Height = 25 - Top = 193 - Width = 640 - MaxValue = 0 + Height = 57 + Top = 275 + Width = 658 + Caption = 'Somar pontos ao iniciar condição' + ChildSizing.LeftRightSpacing = 50 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.Layout = cclTopToBottomThenLeftToRight + ChildSizing.ControlsPerLine = 2 + ClientHeight = 40 + ClientWidth = 654 TabOrder = 9 + object LabelPA: TLabel + Left = 50 + Height = 15 + Top = 0 + Width = 137 + Caption = 'A' + ParentColor = False + end + object SpinEditOnConditionBeginA: TSpinEdit + Left = 50 + Height = 25 + Top = 15 + Width = 137 + MaxValue = 0 + OnEditingDone = SpinEditOnConditionBeginAEditingDone + TabOrder = 0 + end + object LabelPB: TLabel + Left = 187 + Height = 15 + Top = 0 + Width = 137 + Caption = 'B' + ParentColor = False + end + object SpinEditOnConditionBeginB: TSpinEdit + Left = 187 + Height = 25 + Top = 15 + Width = 137 + MaxValue = 0 + OnEditingDone = SpinEditOnConditionBeginAEditingDone + TabOrder = 1 + end + object LabelPI: TLabel + Left = 324 + Height = 15 + Top = 0 + Width = 145 + Caption = 'Individual' + ParentColor = False + end + object SpinEditOnConditionBeginI: TSpinEdit + Left = 324 + Height = 25 + Top = 15 + Width = 145 + MaxValue = 0 + OnEditingDone = SpinEditOnConditionBeginAEditingDone + TabOrder = 2 + end + object LabelPG: TLabel + Left = 469 + Height = 15 + Top = 0 + Width = 135 + Caption = 'Grupo' + ParentColor = False + end + object SpinEditOnConditionBeginG: TSpinEdit + Left = 469 + Height = 25 + Top = 15 + Width = 135 + MaxValue = 0 + OnEditingDone = SpinEditOnConditionBeginAEditingDone + TabOrder = 3 + end end object LabelCyclesValue: TLabel Left = 0 Height = 15 - Top = 223 - Width = 640 + Top = 337 + Width = 658 Caption = 'Ciclos para mudança de geração / linhagem' ParentColor = False end object SpinEditCyclesValue: TSpinEdit Left = 0 Height = 25 - Top = 243 - Width = 640 + Top = 357 + Width = 658 MaxValue = 1000 MinValue = 1 OnEditingDone = SpinEditCyclesValueEditingDone @@ -364,8 +465,8 @@ object FormDesigner: TFormDesigner object GBQuestion: TGroupBox Left = 0 Height = 164 - Top = 273 - Width = 640 + Top = 387 + Width = 658 Caption = 'Apresentar pergunta ao final do ciclo' ChildSizing.LeftRightSpacing = 50 ChildSizing.VerticalSpacing = 5 @@ -373,13 +474,13 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 147 - ClientWidth = 636 + ClientWidth = 654 TabOrder = 5 object CheckBoxShouldAskQuestion: TCheckBox Left = 50 Height = 21 Top = 0 - Width = 536 + Width = 554 Caption = 'Não' OnChange = CheckBoxShouldAskQuestionChange TabOrder = 0 @@ -388,7 +489,7 @@ object FormDesigner: TFormDesigner Left = 50 Height = 15 Top = 26 - Width = 536 + Width = 554 Caption = 'Texto da Pergunta' ParentColor = False end @@ -396,7 +497,7 @@ object FormDesigner: TFormDesigner Left = 50 Height = 25 Top = 46 - Width = 536 + Width = 554 OnEditingDone = EditQuestionEditingDone TabOrder = 1 Text = 'Um item escolar foi perdido, desejam recuperá-lo gastando pontos do Tipo A?' @@ -406,7 +507,7 @@ object FormDesigner: TFormDesigner Left = 50 Height = 71 Top = 76 - Width = 536 + Width = 554 AutoFill = True Caption = 'O que deve acontecer quando todos responderem sim?' ChildSizing.LeftRightSpacing = 6 @@ -418,7 +519,7 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 54 - ClientWidth = 532 + ClientWidth = 550 Items.Strings = ( 'Reverter consequências das metacontingências e contingências' 'Inverter pontos A e B quando pontos B forem consequências' @@ -434,8 +535,8 @@ object FormDesigner: TFormDesigner object RGEndCriteriaStyle: TRadioGroup Left = 0 Height = 80 - Top = 442 - Width = 640 + Top = 556 + Width = 658 AutoFill = True Caption = 'Estilo do critério de finalização da condição' ChildSizing.LeftRightSpacing = 6 @@ -446,7 +547,7 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 63 - ClientWidth = 636 + ClientWidth = 654 ItemIndex = 2 Items.Strings = ( 'Finalizar após um número de ciclos' @@ -459,8 +560,8 @@ object FormDesigner: TFormDesigner object GBEndCriteria: TGroupBox Left = 0 Height = 109 - Top = 527 - Width = 640 + Top = 641 + Width = 658 Caption = 'Valores do critério de finalização da condição' ChildSizing.LeftRightSpacing = 50 ChildSizing.VerticalSpacing = 5 @@ -468,13 +569,13 @@ object FormDesigner: TFormDesigner ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 92 - ClientWidth = 636 + ClientWidth = 654 TabOrder = 7 object LabelEndCriteriaAbsCycles: TLabel Left = 50 Height = 15 Top = 0 - Width = 536 + Width = 554 Caption = 'Número de ciclos' ParentColor = False end @@ -482,7 +583,7 @@ object FormDesigner: TFormDesigner Left = 50 Height = 25 Top = 20 - Width = 536 + Width = 554 MaxValue = 1000 OnEditingDone = SpinEditEndCriteriaAbsCyclesEditingDone TabOrder = 0 @@ -492,13 +593,13 @@ object FormDesigner: TFormDesigner Left = 50 Height = 42 Top = 50 - Width = 536 + Width = 554 Caption = 'Porcentagem de entrelaçamentos' ChildSizing.HorizontalSpacing = 5 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 4 ClientHeight = 25 - ClientWidth = 532 + ClientWidth = 550 TabOrder = 1 object SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit Left = 0 @@ -542,27 +643,6 @@ object FormDesigner: TFormDesigner end end end - object GBContingencies: TGroupBox - Left = 0 - Height = 97 - Top = 641 - Width = 640 - Caption = 'Contingências e Metacontingências' - ClientHeight = 80 - ClientWidth = 636 - TabOrder = 8 - object ListBoxContingencies: TListBox - Left = 0 - Height = 80 - Top = 0 - Width = 636 - Anchors = [akTop, akLeft, akRight] - ItemHeight = 0 - ScrollWidth = 634 - TabOrder = 0 - TopIndex = -1 - end - end end object TabSheetContingencies: TTabSheet Caption = 'Contingências' @@ -571,7 +651,7 @@ object FormDesigner: TFormDesigner ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 792 + ClientHeight = 711 ClientWidth = 658 Enabled = False object RGContingencyType: TRadioGroup @@ -646,6 +726,7 @@ object FormDesigner: TFormDesigner Caption = 'Reordenar' OnClick = BtnReorderContingencyClick TabOrder = 2 + Visible = False end end object LabelContingencyName: TLabel @@ -765,15 +846,15 @@ object FormDesigner: TFormDesigner Left = 0 Height = 15 Top = 0 - Width = 416 + Width = 420 Caption = 'Pontos' ParentColor = False end object LabelCsq2: TLabel - Left = 416 + Left = 420 Height = 15 Top = 0 - Width = 238 + Width = 234 Caption = 'do Tipo' ParentColor = False end @@ -781,17 +862,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 27 Top = 15 - Width = 416 + Width = 420 MaxValue = 0 OnEditingDone = ConsequenceStyleChange TabOrder = 0 - Value = 1 end object CBPointsType: TComboBox - Left = 416 + Left = 420 Height = 27 Top = 15 - Width = 238 + Width = 234 ItemHeight = 0 OnChange = ConsequenceStyleChange Style = csDropDownList @@ -801,13 +881,18 @@ object FormDesigner: TFormDesigner Left = 0 Height = 80 Top = 42 - Width = 416 + Width = 420 AutoFill = True Caption = 'Apresentar mensagem de notificação' + ChildSizing.LeftRightSpacing = 6 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 ClientHeight = 63 - ClientWidth = 412 + ClientWidth = 416 ItemIndex = 0 Items.Strings = ( 'a todos os participantes' @@ -818,11 +903,11 @@ object FormDesigner: TFormDesigner TabOrder = 9 end object CheckBoxImutableMessage: TCheckBox - Left = 416 + Left = 420 Height = 80 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.' Top = 42 - Width = 238 + Width = 234 AutoSize = False Caption = 'imutável' OnChange = CheckBoxImutableMessageChange @@ -832,15 +917,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 122 - Width = 416 + Width = 420 Caption = 'Texto no início da mensagem' ParentColor = False end object EditMessPrefix: TEdit - Left = 416 + Left = 420 Height = 25 Top = 122 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 2 Text = '$NICNAME' end @@ -848,15 +934,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 147 - Width = 416 + Width = 420 Caption = 'Prefixo ao perder pontos' ParentColor = False end object EditMessPrefixLoss: TEdit - Left = 416 + Left = 420 Height = 25 Top = 147 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 3 Text = 'perdeu' end @@ -864,15 +951,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 172 - Width = 416 + Width = 420 Caption = 'Sufixo ao perder pontos (Singular)' ParentColor = False end object EditMessSufixLossSingular: TEdit - Left = 416 + Left = 420 Height = 25 Top = 172 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 4 Text = 'ponto.' end @@ -880,15 +968,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 197 - Width = 416 + Width = 420 Caption = 'Sufixo ao perder pontos (Plural)' ParentColor = False end object EditMessSufixLossPlural: TEdit - Left = 416 + Left = 420 Height = 25 Top = 197 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 5 Text = 'pontos.' end @@ -896,15 +985,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 222 - Width = 416 + Width = 420 Caption = 'Prefixo ao ganhar pontos' ParentColor = False end object EditMessPrefixEarn: TEdit - Left = 416 + Left = 420 Height = 25 Top = 222 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 6 Text = 'ganhou' end @@ -912,15 +1002,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 247 - Width = 416 + Width = 420 Caption = 'Sufixo ao ganhar pontos (Singular)' ParentColor = False end object EditMessSufixEarnSingular: TEdit - Left = 416 + Left = 420 Height = 25 Top = 247 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 7 Text = 'ponto.' end @@ -928,15 +1019,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 272 - Width = 416 + Width = 420 Caption = 'Sufixo ao ganhar pontos (Plural)' ParentColor = False end object EditMessSufixEarnPlural: TEdit - Left = 416 + Left = 420 Height = 25 Top = 272 - Width = 238 + Width = 234 + OnEditingDone = EditMessDone TabOrder = 8 Text = 'pontos.' end @@ -944,16 +1036,16 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 297 - Width = 416 - Caption = 'Sufixo ao ganhar pontos (Plural)' + Width = 420 + Caption = 'Sufixo 0 pontos' ParentColor = False end object EditMessSufixZero: TEdit - Left = 416 + Left = 420 Height = 25 Top = 297 - Width = 238 - OnChange = EditMessSufixZeroChange + Width = 234 + OnEditingDone = EditMessDone TabOrder = 11 Text = 'não ganhou nem perdeu pontos.' end @@ -961,7 +1053,7 @@ object FormDesigner: TFormDesigner Left = 0 Height = 25 Top = 322 - Width = 416 + Width = 420 Caption = 'Ver como a mensagem pode ser apresentada' OnClick = ButtonPreviewMessageClick TabOrder = 12 @@ -978,6 +1070,10 @@ object FormDesigner: TFormDesigner Caption = 'Abrir' OnClick = MenuItemOpenClick end + object MenuItemSaveAs: TMenuItem + Caption = 'Salvar Como' + OnClick = MenuItemSaveAsClick + end object MenuItemSeparator1: TMenuItem Caption = '-' end @@ -988,21 +1084,31 @@ object FormDesigner: TFormDesigner end end object OpenDialog: TOpenDialog - left = 464 + Title = 'Abrir arquivo de configuração' + DefaultExt = '.ini' + Filter = 'ini|*.ini|txt|*.txt' + Options = [ofFileMustExist] + left = 376 top = 8 end object XMLPropStorage: TXMLPropStorage StoredValues = < item - Name = 'FileName' - Value = 'persistence.ini' + Name = 'Filename' OnSave = XMLPropStorageStoredValuesFileNameSave OnRestore = XMLPropStorageStoredValuesFileNameRestore end> - FileName = 'persistence.xml' OnSavingProperties = XMLPropStorageSavingProperties OnRestoreProperties = XMLPropStorageRestoreProperties left = 464 - top = 64 + top = 8 + end + object SaveDialog: TSaveDialog + Width = 862 + Height = 468 + DefaultExt = '.ini' + Filter = 'ini|*.ini|txt|*.txt' + left = 304 + top = 8 end end diff --git a/experiment_designer/form_main.pas b/experiment_designer/form_main.pas index e873a01..a63d069 100644 --- a/experiment_designer/form_main.pas +++ b/experiment_designer/form_main.pas @@ -11,6 +11,8 @@ unit form_main; {$mode objfpc}{$H+} +{$DEFINE DEBUG} + interface uses @@ -66,6 +68,11 @@ type GBContingencyRows: TGroupBox; GBContingencyConsequence: TGroupBox; GBMatrix: TGroupBox; + GroupBox1: TGroupBox; + LabelPA: TLabel; + LabelPB: TLabel; + LabelPI: TLabel; + LabelPG: TLabel; LabelCsq10: TLabel; LabelCsq3: TLabel; LabelCsq5: TLabel; @@ -75,7 +82,6 @@ type LabelCsq4: TLabel; LabelCsq7: TLabel; LabelQuestion: TLabel; - LabelPointsOnConditionBegin: TLabel; LabelCsq1: TLabel; LabelCsq2: TLabel; LabelThen: TLabel; @@ -94,6 +100,7 @@ type ListBoxContingencies: TListBox; MainMenu1: TMainMenu; MemoExperimentAim: TMemo; + MenuItemSaveAs: TMenuItem; MenuItemFile: TMenuItem; MenuItemExit: TMenuItem; MenuItemOpen: TMenuItem; @@ -107,12 +114,16 @@ type RGContingencyStyle: TRadioGroup; RGEndCriteriaStyle: TRadioGroup; RGPoints: TRadioGroup; + SaveDialog: TSaveDialog; SpinEditContingencyPoints: TSpinEdit; SpinEditEndCriteriaInterlockingPorcentage: TSpinEdit; SpinEditEndCriteriaLastCycles: TSpinEdit; SpinEditEndCriteriaAbsCycles: TSpinEdit; SpinEditCyclesValue: TSpinEdit; - SpinEditOnConditionBegin: TSpinEdit; + SpinEditOnConditionBeginA: TSpinEdit; + SpinEditOnConditionBeginB: TSpinEdit; + SpinEditOnConditionBeginI: TSpinEdit; + SpinEditOnConditionBeginG: TSpinEdit; SpinEditTurnValue: TSpinEdit; TabSheetContingencies: TTabSheet; TabSheetConditions: TTabSheet; @@ -125,7 +136,9 @@ type procedure BtnReorderCondClick(Sender: TObject); procedure BtnReorderContingencyClick(Sender: TObject); procedure ButtonPreviewMessageClick(Sender: TObject); + procedure CGGlobalItemClick(Sender: TObject; Index: integer); procedure CheckBoxImutableMessageChange(Sender: TObject); + procedure ChkMatrixTypeClick(Sender: TObject); procedure ChkDotsCleanDotsChange(Sender: TObject); // procedure ConsequenceMessageEditingDone(Sender: TObject); @@ -140,13 +153,15 @@ type procedure ComboCurrentContingencyChange(Sender: TObject); procedure EditConditionNameEditingDone(Sender: TObject); procedure EditContingencyNameEditingDone(Sender: TObject); - procedure EditMessSufixZeroChange(Sender: TObject); + procedure EditMessDone(Sender: TObject); procedure EditQuestionEditingDone(Sender: TObject); + procedure EditExperimentEditingDone(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure MenuItemExitClick(Sender: TObject); procedure MenuItemOpenClick(Sender: TObject); + procedure MenuItemSaveAsClick(Sender: TObject); procedure RGBroadcastMessageClick(Sender: TObject); procedure RGContingencyStyleClick(Sender: TObject); procedure RGContingencyStyleExit(Sender: TObject); @@ -158,6 +173,7 @@ type procedure SpinEditEndCriteriaAbsCyclesEditingDone(Sender: TObject); procedure SpinEditEndCriteriaInterlockingEditingDone( Sender: TObject); + procedure SpinEditOnConditionBeginAEditingDone(Sender: TObject); procedure SpinEditTurnValueEditingDone(Sender: TObject); procedure XMLPropStorageRestoreProperties(Sender: TObject); procedure XMLPropStorageSavingProperties(Sender: TObject); @@ -170,7 +186,7 @@ type procedure LoadExperiment; procedure LoadSectionExperiment; procedure LoadSectionCondition(ASection: string); - procedure LoadContingency(ASection, AContingency: string);// A condition section and a contingency key prefix + procedure LoadContingency(ASection, AContingency: string);// LabelPA condition section and LabelPA contingency key prefix procedure SaveExperiment; procedure SaveSectionExperiment; procedure SaveSectionCondition(ASection: string); @@ -192,9 +208,11 @@ type procedure UpdateContingencyCombo(ASection: String); private FLoading : Boolean; + FPersistentTXTFilename : string; function GetContingencyName(IsMeta:Boolean; MustIncrement:Boolean=True):string; procedure IncContingencyName(var AContingency : string; N : integer = 1); procedure ReadContingencyNames(ASection, AContingency, AKeySuffix:string; S:TStrings); + procedure ReadContingencyValuesInSection(LS, LC : string; Keys:TStrings); public { public declarations } end; @@ -206,6 +224,8 @@ implementation uses game_resources, game_actors, game_actors_point, string_methods, strutils; +const SV_FILENAME : string = 'Filename'; + {$R *.lfm} { TFormDesigner } @@ -213,13 +233,41 @@ uses game_resources, game_actors, game_actors_point, string_methods, strutils; procedure TFormDesigner.MenuItemOpenClick(Sender: TObject); begin if OpenDialog.Execute then - begin - if FExperiment.FileName = OpenDialog.FileName then - Exit; - FExperiment.Free; - FExperiment := TIniFile.Create(OpenDialog.FileName); - XMLPropStorage.StoredValue['FileName'] := FExperiment.FileName; - end; + begin + if FExperiment.FileName = OpenDialog.FileName then + Exit; + SaveExperiment; + FExperiment.Free; + FExperiment := TIniFile.Create(OpenDialog.FileName); + XMLPropStorage.StoredValue[SV_FILENAME] := FExperiment.FileName; + XMLPropStorage.FileName := ExtractFilePath(FExperiment.FileName)+'persistence.xml'; + LoadExperiment; + + OpenDialog.InitialDir:=ExtractFilePath(FExperiment.FileName); + SaveDialog.InitialDir:=ExtractFilePath(FExperiment.FileName); + end; +end; + +procedure TFormDesigner.MenuItemSaveAsClick(Sender: TObject); +var + LOldExperimentPath : string; +begin + if SaveDialog.Execute then + begin + if FExperiment.FileName = SaveDialog.FileName then + Exit; + LOldExperimentPath := FExperiment.FileName; + SaveExperiment; + FExperiment.Free; + CopyFile(LOldExperimentPath,SaveDialog.FileName); + FExperiment := TIniFile.Create(SaveDialog.FileName); + XMLPropStorage.StoredValue[SV_FILENAME] := FExperiment.FileName; + + XMLPropStorage.FileName := ExtractFilePath(FExperiment.FileName)+'persistence.xml'; + + OpenDialog.InitialDir:=ExtractFilePath(FExperiment.FileName); + SaveDialog.InitialDir:=ExtractFilePath(FExperiment.FileName); + end; end; procedure TFormDesigner.RGBroadcastMessageClick(Sender: TObject); @@ -427,6 +475,8 @@ begin end; procedure TFormDesigner.RGPointsClick(Sender: TObject); +var + LVisible : Boolean; begin if Sender = RGPoints then case TRadioGroup(Sender).ItemIndex of @@ -436,6 +486,13 @@ begin CBPointsType.Items.Append('Individual A'); CBPointsType.Items.Append('Individual B'); CBPointsType.Items.Append('Para o Grupo'); + LVisible := True; + SpinEditOnConditionBeginA.Visible:=LVisible; + SpinEditOnConditionBeginB.Visible:=LVisible; + SpinEditOnConditionBeginI.Visible:=not LVisible; + LabelPA.Visible:=LVisible; + LabelPB.Visible:=LVisible; + LabelPI.Visible:=not LVisible; end; 1: @@ -443,8 +500,22 @@ begin CBPointsType.Items.Clear; CBPointsType.Items.Append('Individual'); CBPointsType.Items.Append('Para o Grupo'); + LVisible := False; + SpinEditOnConditionBeginA.Visible:=LVisible; + SpinEditOnConditionBeginB.Visible:=LVisible; + SpinEditOnConditionBeginI.Visible:=not LVisible; + LabelPA.Visible:=LVisible; + LabelPB.Visible:=LVisible; + LabelPI.Visible:=not LVisible; end; end; + + if not FLoading then + with FExperiment do + case RGPoints.ItemIndex of + 0: WriteBool(SEC_EXPERIMENT, KEY_POINTS_TYPE, True); + 1: WriteBool(SEC_EXPERIMENT, KEY_POINTS_TYPE, False); + end; end; procedure TFormDesigner.SpinEditCyclesValueEditingDone(Sender: TObject); @@ -485,6 +556,30 @@ begin end; end; +procedure TFormDesigner.SpinEditOnConditionBeginAEditingDone(Sender: TObject); +var + LS: string; +begin + if Sender is TSpinEdit then + with FExperiment do + if ComboCurrentCondition.ItemIndex <> -1 then + begin + LS := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1); + + if TSpinEdit(Sender) = SpinEditOnConditionBeginA then + WriteInteger(LS, KEY_POINTS_ONSTART_A, SpinEditOnConditionBeginA.Value); + + if TSpinEdit(Sender) = SpinEditOnConditionBeginB then + WriteInteger(LS, KEY_POINTS_ONSTART_B, SpinEditOnConditionBeginB.Value); + + if TSpinEdit(Sender) = SpinEditOnConditionBeginI then + WriteInteger(LS, KEY_POINTS_ONSTART_I, SpinEditOnConditionBeginI.Value); + + if TSpinEdit(Sender) = SpinEditOnConditionBeginG then + WriteInteger(LS, KEY_POINTS_ONSTART_G, SpinEditOnConditionBeginG.Value); + end; +end; + procedure TFormDesigner.SpinEditTurnValueEditingDone(Sender: TObject); var LS: string; @@ -498,17 +593,31 @@ begin end; procedure TFormDesigner.XMLPropStorageRestoreProperties(Sender: TObject); + begin LoadExperiment; ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; - ListBoxContingencies.Items.Text := ComboCurrentContingency.Items.Text; - RGPointsClick(RGPoints); - RGEndCriteriaStyleClick(RGEndCriteriaStyle); + UpdateContingencyList(ExtractDelimited(1,ComboCurrentCondition.Text,['|'])); + //RGPointsClick(RGPoints); + //RGEndCriteriaStyleClick(RGEndCriteriaStyle); TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; end; procedure TFormDesigner.XMLPropStorageSavingProperties(Sender: TObject); + procedure SavePropStorageFilename; + var + S : TStringList; + begin + S := TStringList.Create; + try + S.Text := XMLPropStorage.FileName; + S.SaveToFile(FPersistentTXTFilename); + finally + S.Free; + end; + end; begin + SavePropStorageFilename; SaveExperiment; end; @@ -738,9 +847,9 @@ begin SpinEditContingencyPoints.Value := LPoints; SCode := ExtractDelimited(2,S,['|']); - CS := GetConsequenceStylesFromString(SCode); + CS := GetConsequenceStyleFromString(SCode); case RGPoints.ItemIndex of - 0: { A & B } + 0: { LabelPA & B } begin if gscA in CS then CBPointsType.ItemIndex := 0; if gscB in CS then CBPointsType.ItemIndex := 1; @@ -768,8 +877,6 @@ begin RGBroadcastMessage.ItemIndex := 1 else RGBroadcastMessage.ItemIndex := 2; - - end; procedure TFormDesigner.UpdateContingencyList(ASection: String); @@ -831,6 +938,27 @@ begin end; end; +procedure TFormDesigner.ReadContingencyValuesInSection(LS, LC: string; + Keys: TStrings); +begin + with FExperiment do + begin + Keys.BeginUpdate; + Keys.Values[LC + KEY_CONT_NAME] := ReadString(LS,LC+KEY_CONT_NAME,''); + Keys.Values[LC + KEY_CRITERIA] := ReadString(LS, LC + KEY_CRITERIA,''); + Keys.Values[LC + KEY_CONSEQUE] := ReadString(LS, LC + KEY_CONSEQUE,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,''); + Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO,''); + Keys.EndUpdate; + end; +end; + procedure TFormDesigner.SaveSectionExperiment; begin with FExperiment do @@ -857,8 +985,7 @@ begin EditResearcherName.Text := ReadString(SEC_EXPERIMENT, KEY_RESEARCHER, ''); EditExperimentName.Text := ReadString(SEC_EXPERIMENT, KEY_NAME, ''); MemoExperimentAim.Text := ReadString(SEC_EXPERIMENT, KEY_AIM, ''); - CGGlobal.Checked[0] := - ReadBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, False); + CGGlobal.Checked[0] := ReadBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, False); CGGlobal.Checked[1] := ReadBool(SEC_EXPERIMENT, KEY_GEN_PLAYER_AS_NEEDED, False); CGGlobal.Checked[2] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANPLAY, False); CGGlobal.Checked[3] := ReadBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANCHAT, False); @@ -877,7 +1004,10 @@ begin begin WriteString(ASection, KEY_COND_NAME, EditConditionName.Text); WriteInteger(ASection, KEY_TURN_VALUE, SpinEditTurnValue.Value); - WriteInteger(ASection, KEY_POINTS_ONSTART,SpinEditOnConditionBegin.Value); + WriteInteger(ASection, KEY_POINTS_ONSTART_A,SpinEditOnConditionBeginA.Value); + WriteInteger(ASection, KEY_POINTS_ONSTART_B,SpinEditOnConditionBeginB.Value); + WriteInteger(ASection, KEY_POINTS_ONSTART_I,SpinEditOnConditionBeginI.Value); + WriteInteger(ASection, KEY_POINTS_ONSTART_G,SpinEditOnConditionBeginG.Value); WriteInteger(ASection, KEY_CYCLES_VALUE, SpinEditCyclesValue.Value); WriteString(ASection, KEY_PROMPT_MESSAGE, EditQuestion.Text); WriteString(ASection, KEY_PROMPT_STYLE, GetPromptQuestionStringFromCGQuestion); @@ -1007,7 +1137,7 @@ var begin CS := [gscMessage,gscPoints]; case RGPoints.ItemIndex of - 0: { A & B } + 0: { LabelPA & B } case CBPointsType.ItemIndex of 0 {'Individual A'} : CS += [gscA]; 1 {'Individual B'} : CS += [gscB]; @@ -1027,7 +1157,7 @@ begin end; Result := IntToStr(SpinEditContingencyPoints.Value)+',0|'; - Result += GetConsequenceStylesString(CS); + Result += GetConsequenceStyleString(CS); end; function TFormDesigner.GetContingencyCriteria: string; @@ -1112,7 +1242,6 @@ begin begin EditConditionName.Text := ReadString(ASection, KEY_COND_NAME, ASection); SpinEditTurnValue.Value := ReadInteger(ASection, KEY_TURN_VALUE, 2); - SpinEditOnConditionBegin.Value := ReadInteger(ASection, KEY_POINTS_ONSTART,0); SpinEditCyclesValue.Value := ReadInteger(ASection, KEY_CYCLES_VALUE, 2); CheckBoxShouldAskQuestion.Checked := False; @@ -1123,6 +1252,11 @@ begin if (EditQuestion.Text <> '') or (ReadString(ASection, KEY_PROMPT_STYLE, '') <> '') then CheckBoxShouldAskQuestion.Checked := True; end; + LabelQuestion.Visible:= CheckBoxShouldAskQuestion.Checked; + SpinEditOnConditionBeginA.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_A, 0); + SpinEditOnConditionBeginB.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_B, 0); + SpinEditOnConditionBeginI.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_I, 0); + SpinEditOnConditionBeginG.Value := ReadInteger(ASection, KEY_POINTS_ONSTART_G, 0); SetRGEndCriteriaStyle(ReadString(ASection, KEY_ENDCRITERIA, 'O QUE OCORRER PRIMEIRO')); SpinEditEndCriteriaAbsCycles.Value := ReadInteger(ASection, KEY_ENDCRITERIA_CYCLES, 20); @@ -1180,8 +1314,47 @@ begin end; procedure TFormDesigner.FormCreate(Sender: TObject); +var + LRootPath: RawByteString; + + function ReadLnFromFile(AFilename:string;ALine : integer):string; + var + S : TStringList; + begin + Result := ''; + if FileExists(AFilename) then + begin + S := TStringList.Create; + try + S.LoadFromFile(AFilename); + if S.Count > 0 then + Result := S[ALine]; + finally + S.Free; + end; + end + end; begin + // TRadioGroup OnClick events are triggered programmatically by LCL code, not by us + // FLoading is a temporary workaround to avoid + // calls for SaveProcedures while loading FExperiment FLoading := True; + + + LRootPath := ExtractFilePath(Application.ExeName); + + // FPersistentTXTFilename must not change during runtime. + FPersistentTXTFilename := LRootPath+'persistence.txt'; + + // XMLPropStorage.FileName may change during runtime + XMLPropStorage.FileName := ReadLnFromFile(FPersistentTXTFilename,0); + if XMLPropStorage.FileName = '' then + XMLPropStorage.FileName := LRootPath+'persistence.xml'; + + // XMLPropStorage.StoredValue[SV_FILENAME] may change during runtime + XMLPropStorage.StoredValue[SV_FILENAME] := LRootPath+'persistence.ini'; + OpenDialog.InitialDir:=LRootPath; + SaveDialog.InitialDir:=LRootPath; end; procedure TFormDesigner.FormDestroy(Sender: TObject); @@ -1202,11 +1375,12 @@ begin if ComboCurrentCondition.ItemIndex <> -1 then begin LS := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1); + EditQuestion.Text:=''; WriteString(LS, KEY_PROMPT_MESSAGE, ''); WriteString(LS, KEY_PROMPT_STYLE, ''); end; end; - + LabelQuestion.Visible:= CheckBoxShouldAskQuestion.Checked; EditQuestion.Visible := CheckBoxShouldAskQuestion.Checked; CGQuestion.Visible := CheckBoxShouldAskQuestion.Checked; end; @@ -1239,8 +1413,22 @@ begin end; procedure TFormDesigner.ComboCurrentConditionChange(Sender: TObject); +var + LS, LC: String; begin - LoadSectionCondition(SEC_CONDITION + IntToStr(ComboCurrentCondition.ItemIndex + 1)); + LS := SEC_CONDITION + IntToStr(ComboCurrentCondition.ItemIndex + 1); + LoadSectionCondition(LS); + UpdateContingencyList(LS); + if ListBoxContingencies.Items.Count > 0 then + begin + LC := ExtractDelimited(1,ListBoxContingencies.Items[0],['|']); + if Pos(KEY_METACONTINGENCY,LC) > 0 then + RGContingencyType.ItemIndex := 1 + else + RGContingencyType.ItemIndex := 0; + RGContingencyTypeClick(ComboCurrentCondition); + LoadContingency(LS,LC); + end; end; procedure TFormDesigner.ComboCurrentContingencyChange(Sender: TObject); @@ -1275,13 +1463,44 @@ begin WriteString(LS, LC+ KEY_CONT_NAME, EditContingencyName.Text); ComboCurrentContingency.Items[ComboCurrentContingency.ItemIndex] := LC + '|' + EditContingencyName.Text; - ListBoxContingencies.Items.Text := ComboCurrentContingency.Items.Text; + UpdateContingencyList(LS); end; end; -procedure TFormDesigner.EditMessSufixZeroChange(Sender: TObject); +procedure TFormDesigner.EditMessDone(Sender: TObject); +var + LSection, LContingency: String; begin + LSection := SEC_CONDITION+IntToStr(ComboCurrentCondition.ItemIndex+1); + LContingency := ExtractDelimited(1,ComboCurrentContingency.Text,['|']); + + if Sender is TEdit then + with FExperiment do + begin + if TEdit(Sender) = EditMessPrefix then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND, EditMessPrefix.Text); + + if TEdit(Sender) = EditMessPrefixLoss then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,EditMessPrefixLoss.Text); + + if TEdit(Sender) = EditMessSufixLossSingular then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,EditMessSufixLossSingular.Text); + if TEdit(Sender) = EditMessSufixLossPlural then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,EditMessSufixLossPlural.Text); + + if TEdit(Sender) = EditMessPrefixEarn then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,EditMessPrefixEarn.Text); + + if TEdit(Sender) = EditMessSufixEarnSingular then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,EditMessSufixEarnSingular.Text); + + if TEdit(Sender) = EditMessSufixEarnPlural then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,EditMessSufixEarnPlural.Text); + + if TEdit(Sender) = EditMessSufixZero then + WriteString(LSection, LContingency + KEY_CONSEQUE_MESSAGE_APPEND_ZERO, EditMessSufixZero.Text); + end; end; procedure TFormDesigner.ConsequenceMessageEditingDone(Sender: TObject); @@ -1305,6 +1524,27 @@ begin end; end; +procedure TFormDesigner.EditExperimentEditingDone(Sender: TObject); +begin + with FExperiment do + begin + if Sender is TEdit then + begin + if TEdit(Sender) = EditResearcherName then + WriteString(SEC_EXPERIMENT, KEY_RESEARCHER, EditResearcherName.Text); + + if TEdit(Sender) = EditExperimentName then + WriteString(SEC_EXPERIMENT, KEY_NAME, EditExperimentName.Text); + end; + + if Sender is TMemo then + begin + if TMemo(Sender) = MemoExperimentAim then + WriteString(SEC_EXPERIMENT, KEY_AIM, MemoExperimentAim.Text); + end; + end; +end; + procedure TFormDesigner.FormActivate(Sender: TObject); begin FLoading := False; @@ -1313,15 +1553,48 @@ end; procedure TFormDesigner.BtnAppendCondClick(Sender: TObject); var - i: integer; + i, LOldSection: integer; + LContingency : TStringList; + LS, KeyNameValue, LSectionToRead, LContingencyToRead, KeyName: String; begin + // make LabelPA copy of old components + LOldSection := ComboCurrentCondition.ItemIndex; + + // add new condition i := ComboCurrentCondition.Items.Add(''); ComboCurrentCondition.Items[i] := SEC_CONDITION + IntToStr(i + 1) + '|' + EditConditionName.Text; ComboCurrentCondition.ItemIndex := i; - SaveSectionCondition(SEC_CONDITION + IntToStr(i + 1)); + LS := SEC_CONDITION + IntToStr(i + 1); + SaveSectionCondition(LS); ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; + + // handle selection of contingencies + if LOldSection > -1 then + if ListBoxContingencies.Items.Count > 0 then + if ListBoxContingencies.SelCount > 0 then + begin + LContingency := TStringList.Create; + LSectionToRead := SEC_CONDITION+IntToStr(LOldSection+1); + try + for i := 0 to ListBoxContingencies.Items.Count -1 do + if ListBoxContingencies.Selected[i] then + begin + LContingency.Clear; + LContingencyToRead := ExtractDelimited(1,ListBoxContingencies.Items[i],['|']); + ReadContingencyValuesInSection(LSectionToRead,LContingencyToRead,LContingency); + for KeyNameValue in LContingency do + begin + KeyName := LContingency.ExtractName(KeyNameValue); + FExperiment.WriteString(LS,KeyName,LContingency.Values[KeyName]); + end; + end; + finally + LContingency.Free; + end; + end; + UpdateContingencyList(LS); end; procedure TFormDesigner.BtnAppendContingencyClick(Sender: TObject); @@ -1344,7 +1617,7 @@ procedure TFormDesigner.BtnRemoveCondClick(Sender: TObject); var i: integer; MustReorder: boolean; - LS: String; + LS, LC: String; procedure Reorder(index : integer); var @@ -1396,6 +1669,18 @@ begin end; ListBoxConditions.Items.Text := ComboCurrentCondition.Items.Text; TabSheetContingencies.Enabled := ComboCurrentCondition.Items.Count > 0; + if ComboCurrentCondition.Items.Count > 0 then + if ComboCurrentCondition.ItemIndex <> -1 then + begin + LS := ExtractDelimited(1, ComboCurrentCondition.Text, ['|']); + LoadSectionCondition(LS); + UpdateContingencyList(LS); + if ListBoxContingencies.Items.Count > 0 then + begin + LC := ExtractDelimited(1, ListBoxContingencies.Items[0], ['|']); + LoadContingency(LS,LC); + end; + end; end; end; @@ -1405,25 +1690,6 @@ var MustReorder: boolean; LS, LC: String; - procedure ReadContingencyValuesInSection(LS,LC : string; var Keys : TStringList); - begin - Keys.BeginUpdate; - with FExperiment do - begin - Keys.Values[LC + KEY_CONT_NAME] := ReadString(LS,LC+KEY_CONT_NAME,''); - Keys.Values[LC + KEY_CRITERIA] := ReadString(LS, LC + KEY_CRITERIA,''); - Keys.Values[LC + KEY_CONSEQUE] := ReadString(LS, LC + KEY_CONSEQUE,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_PREPEND_EARN,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,''); - Keys.Values[LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO] := ReadString(LS, LC + KEY_CONSEQUE_MESSAGE_APPEND_ZERO,''); - end; - Keys.EndUpdate; - end; //todo:fix bug in here procedure Reorder(Index:integer); var @@ -1476,12 +1742,19 @@ begin ComboCurrentContingency.ItemIndex := i -1; end; UpdateContingencyList(LS); + if ComboCurrentContingency.Items.Count > 0 then + if (ComboCurrentContingency.ItemIndex > -1) and + (ComboCurrentContingency.ItemIndex < ComboCurrentContingency.Items.Count) then + begin + LC := ExtractDelimited(1, ComboCurrentContingency.Text, ['|']); + LoadContingency(LS,LC); + end; end; end; procedure TFormDesigner.BtnReorderCondClick(Sender: TObject); begin - // todo: custom reorder contingencies + // todo: custom reorder conditions ShowMessage('Não implementado.'); end; @@ -1522,6 +1795,26 @@ begin CreateMessage(i); end; +procedure TFormDesigner.CGGlobalItemClick(Sender: TObject; Index: integer); +begin + if not FLoading then + if Sender is TCheckGroup then + with FExperiment do + begin + if Index = 0 then + WriteBool(SEC_EXPERIMENT, KEY_CHAT_HISTORY_FOR_NEW_PLAYERS, CGGlobal.Checked[Index]); + + if Index = 1 then + WriteBool(SEC_EXPERIMENT, KEY_GEN_PLAYER_AS_NEEDED, CGGlobal.Checked[Index]); + + if Index = 2 then + WriteBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANPLAY, CGGlobal.Checked[Index]); + + if Index = 3 then + WriteBool(SEC_EXPERIMENT, KEY_RESEARCHER_CANCHAT, CGGlobal.Checked[Index]); + end; +end; + procedure TFormDesigner.CheckBoxImutableMessageChange(Sender: TObject); var LVisible : Boolean; @@ -1531,24 +1824,46 @@ begin if LVisible then begin LabelCsq3.Caption := 'Texto da mensagem de notificação'; - LGamePoint := TGamePoint.Create(Self,IntToStr(SpinEditContingencyPoints.Value)); - if not FLoading then - case RGContingencyType.ItemIndex of - 0:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',False); - 1:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',True); - end; - LGamePoint.Free; ButtonPreviewMessage.Caption:= 'Ver como a mensagem será apresentada'; + LGamePoint := TGamePoint.Create(nil,IntToStr(SpinEditContingencyPoints.Value)); + try + if not FLoading then + begin + case RGContingencyType.ItemIndex of + 0:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',False); + 1:EditMessPrefix.Text := LGamePoint.PointMessage('','','','','','','','',True); + end; + + EditMessPrefixLoss.Text := ''; + EditMessSufixLossPlural.Text := ''; + EditMessSufixLossSingular.Text := ''; + EditMessPrefixEarn.Text := ''; + EditMessSufixEarnPlural.Text := ''; + EditMessSufixEarnSingular.Text := ''; + EditMessSufixZero.Text := ''; + end; + finally + LGamePoint.Free; + end; end else begin LabelCsq3.Caption := 'Texto no início da mensagem'; if not FLoading then - case RGContingencyType.ItemIndex of - 0:EditMessPrefix.Text := '$NICNAME'; - 1:EditMessPrefix.Text := 'Vocês'; - end; - ButtonPreviewMessage.Caption:= 'Ver como a mensagem pode ser apresentada'; + begin + case RGContingencyType.ItemIndex of + 0:EditMessPrefix.Text := '$NICNAME'; + 1:EditMessPrefix.Text := 'Vocês'; + end; + EditMessPrefixLoss.Text := 'retiraram'; + EditMessSufixLossSingular.Text := 'item escolar de uma escola pública.'; + EditMessSufixLossPlural.Text := 'itens escolares de uma escola pública.'; + EditMessPrefixEarn.Text := 'doaram'; + EditMessSufixEarnSingular.Text := 'item escolar a uma escola pública.'; + EditMessSufixEarnPlural.Text := 'itens escolares a uma escola pública.'; + EditMessSufixZero.Text := 'não doaram nem retiram itens escolares.'; + ButtonPreviewMessage.Caption:= 'Ver como a mensagem poderá ser apresentada'; + end; end; LabelCsq4.Visible := not LVisible; @@ -1559,19 +1874,26 @@ begin LabelCsq9.Visible := not LVisible; LabelCsq10.Visible := not LVisible; EditMessPrefixLoss.Visible:= not LVisible; - EditMessPrefixLoss.Text := ''; EditMessSufixLossPlural.Visible:= not LVisible; - EditMessSufixLossPlural.Text := ''; EditMessSufixLossSingular.Visible:= not LVisible; - EditMessSufixLossSingular.Text := ''; EditMessPrefixEarn.Visible:= not LVisible; - EditMessPrefixEarn.Text := ''; EditMessSufixEarnPlural.Visible:= not LVisible; - EditMessSufixEarnPlural.Text := ''; EditMessSufixEarnSingular.Visible:= not LVisible; - EditMessSufixEarnSingular.Text := ''; EditMessSufixZero.Visible:= not LVisible; - EditMessSufixZero.Text := ''; + EditMessDone(EditMessPrefix); + EditMessDone(EditMessPrefixLoss); + EditMessDone(EditMessSufixLossSingular); + EditMessDone(EditMessSufixLossPlural); + EditMessDone(EditMessPrefixEarn); + EditMessDone(EditMessSufixEarnSingular); + EditMessDone(EditMessSufixEarnPlural); + EditMessDone(EditMessSufixZero); +end; + +procedure TFormDesigner.ChkMatrixTypeClick(Sender: TObject); +begin + if Sender is TCheckBox then + FExperiment.WriteString(SEC_EXPERIMENT, KEY_MATRIX_TYPE, GetMatrixTypeStringFromCGMatrix); end; diff --git a/units/game_actors.pas b/units/game_actors.pas index 6ea5594..1f7164c 100644 --- a/units/game_actors.pas +++ b/units/game_actors.pas @@ -107,7 +107,7 @@ type procedure StopTimer(Sender:TObject;var ACloseAction:TCloseAction); procedure SelfDestroy(Sender:TOBject);virtual; public - constructor Create(AOwner:TComponent; AP:TGamePoint; AStyle:TConsequenceStyle; ANicname, + constructor Create(AOwner:TComponent; ACsqString, ANicname, APrependLoss,AAppendiceLossSingular,AAppendiceLossPlural, APrependEarn,AAppendiceEarnSingular,AAppendiceEarnPlural,AAppendiceZero:string);overload; constructor Create(AOwner:TComponent; AP:integer; AStyle: TConsequenceStyle; AMessage:array of string);overload; @@ -533,7 +533,7 @@ var LConsequence := S + '+' + IntToStr(Pts) +'|'+ - GetConsequenceStylesString(LCsqStyle) +'|'+ + GetConsequenceStyleString(LCsqStyle) +'|'+ ExtractDelimited(3,LConsequence, ['|']) +'|'+ LPrependLoss +'|'+ LAppendiceLossSingular +'|'+ @@ -554,7 +554,7 @@ begin begin LID := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Names[j]; LConsequence := FPromptTargets[i].Consequence.ConsequenseByPlayerID.Values[LID]; - LCsqStyle := GetConsequenceStylesFromString(ExtractDelimited(2,LConsequence, ['|'])); + LCsqStyle := GetConsequenceStyleFromString(ExtractDelimited(2,LConsequence, ['|'])); // BasA must revert message variables LPrependLoss := ExtractDelimited(4,LConsequence, ['|']); @@ -582,12 +582,15 @@ end; { TConsequence } -constructor TConsequence.Create(AOwner: TComponent; AP: TGamePoint;AStyle: TConsequenceStyle; ANicname, - APrependLoss, AAppendiceLossSingular, AAppendiceLossPlural, - APrependEarn, AAppendiceEarnSingular, AAppendiceEarnPlural, AAppendiceZero: string); +constructor TConsequence.Create(AOwner: TComponent; ACsqString, ANicname, + APrependLoss, AAppendiceLossSingular, AAppendiceLossPlural, APrependEarn, + AAppendiceEarnSingular, AAppendiceEarnPlural, AAppendiceZero: string); +var + LP : string; begin inherited Create(AOwner); - FStyle:=AStyle; + + // custom message FNicname:=ANicname; FPrependLoss:=APrependLoss; FAppendiceLossSingular:=AAppendiceLossSingular; @@ -597,7 +600,15 @@ begin FAppendiceEarnPlural:=AAppendiceEarnPlural; FAppendiceZero:=AAppendiceZero; - FP := AP; + // extract game point string + LP := ExtractDelimited(1,ACsqString,['|']); + + // [value,variation] + FP := TGamePoint.Create(AOwner,[StrToInt(ExtractDelimited(1,LP,[','])),StrToInt(ExtractDelimited(2,LP,[',']))]); + + // consequesen style string + FStyle := GetConsequenceStyleFromString(ExtractDelimited(2,ACsqString,['|'])); + FMessage := TPopupNotifier.Create(AOwner); FConsequenceByPlayerID := TStringList.Create; end; @@ -625,7 +636,7 @@ constructor TConsequence.Create(AOwner: TComponent; begin inherited Create(AOwner); FP := TGamePoint.Create(AOwner,ExtractDelimited(1,AConsequenceString,['|'])); - FStyle:=GetConsequenceStylesFromString(ExtractDelimited(2,AConsequenceString,['|'])); + FStyle:=GetConsequenceStyleFromString(ExtractDelimited(2,AConsequenceString,['|'])); FNicname:=ExtractDelimited(3,AConsequenceString,['|']); FPrependLoss:=ExtractDelimited(4,AConsequenceString,['|']); FAppendiceLossSingular:=ExtractDelimited(5,AConsequenceString,['|']); @@ -652,7 +663,7 @@ end; function TConsequence.AsString(AID: string): string; begin Result := IntToStr(FP.ValueWithVariation) + '|'; - Result += GetConsequenceStylesString(FStyle)+'|'; + Result += GetConsequenceStyleString(FStyle)+'|'; Result += FNicname +'|'; Result += FPrependLoss + '|'; Result += FAppendiceLossSingular + '|'; diff --git a/units/game_file_methods.pas b/units/game_file_methods.pas index 4f7d249..a13300a 100644 --- a/units/game_file_methods.pas +++ b/units/game_file_methods.pas @@ -202,8 +202,21 @@ var with LIniFile do while ValueExists(LS, LCK+KEY_CONSEQUE) and ValueExists(LS, LCK+KEY_CRITERIA)do begin - LConsequence := TConsequence.Create(AExperiment,ReadString(LS,LCK+KEY_CONSEQUE,DEF_CONSEQUENCE)); - LCriteria := GetCriteriaFromString(ReadString(LS,LCK+KEY_CRITERIA,DEF_CRITERIA)); + AExperiment.Condition[ACondition].Contingencies[i].ContingencyName := ReadString(LS, LCK+KEY_CONT_NAME, ''); + ReadString(LS, LCK+KEY_CONSEQUE, ''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND_LOSS,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_LOSS_S,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_LOSS_P,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_PREPEND_EARN,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_EARN_S,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_EARN_P,''); + ReadString(LS, LCK+KEY_CONSEQUE_MESSAGE_APPEND_ZERO, ''); + + + LConsequence := TConsequence.Create(AExperiment, + ReadString(LS,LCK+KEY_CONSEQUE,DEF_CONSEQUENCE)); + LCriteria := GetCriteriaFromString(ReadString(LS, LCK+KEY_CRITERIA, '')); AExperiment.Condition[ACondition].Contingencies[i] := TContingency.Create(AExperiment,LConsequence,LCriteria,IsMeta); i := AExperiment.AppendContingency(ACondition); SetLCK(i); @@ -277,11 +290,13 @@ var Choice := GetChoiceFromString(ReadString(LS,KEY_PLAYER_CHOICE_LAST,'0,NONE,')); ID := ReadString(LS,KEY_PLAYER_ID,'ID'); Nicname := ReadString(LS,KEY_PLAYER_NICNAME,GenResourceName(i)); - Login := ReadString(LS,KEY_PLAYER_LOGIN,'jogador'+IntToStr(i+1)); - Password := ReadString(LS,KEY_PLAYER_PASSWORD,'1234'); - Points := GetPPointsFromString(ReadString(LS,KEY_PLAYER_POINTS,'0,0,')); - Status := GetStatusFromString(ReadString(LS,KEY_PLAYER_STATUS,'esperando')); - Data.Values[KEY_PLAYER_TEMP] := ReadString(LS,KEY_PLAYER_TEMP,''); + + // currently not in use + //Login := ReadString(LS,KEY_PLAYER_LOGIN,'jogador'+IntToStr(i+1)); + //Password := ReadString(LS,KEY_PLAYER_PASSWORD,'1234'); + //Points := GetPPointsFromString(ReadString(LS,KEY_PLAYER_POINTS,'0,0,')); + //Status := GetStatusFromString(ReadString(LS,KEY_PLAYER_STATUS,'esperando')); + //Data.Values[KEY_PLAYER_TEMP] := ReadString(LS,KEY_PLAYER_TEMP,''); end; AExperiment.Player[i] := P; i := AExperiment.AppendPlayer; diff --git a/units/game_resources.pas b/units/game_resources.pas index e7835cc..092f04e 100644 --- a/units/game_resources.pas +++ b/units/game_resources.pas @@ -52,7 +52,10 @@ resourcestring KEY_TURN_RANDOM = 'Rodada.OrdemDeJogadaAleatória'; // Sim KEY_POINTS_COUNT = 'Pontos.AoRecomeço'; - KEY_POINTS_ONSTART = 'Pontos.SomarAoComeço'; + KEY_POINTS_ONSTART_A = 'Pontos.Somar_ao_iniciar_condição.A'; + KEY_POINTS_ONSTART_B = 'Pontos.Somar_ao_iniciar_condição.B'; + KEY_POINTS_ONSTART_I = 'Pontos.Somar_ao_iniciar_condição.I'; + KEY_POINTS_ONSTART_G = 'Pontos.Somar_ao_iniciar_condição.G'; KEY_CYCLES_VALUE = 'Ciclos.MudançaDeGeração'; KEY_CYCLES_COUNT = 'Ciclos.AoRecomeço'; diff --git a/units/string_methods.pas b/units/string_methods.pas index 7705efe..1c76384 100644 --- a/units/string_methods.pas +++ b/units/string_methods.pas @@ -33,10 +33,10 @@ function GetPromptStyleFromString(S : string) : TPromptStyle; function GetPromptStyleString(AStyle : TPromptStyle) : string; function GetGamePromptStyleFromString(S : string) : TGamePromptStyle; -function GetConsequenceStyleFromString(s : string):TGameConsequenceStyle; -function GetConsequenceStyleString(AStyle : TGameConsequenceStyle): string; -function GetConsequenceStylesFromString(S : string):TConsequenceStyle; -function GetConsequenceStylesString(CS : TConsequenceStyle): string; +function GetGConsequenceStyleFromString(s : string):TGameConsequenceStyle; +function GetGConsequenceStyleString(AStyle : TGameConsequenceStyle): string; +function GetConsequenceStyleFromString(S : string):TConsequenceStyle; +function GetConsequenceStyleString(CS : TConsequenceStyle): string; function GetCriteriaString(ACriteria : TCriteria) : string; function GetCriteriaFromString(S : string) : TCriteria; @@ -236,7 +236,7 @@ begin end; end; -function GetConsequenceStyleFromString(s: string): TGameConsequenceStyle; +function GetGConsequenceStyleFromString(s: string): TGameConsequenceStyle; begin case UpperCase(S) of 'NADA': Result:= gscNone; @@ -251,7 +251,7 @@ begin end; end; -function GetConsequenceStyleString(AStyle: TGameConsequenceStyle): string; +function GetGConsequenceStyleString(AStyle: TGameConsequenceStyle): string; begin Result := ''; case AStyle of @@ -343,7 +343,7 @@ begin end; end; -function GetConsequenceStylesFromString(S:string):TConsequenceStyle; +function GetConsequenceStyleFromString(S:string):TConsequenceStyle; var LCount, i : integer; @@ -363,7 +363,7 @@ begin end; end; -function GetConsequenceStylesString(CS: TConsequenceStyle): string; +function GetConsequenceStyleString(CS: TConsequenceStyle): string; var ConsequenceStyle : TGameConsequenceStyle; begin Result := ''; -- libgit2 0.21.2