5
5
interface
6
6
7
7
uses
8
- Classes, SysUtils, Registry, jsonConf, Dialogs,
8
+ Classes, SysUtils, Registry, jsonConf, Dialogs, Controls,
9
9
Common;
10
10
11
11
// Class to hold user settings and reading registry.
@@ -22,7 +22,7 @@ TSettings = class
22
22
23
23
// function GetMyDoc(): string;
24
24
function GenReg ( t: string ): string;
25
- function GetInstallDir () : string;
25
+ function GetInstallDir : string;
26
26
27
27
// Property getter setters
28
28
function GetGameDir (): string;
@@ -73,7 +73,7 @@ procedure TSettings.LoadConf();
73
73
conf.Filename := json_fname; // created if NE. loads if E.
74
74
end ;
75
75
76
- function TSettings.GetInstallDir () : string;
76
+ function TSettings.GetInstallDir : string;
77
77
var
78
78
filename: string;
79
79
diag: TOpenDialog;
@@ -86,26 +86,32 @@ function TSettings.GetInstallDir(): string;
86
86
// If dir, returns False.
87
87
if ( FileExists( result ) ) then
88
88
begin
89
- result := ExtractFilePath( result );
89
+ // Ask user confirmation
90
+ if MessageDlg( ' 확인' , ' 다음 제로아워 경로가를 사용하겠습니까?:' + sLineBreak + result,
91
+ mtConfirmation, [mbYes, mbNo],0 ) = mrYes
92
+ then
93
+ begin
94
+ result := ExtractFilePath( result );
95
+ exit;
96
+ end
97
+ else
98
+ result := ' ' ; // forget what we got
90
99
end ;
91
100
92
101
// Still, we might have failed to find Generals.
93
- // Then, let the user decide.
94
- if ( result = ' ' ) then
95
- begin
96
- try
97
- diag := TOpenDialog.create( nil );
98
- diag.Options := [ofFileMustExist];
99
- diag.Filter := ' Exe파일|*.exe' ;
100
- if diag.Execute then
101
- begin
102
- filename := diag.Filename;
103
- result := ExtractFilePath( filename );
104
- end ;
105
- finally
106
- diag.free;
102
+ // Then, let the user find int.
103
+ try
104
+ diag := TOpenDialog.create( nil );
105
+ diag.Options := [ofFileMustExist];
106
+ diag.Filter := ' Exe파일|*.exe' ;
107
+ if diag.Execute then
108
+ begin
109
+ filename := diag.Filename;
110
+ result := ExtractFilePath( filename );
107
111
end ;
108
- end ;
112
+ finally
113
+ diag.free;
114
+ end ;
109
115
end ;
110
116
111
117
procedure TSettings.SetGameDir (AValue: string);
0 commit comments