unit mainform;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm1 =
class(TForm)
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
Btn_setrealmlist: TButton;
Image1: TImage;
btn_srartwowundenderlc: TButton;
procedure INI_Read;
procedure Btn_setrealmlistClick(Sender: TObject);
procedure btn_srartwowundenderlcClick(Sender: TObject);
procedure formcreate(sender:tobject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
server1path,server2path,server3path,server4path:
string;
implementation
uses Math, IniFiles;
{$R *.dfm}
procedure TForm1.INI_Read;
var
Ini: TIniFile;
begin
Ini:=TIniFile.Create((ExtractFilePath(paramstr(0))+'
\serverlist.ini');
RadioButton1.Caption:=Ini.ReadString('
Server1','
name','
');
RadioButton2.Caption:=Ini.ReadString('
Server2','
name','
');
RadioButton3.Caption:=Ini.ReadString('
Server3','
name','
');
RadioButton4.Caption:=Ini.ReadString('
Server4','
name','
');
server1path:=Ini.ReadString('
Server1','
path','
');
server2path:=Ini.ReadString('
Server2','
path','
');
server3path:=Ini.ReadString('
Server3','
path','
');
server4path:=Ini.ReadString('
Server4','
path','
');
if server1path<>'
'
then radiobutton1.show;
if server2path<>'
'
then radiobutton2.show;
if server3path<>'
'
then radiobutton3.show;
if server4path<>'
'
then radiobutton4.show;
Ini.Free;
end;
procedure TForm1.Btn_setrealmlistClick(Sender: TObject);
var
datei: Textfile;
begin
if (RadioButton1.Checked = false)
and
(RadioButton2.Checked = false)
and
(RadioButton3.Checked = false)
and
(RadioButton4.Checked = false)
then
showmessage('
Bitte wähle einen Server')
else
begin
if RadioButton1.Checked = true
then
begin
assignfile(datei, '
realmlist.wtf');
rewrite(datei);
writeln(datei, server1path);
closefile(datei);
end;
if RadioButton2.Checked = true
then
begin
assignfile(datei, '
realmlist.wtf');
rewrite(datei);
writeln(datei, server2path);
closefile(datei);
end;
If RadioButton3.Checked = true
then
begin
assignfile(datei, '
realmlist.wtf');
rewrite(datei);
writeln(datei, server3path);
closefile(datei);
end;
if RadioButton4.Checked = true
then
begin
assignfile(datei, '
realmlist.wtf');
rewrite(datei);
writeln(datei, server4path);
closefile(datei);
end;
end;
end;
procedure TForm1.btn_srartwowundenderlcClick(Sender: TObject);
begin
if FileExists('
wow.exe')= true
then
begin
WinExec('
wow.exe',sw_show);
end
else ShowMessage('
World of Warcraft konnte nicht gestarted werden! Bitte überprüfen sie, ob sich RealmlistChooser in ihrem World of Warcraft Installations-Ordner befindet.');
end;
procedure Tform1.formcreate(sender:Tobject);
begin
ini_read;
end;
end.