Changeset 47 for trunk/Forms


Ignore:
Timestamp:
Apr 24, 2019, 11:41:52 AM (6 years ago)
Author:
chronos
Message:
  • Added: Enable player checkbox.
Location:
trunk/Forms
Files:
2 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNewGame.lfm

    r46 r47  
    1 object NewGameForm: TNewGameForm
     1object FormNewGame: TFormNewGame
    22  Left = 579
    3   Height = 650
     3  Height = 542
    44  Top = 226
    5   Width = 1015
     5  Width = 846
    66  Caption = 'New game'
    7   ClientHeight = 650
    8   ClientWidth = 1015
    9   DesignTimePPI = 144
     7  ClientHeight = 542
     8  ClientWidth = 846
     9  DesignTimePPI = 120
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    1212  OnShow = FormShow
    13   LCLVersion = '2.0.0.4'
     13  LCLVersion = '2.0.2.0'
    1414  object ButtonStart: TButton
    15     Left = 888
    16     Height = 37
    17     Top = 600
    18     Width = 113
     15    Left = 740
     16    Height = 31
     17    Top = 500
     18    Width = 94
    1919    Anchors = [akRight, akBottom]
    2020    Caption = 'Start'
     
    2424  end
    2525  object ButtonCancel: TButton
    26     Left = 756
    27     Height = 37
    28     Top = 600
    29     Width = 113
     26    Left = 630
     27    Height = 31
     28    Top = 500
     29    Width = 94
    3030    Anchors = [akRight, akBottom]
    3131    Caption = 'Cancel'
     
    3535  end
    3636  object Label1: TLabel
    37     Left = 12
    38     Height = 26
    39     Top = 0
    40     Width = 66
     37    Left = 10
     38    Height = 20
     39    Top = 8
     40    Width = 49
    4141    Caption = 'Players:'
    4242    ParentColor = False
     
    4444  end
    4545  object ListView1: TListView
    46     Left = 12
    47     Height = 552
    48     Top = 36
    49     Width = 442
     46    Left = 10
     47    Height = 460
     48    Top = 30
     49    Width = 368
    5050    Anchors = [akTop, akLeft, akBottom]
    5151    Checkboxes = True
     
    5353      item
    5454        Caption = 'Name'
    55         Width = 226
     55        Width = 188
    5656      end   
    5757      item
    5858        Caption = 'Color'
    59         Width = 74
     59        Width = 62
    6060      end   
    6161      item
    6262        Caption = 'Controls'
    63         Width = 227
     63        Width = 189
    6464      end>
    6565    OwnerData = True
     
    7575  end
    7676  object ColorButton1: TColorButton
    77     Left = 756
    78     Height = 37
    79     Top = 96
    80     Width = 113
     77    Left = 634
     78    Height = 31
     79    Top = 112
     80    Width = 94
    8181    BorderWidth = 2
    8282    ButtonColorSize = 16
     
    8686  end
    8787  object Label2: TLabel
    88     Left = 600
    89     Height = 26
    90     Top = 101
    91     Width = 65
     88    Left = 500
     89    Height = 20
     90    Top = 116
     91    Width = 51
    9292    Caption = 'Color 1:'
    9393    ParentColor = False
     
    9595  end
    9696  object GroupBox1: TGroupBox
    97     Left = 588
    98     Height = 368
    99     Top = 184
    100     Width = 408
     97    Left = 490
     98    Height = 243
     99    Top = 208
     100    Width = 340
    101101    Caption = 'Control keys'
    102     ClientHeight = 341
    103     ClientWidth = 406
     102    ClientHeight = 218
     103    ClientWidth = 336
    104104    ParentFont = False
    105105    TabOrder = 3
    106106    object EditUp: TEdit
    107       Left = 130
    108       Height = 43
     107      Left = 108
     108      Height = 28
    109109      Top = 2
    110       Width = 120
     110      Width = 100
    111111      OnChange = EditUpChange
    112112      OnKeyDown = EditUpKeyDown
     
    115115    end
    116116    object Label3: TLabel
    117       Left = 10
    118       Height = 26
    119       Top = 14
    120       Width = 29
     117      Left = 8
     118      Height = 20
     119      Top = 12
     120      Width = 22
    121121      Caption = 'Up:'
    122122      ParentColor = False
     
    124124    end
    125125    object Label4: TLabel
    126       Left = 10
    127       Height = 26
    128       Top = 62
    129       Width = 54
     126      Left = 8
     127      Height = 20
     128      Top = 52
     129      Width = 42
    130130      Caption = 'Down:'
    131131      ParentColor = False
     
    133133    end
    134134    object EditDown: TEdit
    135       Left = 130
    136       Height = 43
    137       Top = 48
    138       Width = 120
     135      Left = 108
     136      Height = 28
     137      Top = 40
     138      Width = 100
    139139      OnChange = EditDownChange
    140140      OnKeyDown = EditDownKeyDown
     
    143143    end
    144144    object Label5: TLabel
    145       Left = 10
    146       Height = 26
    147       Top = 110
    148       Width = 37
     145      Left = 8
     146      Height = 20
     147      Top = 92
     148      Width = 28
    149149      Caption = 'Left:'
    150150      ParentColor = False
     
    152152    end
    153153    object EditLeft: TEdit
    154       Left = 130
    155       Height = 43
    156       Top = 98
    157       Width = 120
     154      Left = 108
     155      Height = 28
     156      Top = 82
     157      Width = 100
    158158      OnChange = EditLeftChange
    159159      OnKeyDown = EditLeftKeyDown
     
    162162    end
    163163    object Label6: TLabel
    164       Left = 10
    165       Height = 26
    166       Top = 158
    167       Width = 50
     164      Left = 8
     165      Height = 20
     166      Top = 132
     167      Width = 38
    168168      Caption = 'Right:'
    169169      ParentColor = False
     
    171171    end
    172172    object EditRight: TEdit
    173       Left = 130
    174       Height = 43
    175       Top = 146
    176       Width = 120
     173      Left = 108
     174      Height = 28
     175      Top = 122
     176      Width = 100
    177177      OnChange = EditRightChange
    178178      OnKeyDown = EditRightKeyDown
     
    181181    end
    182182    object Label7: TLabel
    183       Left = 10
    184       Height = 26
    185       Top = 206
    186       Width = 55
     183      Left = 8
     184      Height = 20
     185      Top = 172
     186      Width = 42
    187187      Caption = 'Shoot:'
    188188      ParentColor = False
     
    190190    end
    191191    object EditShoot: TEdit
    192       Left = 130
    193       Height = 43
    194       Top = 194
    195       Width = 120
     192      Left = 108
     193      Height = 28
     194      Top = 162
     195      Width = 100
    196196      OnChange = EditShootChange
    197197      OnKeyDown = EditShootKeyDown
     
    201201  end
    202202  object EditName: TEdit
    203     Left = 720
    204     Height = 43
    205     Top = 36
    206     Width = 264
     203    Left = 600
     204    Height = 28
     205    Top = 30
     206    Width = 220
    207207    OnChange = EditNameChange
    208208    ParentFont = False
     
    210210  end
    211211  object Label8: TLabel
    212     Left = 600
    213     Height = 26
    214     Top = 48
    215     Width = 56
     212    Left = 500
     213    Height = 20
     214    Top = 40
     215    Width = 43
    216216    Caption = 'Name:'
    217217    ParentColor = False
     
    219219  end
    220220  object Label9: TLabel
    221     Left = 600
    222     Height = 26
    223     Top = 141
    224     Width = 65
     221    Left = 500
     222    Height = 20
     223    Top = 145
     224    Width = 51
    225225    Caption = 'Color 2:'
    226226    ParentColor = False
     
    228228  end
    229229  object ColorButton2: TColorButton
    230     Left = 756
    231     Height = 37
    232     Top = 136
    233     Width = 113
     230    Left = 634
     231    Height = 31
     232    Top = 145
     233    Width = 94
    234234    BorderWidth = 2
    235235    ButtonColorSize = 16
     
    238238    ParentFont = False
    239239  end
     240  object CheckBoxEnabled: TCheckBox
     241    Left = 504
     242    Height = 24
     243    Top = 80
     244    Width = 78
     245    Caption = 'Enabled'
     246    OnChange = CheckBoxEnabledChange
     247    TabOrder = 5
     248  end
    240249end
  • trunk/Forms/UFormNewGame.lrj

    r46 r47  
    11{"version":1,"strings":[
    2 {"hash":211211125,"name":"tnewgameform.caption","sourcebytes":[78,101,119,32,103,97,109,101],"value":"New game"},
    3 {"hash":5941396,"name":"tnewgameform.buttonstart.caption","sourcebytes":[83,116,97,114,116],"value":"Start"},
    4 {"hash":77089212,"name":"tnewgameform.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
    5 {"hash":42978330,"name":"tnewgameform.label1.caption","sourcebytes":[80,108,97,121,101,114,115,58],"value":"Players:"},
    6 {"hash":346165,"name":"tnewgameform.listview1.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"},
    7 {"hash":4875106,"name":"tnewgameform.listview1.columns[1].caption","sourcebytes":[67,111,108,111,114],"value":"Color"},
    8 {"hash":106664595,"name":"tnewgameform.listview1.columns[2].caption","sourcebytes":[67,111,110,116,114,111,108,115],"value":"Controls"},
    9 {"hash":104220650,"name":"tnewgameform.label2.caption","sourcebytes":[67,111,108,111,114,32,49,58],"value":"Color 1:"},
    10 {"hash":21055635,"name":"tnewgameform.groupbox1.caption","sourcebytes":[67,111,110,116,114,111,108,32,107,101,121,115],"value":"Control keys"},
    11 {"hash":23610,"name":"tnewgameform.label3.caption","sourcebytes":[85,112,58],"value":"Up:"},
    12 {"hash":4943386,"name":"tnewgameform.label4.caption","sourcebytes":[68,111,119,110,58],"value":"Down:"},
    13 {"hash":5422458,"name":"tnewgameform.label5.caption","sourcebytes":[76,101,102,116,58],"value":"Left:"},
    14 {"hash":93314938,"name":"tnewgameform.label6.caption","sourcebytes":[82,105,103,104,116,58],"value":"Right:"},
    15 {"hash":94332538,"name":"tnewgameform.label7.caption","sourcebytes":[83,104,111,111,116,58],"value":"Shoot:"},
    16 {"hash":5538698,"name":"tnewgameform.label8.caption","sourcebytes":[78,97,109,101,58],"value":"Name:"},
    17 {"hash":104220666,"name":"tnewgameform.label9.caption","sourcebytes":[67,111,108,111,114,32,50,58],"value":"Color 2:"}
     2{"hash":211211125,"name":"tformnewgame.caption","sourcebytes":[78,101,119,32,103,97,109,101],"value":"New game"},
     3{"hash":5941396,"name":"tformnewgame.buttonstart.caption","sourcebytes":[83,116,97,114,116],"value":"Start"},
     4{"hash":77089212,"name":"tformnewgame.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
     5{"hash":42978330,"name":"tformnewgame.label1.caption","sourcebytes":[80,108,97,121,101,114,115,58],"value":"Players:"},
     6{"hash":346165,"name":"tformnewgame.listview1.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"},
     7{"hash":4875106,"name":"tformnewgame.listview1.columns[1].caption","sourcebytes":[67,111,108,111,114],"value":"Color"},
     8{"hash":106664595,"name":"tformnewgame.listview1.columns[2].caption","sourcebytes":[67,111,110,116,114,111,108,115],"value":"Controls"},
     9{"hash":104220650,"name":"tformnewgame.label2.caption","sourcebytes":[67,111,108,111,114,32,49,58],"value":"Color 1:"},
     10{"hash":21055635,"name":"tformnewgame.groupbox1.caption","sourcebytes":[67,111,110,116,114,111,108,32,107,101,121,115],"value":"Control keys"},
     11{"hash":23610,"name":"tformnewgame.label3.caption","sourcebytes":[85,112,58],"value":"Up:"},
     12{"hash":4943386,"name":"tformnewgame.label4.caption","sourcebytes":[68,111,119,110,58],"value":"Down:"},
     13{"hash":5422458,"name":"tformnewgame.label5.caption","sourcebytes":[76,101,102,116,58],"value":"Left:"},
     14{"hash":93314938,"name":"tformnewgame.label6.caption","sourcebytes":[82,105,103,104,116,58],"value":"Right:"},
     15{"hash":94332538,"name":"tformnewgame.label7.caption","sourcebytes":[83,104,111,111,116,58],"value":"Shoot:"},
     16{"hash":5538698,"name":"tformnewgame.label8.caption","sourcebytes":[78,97,109,101,58],"value":"Name:"},
     17{"hash":104220666,"name":"tformnewgame.label9.caption","sourcebytes":[67,111,108,111,114,32,50,58],"value":"Color 2:"},
     18{"hash":206017268,"name":"tformnewgame.checkboxenabled.caption","sourcebytes":[69,110,97,98,108,101,100],"value":"Enabled"}
    1819]}
  • trunk/Forms/UFormNewGame.pas

    r46 r47  
    1 unit UNewGameForm;
     1unit UFormNewGame;
    22
    33{$mode delphi}{$H+}
     
    1111type
    1212
    13   { TNewGameForm }
    14 
    15   TNewGameForm = class(TForm)
     13  { TFormNewGame }
     14
     15  TFormNewGame = class(TForm)
    1616    ButtonStart: TButton;
    1717    ButtonCancel: TButton;
     18    CheckBoxEnabled: TCheckBox;
    1819    ColorButton1: TColorButton;
    1920    ColorButton2: TColorButton;
     
    3536    Label9: TLabel;
    3637    ListView1: TListView;
     38    procedure CheckBoxEnabledChange(Sender: TObject);
    3739    procedure ColorButton1ColorChanged(Sender: TObject);
    3840    procedure ColorButton2ColorChanged(Sender: TObject);
     
    7375
    7476var
    75   NewGameForm: TNewGameForm;
     77  FormNewGame: TFormNewGame;
    7678
    7779
     
    8385  UCore;
    8486
    85 { TNewGameForm }
    86 
    87 procedure TNewGameForm.ListView1Change(Sender: TObject; Item: TListItem;
     87{ TFormNewGame }
     88
     89procedure TFormNewGame.ListView1Change(Sender: TObject; Item: TListItem;
    8890  Change: TItemChange);
    8991begin
     
    9294end;
    9395
    94 procedure TNewGameForm.ListView1CustomDrawSubItem(Sender: TCustomListView;
     96procedure TFormNewGame.ListView1CustomDrawSubItem(Sender: TCustomListView;
    9597  Item: TListItem; SubItem: Integer; State: TCustomDrawState;
    9698  var DefaultDraw: Boolean);
     
    104106end;
    105107
    106 procedure TNewGameForm.ListView1Data(Sender: TObject; Item: TListItem);
     108procedure TFormNewGame.ListView1Data(Sender: TObject; Item: TListItem);
    107109begin
    108110  if Item.Index < Players.Count then
     
    116118end;
    117119
    118 procedure TNewGameForm.ListView1SelectItem(Sender: TObject; Item: TListItem;
     120procedure TFormNewGame.ListView1SelectItem(Sender: TObject; Item: TListItem;
    119121  Selected: Boolean);
    120122begin
     
    129131    EditRight.Text := IntToStr(Keys.Right);
    130132    EditShoot.Text := IntToStr(Keys.Shoot);
     133    CheckBoxEnabled.Checked := Enabled;
    131134  end;
    132135  UpdateInterface;
    133136end;
    134137
    135 procedure TNewGameForm.ReloadList;
     138procedure TFormNewGame.ReloadList;
    136139begin
    137140  ListView1.Items.Count := Players.Count;
     
    139142end;
    140143
    141 procedure TNewGameForm.UpdateInterface;
     144procedure TFormNewGame.UpdateInterface;
    142145begin
    143146  EditUp.Enabled := Assigned(ListView1.Selected);
     
    149152  ColorButton1.Enabled := Assigned(ListView1.Selected);
    150153  ColorButton2.Enabled := Assigned(ListView1.Selected);
    151 end;
    152 
    153 procedure TNewGameForm.LoadData(Engine: TEngine);
     154  CheckBoxEnabled.Enabled := Assigned(ListView1.Selected);
     155end;
     156
     157procedure TFormNewGame.LoadData(Engine: TEngine);
    154158begin
    155159  Players.Assign(Engine.PlayerPool);
    156160end;
    157161
    158 procedure TNewGameForm.SaveData(Engine: TEngine);
     162procedure TFormNewGame.SaveData(Engine: TEngine);
    159163begin
    160164  Engine.PlayerPool.Assign(Players);
    161165end;
    162166
    163 procedure TNewGameForm.ColorButton1ColorChanged(Sender: TObject);
     167procedure TFormNewGame.ColorButton1ColorChanged(Sender: TObject);
    164168begin
    165169  if Assigned(ListView1.Selected) then
     
    170174end;
    171175
    172 procedure TNewGameForm.ColorButton2ColorChanged(Sender: TObject);
     176procedure TFormNewGame.CheckBoxEnabledChange(Sender: TObject);
     177begin
     178  if Assigned(ListView1.Selected) then
     179  with TPlayer(ListView1.Selected.Data) do begin
     180    Enabled := CheckBoxEnabled.Checked;
     181    ReloadList;
     182  end;
     183end;
     184
     185procedure TFormNewGame.ColorButton2ColorChanged(Sender: TObject);
    173186begin
    174187  if Assigned(ListView1.Selected) then
     
    179192end;
    180193
    181 procedure TNewGameForm.EditDownChange(Sender: TObject);
     194procedure TFormNewGame.EditDownChange(Sender: TObject);
    182195var
    183196  Value: Integer;
     
    190203end;
    191204
    192 procedure TNewGameForm.EditDownKeyDown(Sender: TObject; var Key: Word;
     205procedure TFormNewGame.EditDownKeyDown(Sender: TObject; var Key: Word;
    193206  Shift: TShiftState);
    194207begin
     
    196209end;
    197210
    198 procedure TNewGameForm.EditLeftChange(Sender: TObject);
     211procedure TFormNewGame.EditLeftChange(Sender: TObject);
    199212var
    200213  Value: Integer;
     
    207220end;
    208221
    209 procedure TNewGameForm.EditLeftKeyDown(Sender: TObject; var Key: Word;
     222procedure TFormNewGame.EditLeftKeyDown(Sender: TObject; var Key: Word;
    210223  Shift: TShiftState);
    211224begin
     
    213226end;
    214227
    215 procedure TNewGameForm.EditNameChange(Sender: TObject);
     228procedure TFormNewGame.EditNameChange(Sender: TObject);
    216229begin
    217230  if Assigned(ListView1.Selected) then
     
    222235end;
    223236
    224 procedure TNewGameForm.EditRightChange(Sender: TObject);
     237procedure TFormNewGame.EditRightChange(Sender: TObject);
    225238var
    226239  Value: Integer;
     
    233246end;
    234247
    235 procedure TNewGameForm.EditRightKeyDown(Sender: TObject; var Key: Word;
     248procedure TFormNewGame.EditRightKeyDown(Sender: TObject; var Key: Word;
    236249  Shift: TShiftState);
    237250begin
     
    239252end;
    240253
    241 procedure TNewGameForm.EditShootChange(Sender: TObject);
     254procedure TFormNewGame.EditShootChange(Sender: TObject);
    242255var
    243256  Value: Integer;
     
    250263end;
    251264
    252 procedure TNewGameForm.EditShootKeyDown(Sender: TObject; var Key: Word;
     265procedure TFormNewGame.EditShootKeyDown(Sender: TObject; var Key: Word;
    253266  Shift: TShiftState);
    254267begin
     
    256269end;
    257270
    258 procedure TNewGameForm.EditUpChange(Sender: TObject);
     271procedure TFormNewGame.EditUpChange(Sender: TObject);
    259272var
    260273  Value: Integer;
     
    267280end;
    268281
    269 procedure TNewGameForm.EditUpKeyDown(Sender: TObject; var Key: Word;
     282procedure TFormNewGame.EditUpKeyDown(Sender: TObject; var Key: Word;
    270283  Shift: TShiftState);
    271284begin
     
    273286end;
    274287
    275 procedure TNewGameForm.FormCreate(Sender: TObject);
     288procedure TFormNewGame.FormCreate(Sender: TObject);
    276289begin
    277290  Core.CoolTranslator1.TranslateComponentRecursive(Self);
     
    279292end;
    280293
    281 procedure TNewGameForm.FormDestroy(Sender: TObject);
     294procedure TFormNewGame.FormDestroy(Sender: TObject);
    282295begin
    283296  FreeAndNil(Players);
    284297end;
    285298
    286 procedure TNewGameForm.FormShow(Sender: TObject);
     299procedure TFormNewGame.FormShow(Sender: TObject);
    287300begin
    288301  ReloadList;
  • trunk/Forms/UMainForm.lfm

    r44 r47  
    11object MainForm: TMainForm
    22  Left = 486
    3   Height = 618
     3  Height = 515
    44  Top = 258
    5   Width = 770
     5  Width = 642
    66  Caption = 'Tunneler'
    7   ClientHeight = 584
    8   ClientWidth = 770
    9   DesignTimePPI = 144
     7  ClientHeight = 490
     8  ClientWidth = 642
     9  DesignTimePPI = 120
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    1616  OnKeyUp = FormKeyUp
    1717  OnShow = FormShow
    18   LCLVersion = '2.0.0.4'
     18  LCLVersion = '2.0.2.0'
    1919  object StatusBar1: TStatusBar
    2020    Left = 0
    2121    Height = 28
    22     Top = 556
    23     Width = 770
     22    Top = 462
     23    Width = 642
    2424    Panels = <   
    2525      item
    26         Width = 74
     26        Width = 62
    2727      end   
    2828      item
    29         Width = 74
     29        Width = 62
    3030      end   
    3131      item
    32         Width = 74
     32        Width = 62
    3333      end   
    3434      item
    35         Width = 74
     35        Width = 62
    3636      end   
    3737      item
    38         Width = 74
     38        Width = 62
    3939      end   
    4040      item
    41         Width = 74
     41        Width = 62
    4242      end   
    4343      item
    44         Width = 74
     44        Width = 62
    4545      end>
    4646    ParentFont = False
     
    4949  object Image1: TImage
    5050    Left = 0
    51     Height = 556
     51    Height = 462
    5252    Top = 0
    53     Width = 770
     53    Width = 642
    5454    Align = alClient
    5555    OnMouseLeave = Image1MouseLeave
     
    5959    Interval = 50
    6060    OnTimer = TimerDrawTimer
    61     left = 149
    62     top = 76
     61    left = 124
     62    top = 63
    6363  end
    6464  object MainMenu1: TMainMenu
    65     left = 276
    66     top = 24
     65    left = 230
     66    top = 20
    6767    object MenuItem1: TMenuItem
    6868      Caption = 'Game'
     
    9393    Interval = 20
    9494    OnTimer = TimerEngineTickTimer
    95     left = 144
    96     top = 156
     95    left = 120
     96    top = 130
    9797  end
    9898  object ActionList1: TActionList
    99     left = 432
    100     top = 48
     99    left = 360
     100    top = 40
    101101    object AFullScreen: TAction
    102102      Caption = 'Fullscreen mode'
     
    132132    RootName = 'CONFIG'
    133133    ReadOnly = False
    134     left = 149
    135     top = 360
     134    left = 124
     135    top = 300
    136136  end
    137137end
  • trunk/Forms/UMainForm.pas

    r44 r47  
    7676
    7777uses
    78   UCore, UMapForm, UNewGameForm, UFormAbout;
     78  UCore, UMapForm, UFormNewGame, UFormAbout;
    7979
    8080resourcestring
     
    191191procedure TMainForm.ANewGameExecute(Sender: TObject);
    192192begin
    193   NewGameForm.LoadData(Engine);
    194   if NewGameForm.ShowModal = mrOk then begin
    195     NewGameForm.SaveData(Engine);
     193  FormNewGame.LoadData(Engine);
     194  if FormNewGame.ShowModal = mrOk then begin
     195    FormNewGame.SaveData(Engine);
    196196    Engine.NewGame;
    197197  end;
Note: See TracChangeset for help on using the changeset viewer.