Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r82 r83 225 225 if OpenDialog1.Execute then begin 226 226 Game.LoadFromFile(OpenDialog1.FileName); 227 Player := Game.Players.GetFirstHuman; 227 228 LastMapFileName := OpenDialog1.FileName; 228 229 with Core.Game.CurrentPlayer do -
trunk/UGame.pas
r82 r83 211 211 212 212 TPlayerCells = class(TObjectList) 213 213 function SearchCell(Cell: TCell): TPlayerCell; 214 214 end; 215 215 … … 480 480 end; 481 481 482 { TPlayerCells } 483 484 function TPlayerCells.SearchCell(Cell: TCell): TPlayerCell; 485 var 486 I: Integer; 487 begin 488 I := 0; 489 while (I < Count) and (TPlayerCell(Items[I]).MapCell <> Cell) do Inc(I); 490 if I < Count then Result := TPlayerCell(Items[I]) 491 else Result := nil; 492 end; 493 482 494 { TPlayerMap } 483 495 … … 554 566 else if Player.Game.FogOfWar then begin 555 567 if Cell.InVisibleRange then begin 556 if not Cell.Explored then begin 557 Brush.Color := HalfColor(Cell.MapCell.GetColor); 568 Brush.Color := Cell.MapCell.GetColor; 569 end else begin 570 if Cell.Explored then begin 571 Brush.Color := $404040; 558 572 CellText := ''; 559 end else Brush.Color := Cell.MapCell.GetColor560 end else begin561 Brush.Color := clBlack;562 CellText := '';573 end else begin 574 Brush.Color := clBlack; 575 CellText := ''; 576 end; 563 577 end; 564 578 end else Brush.Color := Cell.MapCell.GetColor; … … 577 591 PosFrom := Player.Game.Map.CellToPos(Move.CellFrom); 578 592 PosTo := Player.Game.Map.CellToPos(Move.CellTo); 593 // In Fog of war mode show only 594 if Game.FogOfWar and not Cells.SearchCell(Move.CellFrom).InVisibleRange and 595 not Cells.SearchCell(Move.CellTo).InVisibleRange then 596 Continue; 579 597 if Move.CountRepeat > 0 then Pen.Width := 2 580 598 else Pen.Width := 1; … … 2186 2204 var 2187 2205 NewNode: TDOMNode; 2188 Value: Integer;2189 2206 Doc: TXMLDocument; 2190 Dump: TStringList;2191 2207 RootNode: TDOMNode; 2208 I: Integer; 2192 2209 begin 2193 2210 Self.FileName := FileName; … … 2226 2243 2227 2244 Map.Cells.FixRefId; 2245 2246 for I := 0 to Players.Count - 1 do begin 2247 TPlayer(Players[I]).PlayerMap.Update; 2248 TPlayer(Players[I]).PlayerMap.CheckVisibility; 2249 end; 2228 2250 end; 2229 2251 finally … … 2235 2257 var 2236 2258 NewNode: TDOMNode; 2237 NewNode2: TDOMNode;2238 2259 Doc: TXMLDocument; 2239 2260 RootNode: TDOMNode; … … 2322 2343 Map.Grow(CurrentPlayer); 2323 2344 UpdateRepeatMoves(CurrentPlayer); 2324 CurrentPlayer.PlayerMap.CheckVisibility;2325 2345 ComputePlayerStats; 2326 2346 PrevPlayer := CurrentPlayer; … … 2335 2355 end; 2336 2356 CheckWinObjective; 2357 CurrentPlayer.PlayerMap.CheckVisibility; 2337 2358 // For computers take view from previous human 2338 2359 //if CurrentPlayer.Mode = pmComputer then CurrentPlayer.View.Assign(PrevPlayer.View);
Note:
See TracChangeset
for help on using the changeset viewer.