-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuchen_Ersetzen.pas
100 lines (90 loc) · 2.98 KB
/
Suchen_Ersetzen.pas
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
unit Suchen_Ersetzen;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Gauges, StdCtrls, OGame_Types, Prog_Unit;
type
TFRM_Suchen_Ersetzen = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Gauge1: TGauge;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
FRM_Suchen_Ersetzen: TFRM_Suchen_Ersetzen;
implementation
uses Notizen, Languages, cS_DB;
{$R *.DFM}
procedure TFRM_Suchen_Ersetzen.Button1Click(Sender: TObject);
{var i, j: integer;
nsuche, nersetzen: string;
s: boolean;}
begin
showmessage('this function is deaktivated! TODO: Implement');
{nsuche := Edit1.Text;
nersetzen := Edit2.Text;
if (nsuche <> '')and(nersetzen <> '') then
with ODataBase do
begin
Gauge1.MaxValue := Systeme.Count + Berichte.Count + length(GlobalPlayerInfo) + FRM_Notizen.VST_Notizen.RootNodeCount;
Gauge1.Progress := 0;
for i := 0 to Systeme.Count-1 do //Sonnensysteme
begin
s := false;
for j := 1 to max_Planeten do
if Systeme[i].Planeten[j].Player = nsuche then
begin
s := true;
Systeme[i].Planeten[j].Player := nersetzen;
end;
if s then
SaveSys(i);
Gauge1.Progress := Gauge1.Progress +1;
end;
for i := 0 to length(Berichte)-1 do //Scanberichte
begin
if Berichte[i].Head.Spieler = nsuche then
begin
Berichte[i].Head.Spieler := nersetzen;
SaveScan(i);
end;
Gauge1.Progress := Gauge1.Progress +1;
end;
for i := 0 to length(GlobalPlayerInfo)-1 do //neueste Forschungen der Spieler
begin
if GlobalPlayerInfo[i].Name = nsuche then
begin
GlobalPlayerInfo[i].Name := nersetzen;
for j := i+1 to length(GlobalPlayerInfo)-1 do
if GlobalPlayerInfo[j].Name = nersetzen then
begin
if GlobalPlayerInfo[i].ForschungsAktualitaet_u > GlobalPlayerInfo[j].ForschungsAktualitaet_u then
GlobalPlayerInfo[i].Name := '------leer------'
else GlobalPlayerInfo[j].Name := '------leer------'; //des stimmt schon! (für alle dies net checken!)
end;
Break;
Gauge1.Progress := Gauge1.Progress + (length(GlobalPlayerInfo)-i);
end;
Gauge1.Progress := Gauge1.Progress +1;
end;
FRM_Notizen.ReplacePlayername(nsuche,nersetzen);
Gauge1.Progress := Gauge1.Progress + FRM_Notizen.VST_Notizen.RootNodeCount;
end
else
ShowMessage(STR_alles_ausfuellen); }
end;
procedure TFRM_Suchen_Ersetzen.FormCreate(Sender: TObject);
begin
if SaveCaptions then SaveAllCaptions(Self,LangFile);
if LoadCaptions then LoadAllCaptions(Self,LangFile);
end;
end.