Changeset 273 for trunk/UClientGUI.pas
- Timestamp:
- Jan 30, 2019, 8:08:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UClientGUI.pas
r270 r273 49 49 public 50 50 View: TView; 51 ShowCellGrid: Boolean; 51 CellGridVisible: Boolean; 52 UnitShapeVisible: Boolean; 52 53 procedure DrawArrow(Canvas: TCanvas; Pos: TPoint; Angle: Double; 53 54 Text: string; View: TView); … … 110 111 Points: array of Classes.TPoint; 111 112 TextSize: TSize; 113 R: Integer; 112 114 begin 113 115 if Cell.MapCell.Extra = etObjectiveTarget then begin … … 118 120 //Pen.Style := psClear; 119 121 Pen.Style := psSolid; 120 if ShowCellGridthen begin122 if CellGridVisible then begin 121 123 Pen.Color := clBlack; 122 124 Pen.Width := Round(2 * View.Zoom); … … 144 146 Round(TextPos.Y) - TextSize.cy div 2, Text, False); 145 147 end; 148 if UnitShapeVisible and Assigned(Cell.MapCell.OneUnit) then begin 149 TextPos := View.CellToCanvasPos(Pos); 150 R := Trunc(70 * View.Zoom); 151 Pen.Color := clWhite; 152 Pen.Style := psSolid; 153 Pen.Width := Round(10 * View.Zoom); 154 Brush.Style := bsClear; 155 TCanvasEx.Ellipse(Canvas, TRect.Create( 156 TPoint.Create(TextPos.X - R, TextPos.Y - R), 157 TPoint.Create(TextPos.X + R, TextPos.Y + R) 158 )); 159 end; 146 160 end; 147 161 end; … … 154 168 Points: array of Classes.TPoint; 155 169 TextSize: TSize; 170 R: Integer; 156 171 begin 157 172 if Cell.Extra = etObjectiveTarget then begin … … 188 203 189 204 // Show cell text 190 if (Cell.OneUnit.Power <> 0) or (Cell.Extra = etObjectiveTarget) then begin 205 if Assigned(Cell.OneUnit) and (Cell.OneUnit.Power <> 0) or 206 (Cell.Extra = etObjectiveTarget) then begin 191 207 Pen.Style := psSolid; 192 208 Font.Color := clWhite; … … 197 213 TCanvasEx.TextOutEx(Canvas, Round(TextPos.X) - TextSize.cx div 2, 198 214 Round(TextPos.Y) - TextSize.cy div 2, Text, False); 215 end; 216 if UnitShapeVisible and Assigned(Cell.OneUnit) then begin 217 TextPos := View.CellToCanvasPos(Pos); 218 R := Trunc(70 * View.Zoom); 219 Pen.Color := clWhite; 220 Pen.Style := psSolid; 221 Pen.Width := Round(10 * View.Zoom); 222 Brush.Style := bsClear; 223 TCanvasEx.Ellipse(Canvas, TRect.Create( 224 TPoint.Create(TextPos.X - R, TextPos.Y - R), 225 TPoint.Create(TextPos.X + R, TextPos.Y + R) 226 )); 199 227 end; 200 228 end;
Note:
See TracChangeset
for help on using the changeset viewer.