Ignore:
Timestamp:
Nov 16, 2014, 5:12:25 PM (10 years ago)
Author:
chronos
Message:
  • Added: Computer player settings to be low, medium or highly aggresive in attacking.
  • Fixed: Mouse move insensitivity zone is now DPI aware.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormPlayer.pas

    r55 r90  
    1616    ButtonCancel: TButton;
    1717    ButtonOk: TButton;
     18    CheckBoxDefensive: TCheckBox;
    1819    ColorBox1: TColorBox;
    1920    ComboBox1: TComboBox;
     21    ComboBoxAgressivity: TComboBox;
    2022    EditName: TEdit;
    2123    Label1: TLabel;
    2224    Label2: TLabel;
    2325    Label3: TLabel;
     26    Label4: TLabel;
    2427  private
    2528    { private declarations }
     
    4043  SHuman = 'Human';
    4144  SComputer = 'Computer';
     45  SAgroNotAttacking = 'Not attacking';
     46  SAgroLow = 'Low';
     47  SAgroMedium = 'Medium';
     48  SAgroHigh = 'High';
    4249
    4350{ TFormPlayer }
     
    5461    ItemIndex := LastIndex;
    5562  end;
     63  with ComboBoxAgressivity do begin
     64    LastIndex := ItemIndex;
     65    Clear;
     66    Items.Add(SAgroLow);
     67    Items.Add(SAgroMedium);
     68    Items.Add(SAgroHigh);
     69    ItemIndex := LastIndex;
     70  end;
    5671end;
    5772
     
    6176  ComboBox1.ItemIndex := Integer(Player.Mode);
    6277  ColorBox1.Selected := Player.Color;
     78  Label4.Visible := Player.Mode = pmComputer;
     79  ComboBoxAgressivity.Visible := Player.Mode = pmComputer;
     80  ComboBoxAgressivity.ItemIndex := Integer(Player.Agressivity);
     81  CheckBoxDefensive.Visible := Player.Mode = pmComputer;
     82  CheckBoxDefensive.Checked := Player.Defensive;
    6383end;
    6484
     
    6888  Player.Mode := TPlayerMode(ComboBox1.ItemIndex);
    6989  Player.Color := ColorBox1.Selected;
     90  Player.Agressivity := TComputerAgressivity(ComboBoxAgressivity.ItemIndex);
     91  Player.Defensive := CheckBoxDefensive.Checked;
    7092end;
    7193
Note: See TracChangeset for help on using the changeset viewer.