Changeset 418
- Timestamp:
- Nov 17, 2021, 11:31:18 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 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 -
trunk/Packages/Common/UTranslator.pas
r416 r418 316 316 begin 317 317 with Strings do begin 318 Clear; 319 for I := 0 to Languages.Count - 1 do 320 with TLanguage(Languages[I]) do 321 if Available then begin 322 ItemName := Name; 323 if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')'; 324 AddObject(ItemName, Languages[I]); 325 end; 318 BeginUpdate; 319 try 320 Clear; 321 for I := 0 to Languages.Count - 1 do 322 with Languages[I] do 323 if Available then begin 324 ItemName := Name; 325 if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')'; 326 AddObject(ItemName, Languages[I]); 327 end; 328 finally 329 EndUpdate; 330 end; 326 331 end; 327 332 end; … … 375 380 376 381 for I := 1 to Languages.Count - 1 do 377 with TLanguage(Languages[I])do begin382 with Languages[I] do begin 378 383 Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 379 384 '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');
Note:
See TracChangeset
for help on using the changeset viewer.