Changeset 386 for trunk/LocalPlayer


Ignore:
Timestamp:
Apr 27, 2021, 6:48:47 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Remove new key binding from other actions. So one shortcut can control one action.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/UKeyBindings.pas

    r385 r386  
    3737    procedure Assign(Source: TKeyBindings);
    3838    procedure ResetToDefault;
     39    procedure RemoveShortCut(ShortCut: TShortCut);
    3940  end;
    4041
     
    271272  for I := 0 to Count - 1 do
    272273    Items[I].SetDefault;
     274end;
     275
     276procedure TKeyBindings.RemoveShortCut(ShortCut: TShortCut);
     277var
     278  I: Integer;
     279begin
     280  for I := 0 to Count - 1 do begin
     281    if Items[I].ShortCut = ShortCut then Items[I].ShortCut := 0;
     282    if Items[I].ShortCut2 = ShortCut then Items[I].ShortCut2 := 0;
     283  end;
    273284end;
    274285
Note: See TracChangeset for help on using the changeset viewer.