- Timestamp:
- Feb 9, 2014, 9:53:30 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UFormMain.lfm
r5 r6 37 37 Action = AGameEnd 38 38 end 39 object MenuItem7: TMenuItem 40 Action = AGameRestart 41 end 39 42 object MenuItem4: TMenuItem 40 43 Action = AGameEndTurn … … 65 68 Caption = 'End turn' 66 69 end 70 object AGameRestart: TAction 71 Caption = 'Restart' 72 end 67 73 end 68 74 end -
trunk/UFormMain.pas
r5 r6 17 17 18 18 TFormMain = class(TForm) 19 AGameRestart: TAction; 19 20 AGameEndTurn: TAction; 20 21 AGameEnd: TAction; … … 29 30 MenuItem5: TMenuItem; 30 31 MenuItem6: TMenuItem; 32 MenuItem7: TMenuItem; 31 33 PaintBox1: TPaintBox; 32 34 procedure AExitExecute(Sender: TObject); … … 61 63 implementation 62 64 65 uses 66 UFormNew; 67 63 68 {$R *.lfm} 64 69 … … 86 91 procedure TFormMain.AGameNewExecute(Sender: TObject); 87 92 begin 88 Game.New; 89 PaintBox1.Repaint; 93 FormNew.Load(Game); 94 if FormNew.ShowModal = mrOk then begin 95 FormNew.Save(Game); 96 Game.New; 97 PaintBox1.Repaint; 98 end; 90 99 end; 91 100 … … 103 112 Shift: TShiftState; X, Y: Integer); 104 113 begin 105 StartMousePoint := Point(X, Y); 106 StartViewPoint := Point(TPlayer(Game.Players[0]).View.Left, TPlayer(Game.Players[0]).View.Top); 107 MoveActive := True; 114 if Button = mbLeft then begin 115 StartMousePoint := Point(X, Y); 116 StartViewPoint := Point(TPlayer(Game.Players[0]).View.Left, TPlayer(Game.Players[0]).View.Top); 117 MoveActive := True; 118 end; 108 119 end; 109 120 … … 121 132 TPlayer(Game.Players[0]).View.Right - TPlayer(Game.Players[0]).View.Left, 122 133 TPlayer(Game.Players[0]).View.Bottom - TPlayer(Game.Players[0]).View.Top); 134 TPlayer(Game.Players[0]).SelectCell(Point(X, Y)); 123 135 PaintBox1.Repaint; 124 136 end; 125 Caption := IntToStr(TPlayer(Game.Players[0]).View.Right - TPlayer(Game.Players[0]).View.Left);126 137 end; 127 138 -
trunk/UGame.pas
r5 r6 46 46 Color: TColor; 47 47 ViewZoom: Double; 48 SelectedCell: TPoint; 49 procedure SelectCell(Pos: TPoint); 48 50 procedure Paint(PaintBox: TPaintBox); 49 51 constructor Create; … … 55 57 Players: TObjectList; 56 58 Map: TMap; 59 VoidEnabled: Boolean; 57 60 constructor Create; 58 61 destructor Destroy; override; … … 78 81 79 82 { TPlayer } 83 84 procedure TPlayer.SelectCell(Pos: TPoint); 85 begin 86 87 end; 80 88 81 89 procedure TPlayer.Paint(PaintBox: TPaintBox); … … 128 136 for X := 0 to Length(Map.Cells[0]) - 1 do 129 137 with Map.Cells[Y, X] do begin 130 if Random(2) = 0then Terrain := ttVoid138 if VoidEnabled and (Random(2) = 0) then Terrain := ttVoid 131 139 else Terrain := ttNormal; 132 140 Power := Random(4); -
trunk/xtactics.lpi
r3 r6 33 33 </Item1> 34 34 </RequiredPackages> 35 <Units Count=" 3">35 <Units Count="4"> 36 36 <Unit0> 37 37 <Filename Value="xtactics.lpr"/> … … 52 52 <UnitName Value="UGame"/> 53 53 </Unit2> 54 <Unit3> 55 <Filename Value="UFormNew.pas"/> 56 <IsPartOfProject Value="True"/> 57 <ComponentName Value="FormNew"/> 58 <ResourceBaseClass Value="Form"/> 59 <UnitName Value="UFormNew"/> 60 </Unit3> 54 61 </Units> 55 62 </ProjectOptions> -
trunk/xtactics.lpr
r2 r6 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UGame 10 Forms, UFormMain, UGame, UFormNew 11 11 { you can add units after this }; 12 12 … … 17 17 Application.Initialize; 18 18 Application.CreateForm(TFormMain, FormMain); 19 Application.CreateForm(TFormNew, FormNew); 19 20 Application.Run; 20 21 end.
Note:
See TracChangeset
for help on using the changeset viewer.