Changeset 13 for trunk/OnlinePlayers.pas
- Timestamp:
- Nov 27, 2009, 8:36:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/OnlinePlayers.pas
r7 r13 79 79 FriendSoundFile: string; 80 80 LockOnlineAddres: Boolean = True; 81 LockAddres: string = 'http://wow.zdechov.net/stat/stat.xml';81 LockAddres: string = HoFOnlineListURL; 82 82 83 83 ColumnIndexSoft: integer = 0; … … 186 186 StateIndex := StrToInt(sRace) - 1; 187 187 end; 188 // zjišťování přátel a zobrazení188 // Zjišťování přátel a zobrazení 189 189 for i:=0 to length(Friends) - 1 do begin 190 190 if GetLowerString(sName) = GetLowerString(Friends[i]) then begin … … 203 203 until ANode = nil; 204 204 205 Label1.Caption := IntToStr(ListView1.Items.Count +1);205 Label1.Caption := IntToStr(ListView1.Items.Count + 1); 206 206 if LockOnlineAddres then begin 207 207 Form1.CoolTrayIcon1.Hint := IntToStr(ListView1.Items.Count + 1)+' hráčů'; … … 229 229 230 230 231 // zjišťovánízda se připojil nový přítel232 if FirstDownload = false then begin231 // Zjišťování, zda se připojil nový přítel 232 if FirstDownload = False then begin 233 233 if ListView2.Items.Count > length(OldOnlineFriend) then begin 234 234 if BeepAfterNewFriend then … … 255 255 var 256 256 reg: TRegistry; 257 i, count: integer;257 i, Count: integer; 258 258 begin 259 259 Reg := TRegistry.Create; 260 260 try 261 // načítání pozice formuláře262 if Reg.OpenKey(R +'FormOnlinePlayers', False) then begin261 // Načítání pozice formuláře 262 if Reg.OpenKey(R + 'FormOnlinePlayers', False) then begin 263 263 Top := Reg.ReadInteger('Top'); 264 264 Left := Reg.ReadInteger('Left'); … … 292 292 end; 293 293 294 if Reg.OpenKey(R +'Friends', False) then begin295 count := Reg.ReadInteger('Count');296 SetLength(Friends, count);297 for i:=0 to count-1 do begin298 Friends[i] := Reg.ReadString('Friend' +IntToStr(i));294 if Reg.OpenKey(R + 'Friends', False) then begin 295 Count := Reg.ReadInteger('Count'); 296 SetLength(Friends, Count); 297 for i:=0 to Count - 1 do begin 298 Friends[i] := Reg.ReadString('Friend' + IntToStr(i)); 299 299 end; 300 300 end; … … 391 391 case ColumnIndexSoft of 392 392 1:begin 393 if StrToInt(ListView1.Items[0].SubItems[0]) > StrToInt(ListView1.Items[ListView1.Items.count -1].SubItems[0]) then394 Compare := -OrderNumber(Item1, Item2, Compare)393 if StrToInt(ListView1.Items[0].SubItems[0]) > StrToInt(ListView1.Items[ListView1.Items.count - 1].SubItems[0]) then 394 Compare := -OrderNumber(Item1, Item2, Compare) 395 395 else 396 Compare := OrderNumber(Item1, Item2, Compare);396 Compare := OrderNumber(Item1, Item2, Compare); 397 397 end; 398 398 2:begin 399 if AnsiCompareText(ListView1.Items[0].SubItems[1], ListView1.Items[ListView1.Items.count -1].SubItems[1]) = -1 then400 Compare := OrderMap(Item1, Item2, Compare)399 if AnsiCompareText(ListView1.Items[0].SubItems[1], ListView1.Items[ListView1.Items.count - 1].SubItems[1]) = -1 then 400 Compare := OrderMap(Item1, Item2, Compare) 401 401 else 402 Compare := -OrderMap(Item1, Item2, Compare);402 Compare := -OrderMap(Item1, Item2, Compare); 403 403 end; 404 404 3:begin 405 if AnsiCompareText(ListView1.Items[0].SubItems[2], ListView1.Items[ListView1.Items.count -1].SubItems[2]) = -1 then406 Compare := OrderZone(Item1, Item2, Compare)405 if AnsiCompareText(ListView1.Items[0].SubItems[2], ListView1.Items[ListView1.Items.count - 1].SubItems[2]) = -1 then 406 Compare := OrderZone(Item1, Item2, Compare) 407 407 else 408 Compare := -OrderZone(Item1, Item2, Compare);408 Compare := -OrderZone(Item1, Item2, Compare); 409 409 end; 410 410 else 411 411 if AnsiCompareText(ListView1.Items[0].Caption, ListView1.Items[ListView1.Items.count-1].Caption) = -1 then 412 Compare := Order(Item1, Item2, Compare)412 Compare := Order(Item1, Item2, Compare) 413 413 else 414 Compare := -Order(Item1, Item2, Compare);414 Compare := -Order(Item1, Item2, Compare); 415 415 end; 416 416 end; … … 784 784 if Assigned(ListView1.Selected) then begin 785 785 if IsStringInArray(ListView1.Selected.Caption,Friends) then begin 786 SetLength(Friends,length(Friends) +1);787 Friends[length(Friends) -1] := ListView1.Selected.Caption;786 SetLength(Friends,length(Friends) + 1); 787 Friends[length(Friends) - 1] := ListView1.Selected.Caption; 788 788 with ListView2.Items.Add do begin 789 789 Caption := ListView1.Selected.Caption; … … 812 812 if DragDown then begin 813 813 GetCursorPos(Position); 814 if Position. y-Top-Panel2.Height < Height-38 then815 Panel2.Top := Position.Y -Top-Panel2.Height-16814 if Position.Y - Top - Panel2.Height < Height - 38 then 815 Panel2.Top := Position.Y - Top - Panel2.Height - 16 816 816 else 817 Panel2.Top := Height -35;817 Panel2.Top := Height - 35; 818 818 DrawForm; 819 819 end; … … 828 828 procedure TForm5.DrawForm; 829 829 begin 830 ListView1.Height := Panel2.Top -20;831 ListView2.Top := Panel2.Top +Panel2.Height;832 ListView2.Height := Height -Panel2.Top-Panel2.Height-20;830 ListView1.Height := Panel2.Top - 20; 831 ListView2.Top := Panel2.Top + Panel2.Height; 832 ListView2.Height := Height - Panel2.Top - Panel2.Height - 20; 833 833 834 834 end; … … 841 841 begin 842 842 NewFriend := True; 843 for i :=0 to length(ArrayOfString)-1 do begin843 for i := 0 to length(ArrayOfString) - 1 do begin 844 844 if (GetLowerString(Find) = GetLowerString(ArrayOfString[i])) then 845 NewFriend := false;845 NewFriend := False; 846 846 end; 847 847 … … 884 884 YetWas := False; 885 885 if Assigned(ListView2.Selected) then begin 886 for i :=0 to High(Friends) do begin886 for i := 0 to High(Friends) do begin 887 887 if YetWas then 888 Friends[i -1] := Friends[i];888 Friends[i - 1] := Friends[i]; 889 889 890 890 if (GetLowerString(Friends[i]) = GetLowerString(ListView2.Selected.Caption)) then 891 891 YetWas := true; 892 892 end; 893 SetLength(Friends, Length(Friends)-1);893 SetLength(Friends, Length(Friends) - 1); 894 894 ListView2.Selected.Delete; 895 895 end; … … 901 901 MousePos: TPoint; 902 902 begin 903 if Assigned(ListView2.GetItemAt(x, y)) and (Button = mbRight) then begin903 if Assigned(ListView2.GetItemAt(x, y)) and (Button = mbRight) then begin 904 904 GetCursorPos(MousePos); 905 PopupMenu3.Popup(MousePos.X, MousePos.y);905 PopupMenu3.Popup(MousePos.X, MousePos.y); 906 906 end; 907 907 end;
Note:
See TracChangeset
for help on using the changeset viewer.