-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.pas
More file actions
72 lines (60 loc) · 1.56 KB
/
options.pas
File metadata and controls
72 lines (60 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
unit options;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,main;
type
TForm5 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Bevel1: TBevel;
StaticText1: TStaticText;
Label2: TLabel;
Speed1: TComboBox;
Label3: TLabel;
Difficulty: TComboBox;
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
function Aff_Option:integer;
var
Form5: TForm5;
implementation
{$R *.dfm}
function Aff_Option:integer;
begin
with form5 do
begin
edit1.Text:=gw.Players[1].Name;
Fill_Config;
Speed1.ItemIndex:=Config.ReadInteger('Info','Speed',1);
Difficulty.ItemIndex:=Config.ReadInteger('Info','Difficulty',0);
Result:=Form5.ShowModal;
If Result=mrOk then
gw.Players[1].Name:=edit1.Text;
refreshPlayerInfo(1);
fill_config;
config.WriteString('Info','UserName',gw.Players[1].Name);
Config.WriteInteger('Info','Speed',Speed1.ItemIndex);
Config.WriteInteger('Info','Difficulty',Difficulty.ItemIndex);
gw.Difficulty:=Difficulty.ItemIndex;
end;
end;
procedure TForm5.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
If ssleft In Shift Then
Begin
//Le mouvement de la fenêtre n'est autorisé que si 1 => y <= 24
ReleaseCapture;
Perform(WM_SYSCOMMAND, $F012, 0);
End ;
end;
end.