Changeset 418 for trunk/LocalPlayer/UKeyBindings.pas
- Timestamp:
- Nov 17, 2021, 11:31:18 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/UKeyBindings.pas
r387 r418 38 38 procedure ResetToDefault; 39 39 procedure RemoveShortCut(ShortCut: TShortCut); 40 procedure SortAlpha; 40 41 end; 41 42 … … 241 242 Text: string; 242 243 begin 243 Strings.Clear; 244 for I := 0 to Count - 1 do begin 245 Text:= ''; 246 if Items[I].ShortCut <> 0 then 247 Text:= Text + ShortCutToText(Items[I].ShortCut); 248 if Items[I].ShortCut2 <> 0 then begin 249 if Text <> '' then Text := Text + ', '; 250 Text:= Text + ShortCutToText(Items[I].ShortCut2); 244 Strings.BeginUpdate; 245 try 246 Strings.Clear; 247 for I := 0 to Count - 1 do begin 248 Text := ''; 249 if Items[I].ShortCut <> 0 then 250 Text := Text + ShortCutToText(Items[I].ShortCut); 251 if Items[I].ShortCut2 <> 0 then begin 252 if Text <> '' then Text := Text + ', '; 253 Text := Text + ShortCutToText(Items[I].ShortCut2); 254 end; 255 if Text <> '' then Text := Items[I].FullName + ' (' + Text + ')' 256 else Text := Items[I].FullName; 257 Strings.Add(Text); 251 258 end; 252 if Text <> '' then Text := Items[I].FullName + ' (' + Text + ')' 253 else Text := Items[I].FullName; 254 Strings.Add(Text); 259 finally 260 Strings.EndUpdate; 255 261 end; 256 262 end; … … 284 290 if Items[I].ShortCut2 = ShortCut then Items[I].ShortCut2 := 0; 285 291 end; 292 end; 293 294 function CompareAlpha(const Item1, Item2: TKeyBinding): Integer; 295 begin 296 Result := CompareStr(Item1.FullName, Item2.FullName); 297 end; 298 299 procedure TKeyBindings.SortAlpha; 300 begin 301 Sort(CompareAlpha); 286 302 end; 287 303 … … 372 388 BMoveLeftUp := AddItem('MoveLeftUp', 'Move unit left-up', 'Num7', 'Home'); 373 389 BMoveLeft := AddItem('MoveLeft', 'Move unit left', 'Num4', 'Left'); 390 SortAlpha; 374 391 end; 375 392
Note:
See TracChangeset
for help on using the changeset viewer.