Changeset 29 for trunk/Forms/UFormMain.pas
- Timestamp:
- Oct 6, 2019, 9:53:39 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r28 r29 18 18 MenuItem2: TMenuItem; 19 19 MenuItem3: TMenuItem; 20 MenuItem4: TMenuItem; 21 MenuItemTools: TMenuItem; 20 22 MenuItemNew: TMenuItem; 21 23 MenuItemExit: TMenuItem; … … 35 37 public 36 38 procedure Redraw; 39 procedure UpdateInterface; 37 40 end; 38 41 … … 53 56 if Core.Game.Running and not Core.Game.Moving then begin 54 57 case Key of 55 37: Core.Game.MoveAll (drLeft);56 38: Core.Game.MoveAll (drUp);57 39: Core.Game.MoveAll (drRight);58 40: Core.Game.MoveAll (drDown);58 37: Core.Game.MoveAllAndUpdate(drLeft); 59 38: Core.Game.MoveAllAndUpdate(drUp); 60 39: Core.Game.MoveAllAndUpdate(drRight); 61 40: Core.Game.MoveAllAndUpdate(drDown); 59 62 end; 60 63 end; … … 85 88 if not Core.Game.Running then 86 89 Core.Game.New; 90 UpdateInterface; 87 91 end; 88 92 … … 100 104 end; 101 105 106 procedure TFormMain.UpdateInterface; 107 var 108 I: Integer; 109 ToolsVisible: Boolean; 110 begin 111 ToolsVisible := False; 112 for I := 0 to MenuItemTools.Count - 1 do 113 if MenuItemTools.Items[I].Enabled then begin 114 ToolsVisible := True; 115 Break; 116 end; 117 MenuItemTools.Visible := ToolsVisible; 118 end; 119 102 120 end. 103 121
Note:
See TracChangeset
for help on using the changeset viewer.