Changeset 460 for trunk/LocalPlayer/Term.pas
- Timestamp:
- Nov 28, 2023, 3:16:24 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r457 r460 14 14 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types, 15 15 Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area, 16 GraphicSet, MiniMap, IsoEngine; 16 GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType, 17 Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx, 18 Help; 17 19 18 20 const … … 324 326 NoMap: TIsoMap; 325 327 NoMapPanel: TIsoMap; 328 // Forms 329 FWondersDlg: TWondersDlg; 330 FTechTreeDlg: TTechTreeDlg; 331 FEnhanceDlg: TEnhanceDlg; 332 FNegoDlg: TNegoDlg; 333 FCityTypeDlg: TCityTypeDlg; 334 FDiaDlg: TDiaDlg; 335 FCityDlg: TCityDlg; 336 FRatesDlg: TRatesDlg; 337 FBattleDlg: TBattleDlg; 338 FNatStatDlg: TNatStatDlg; 339 FUnitStatDlg: TUnitStatDlg; 340 FDraftDlg: TDraftDlg; 341 FModalSelectDlg: TModalSelectDlg; 342 FListDlg: TListDlg; 343 FMessgExDlg: TMessgExDlg; 344 FHelpDlg: THelpDlg; 345 procedure ArrangeDialogs; 346 procedure ArrangeDialog(Form: TBufferedDrawDlg); 326 347 function ChooseUnusedTribe: Integer; 327 348 function DoJob(j0: Integer): Integer; 349 function GetBattleDlg: TBattleDlg; 350 function GetCityDlg: TCityDlg; 351 function GetCityTypeDlg: TCityTypeDlg; 352 function GetDiaDlg: TDiaDlg; 353 function GetDraftDlg: TDraftDlg; 354 function GetEnhanceDlg: TEnhanceDlg; 355 function GetHelpDlg: THelpDlg; 356 function GetListDlg: TListDlg; 357 function GetMessgExDlg: TMessgExDlg; 358 function GetModalSelectDlg: TModalSelectDlg; 359 function GetNatStatDlg: TNatStatDlg; 360 function GetNegoDlg: TNegoDlg; 361 function GetRatesDlg: TRatesDlg; 362 function GetTechTreeDlg: TTechTreeDlg; 328 363 procedure GetTribeList; 364 function GetUnitStatDlg: TUnitStatDlg; 365 function GetWondersDlg: TWondersDlg; 329 366 procedure InitModule; 330 367 procedure DoneModule; … … 397 434 procedure UpdateViews(UpdateCityScreen: Boolean = False); 398 435 function ContactRefused(P: Integer; Item: String): Boolean; 436 // Forms 437 property WondersDlg: TWondersDlg read GetWondersDlg; 438 property TechTreeDlg: TTechTreeDlg read GetTechTreeDlg; 439 property EnhanceDlg: TEnhanceDlg read GetEnhanceDlg; 440 property NegoDlg: TNegoDlg read GetNegoDlg; 441 property CityTypeDlg: TCityTypeDlg read GetCityTypeDlg; 442 property DiaDlg: TDiaDlg read GetDiaDlg; 443 property CityDlg: TCityDlg read GetCityDlg; 444 property RatesDlg: TRatesDlg read GetRatesDlg; 445 property BattleDlg: TBattleDlg read GetBattleDlg; 446 property NatStatDlg: TNatStatDlg read GetNatStatDlg; 447 property UnitStatDlg: TUnitStatDlg read GetUnitStatDlg; 448 property DraftDlg: TDraftDlg read GetDraftDlg; 449 property ModalSelectDlg: TModalSelectDlg read GetModalSelectDlg; 450 property ListDlg: TListDlg read GetListDlg; 451 property MessgExDlg: TMessgExDlg read GetMessgExDlg; 452 property HelpDlg: THelpDlg read GetHelpDlg; 399 453 end; 400 454 … … 428 482 end; 429 483 430 TPriceSet = set of $00 .. $FF;431 484 TFormAction = (faClose, faEnable, faDisable, faUpdate, faSmartUpdateContent); 432 485 … … 579 632 function InitEnemyModel(emix: Integer): Boolean; 580 633 procedure InitAllEnemyModels; 581 procedure InitMyModel( mix: Integer; final: Boolean);634 procedure InitMyModel(Mix: Integer; Final: Boolean); 582 635 583 636 procedure ImpImage(ca: TCanvas; X, Y, iix: Integer; Government: Integer = -1; … … 590 643 591 644 uses 592 Directories, CityScreen, Draft, MessgEx, Select, CityType, Help, 593 UnitStat, Log, Diagram, NatStat, Wonders, Enhance, Nego, PixelPointer, Sound, 594 Battle, Rates, TechTree, Registry, Global, KeyBindings, CmdList; 645 Directories, Log, PixelPointer, Sound, Registry, Global, KeyBindings, CmdList; 595 646 596 647 {$R *.lfm} … … 762 813 begin 763 814 if MyMap[Loc] and fDeadLands <> 0 then 764 HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12)815 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 3 * 12) 765 816 else if (MyMap[Loc] and fTerrain = fForest) and IsJungle(Loc div G.lx) then 766 HelpDlg.ShowNewContent(NewMode, hkTer,817 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, 767 818 fJungle + (MyMap[Loc] shr 5 and 3) * 12) 768 819 else 769 HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain +820 MainScreen.HelpDlg.ShowNewContent(NewMode, hkTer, MyMap[Loc] and fTerrain + 770 821 (MyMap[Loc] shr 5 and 3) * 12); 771 822 end; … … 864 915 end; 865 916 866 procedure InitMyModel( mix: Integer; final: Boolean);917 procedure InitMyModel(Mix: Integer; Final: Boolean); 867 918 var 868 919 mi: TModelInfo; … … 871 922 Exit; 872 923 // don't exit for special units because cSetModelPicture comes after TellNewModels 873 MakeModelInfo(Me, mix, MyModel[mix], mi);874 ChooseModelPicture(Me, mix, ModelCode(mi), ModelHash(mi), MyRO.Turn,875 False, final);924 MakeModelInfo(Me, Mix, MyModel[mix], mi); 925 ChooseModelPicture(Me, Mix, ModelCode(mi), ModelHash(mi), MyRO.Turn, 926 False, Final); 876 927 end; 877 928 … … 953 1004 InitMyModel(MyData.ToldModels, True); 954 1005 { only run if no researched model } 955 with M essgExDlg do1006 with MainScreen.MessgExDlg do 956 1007 begin 957 1008 { MakeModelInfo(me,MyData.ToldModels,MyModel[MyData.ToldModels],mi); … … 1157 1208 { research complete -- select new } 1158 1209 repeat 1159 M odalSelectDlg.ShowNewContent(wmModal, kAdvance);1160 if M odalSelectDlg.Result < 0 then1210 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kAdvance); 1211 if MainScreen.ModalSelectDlg.Result < 0 then 1161 1212 begin 1162 1213 Result := False; 1163 1214 Exit; 1164 1215 end; 1165 ChosenResearch := M odalSelectDlg.Result;1216 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1166 1217 if ChosenResearch = adMilitary then 1167 1218 begin 1168 DraftDlg.ShowNewContent(wmModal);1169 if DraftDlg.ModalResult <> mrOK then1219 MainScreen.DraftDlg.ShowNewContent(wmModal); 1220 if MainScreen.DraftDlg.ModalResult <> mrOK then 1170 1221 Tribe[Me].ModelPicture[MyRO.nModel].HGr := nil; 1171 1222 end; 1172 until (ChosenResearch <> adMilitary) or ( DraftDlg.ModalResult = mrOK);1223 until (ChosenResearch <> adMilitary) or (MainScreen.DraftDlg.ModalResult = mrOK); 1173 1224 1174 1225 if ChosenResearch = adMilitary then … … 1176 1227 else if ChosenResearch = adFar then 1177 1228 begin 1178 M odalSelectDlg.ShowNewContent(wmModal, kFarAdvance);1179 if M odalSelectDlg.Result >= 0 then1180 if (M odalSelectDlg.Result = adNone) or1181 (Server(sSetResearch - sExecute, Me, M odalSelectDlg.Result, nil^) <1229 MainScreen.ModalSelectDlg.ShowNewContent(wmModal, kFarAdvance); 1230 if MainScreen.ModalSelectDlg.Result >= 0 then 1231 if (MainScreen.ModalSelectDlg.Result = adNone) or 1232 (Server(sSetResearch - sExecute, Me, MainScreen.ModalSelectDlg.Result, nil^) < 1182 1233 rExecuted) then 1183 MyData.FarTech := M odalSelectDlg.Result1234 MyData.FarTech := MainScreen.ModalSelectDlg.Result 1184 1235 else 1185 1236 begin 1186 ChosenResearch := M odalSelectDlg.Result;1237 ChosenResearch := MainScreen.ModalSelectDlg.Result; 1187 1238 // can be researched immediately 1188 1239 MyData.FarTech := adNone; … … 1194 1245 else 1195 1246 Server(sSetResearch, Me, ChosenResearch, nil^); 1196 ListDlg.TechChange;1247 MainScreen.ListDlg.TechChange; 1197 1248 Result := True; 1198 1249 end; … … 1565 1616 until FindNext(SearchRec) <> 0; 1566 1617 FindClose(SearchRec); 1618 end; 1619 1620 function TMainScreen.GetUnitStatDlg: TUnitStatDlg; 1621 begin 1622 if not Assigned(FUnitStatDlg) then begin 1623 FUnitStatDlg := TUnitStatDlg.Create(nil); 1624 ArrangeDialog(FUnitStatDlg); 1625 FUnitStatDlg.CheckAge; 1626 end; 1627 Result := FUnitStatDlg; 1628 end; 1629 1630 function TMainScreen.GetWondersDlg: TWondersDlg; 1631 begin 1632 if not Assigned(FWondersDlg) then FWondersDlg := TWondersDlg.Create(nil); 1633 Result := FWondersDlg; 1567 1634 end; 1568 1635 … … 1758 1825 FreeAndNil(UnusedTribeFiles); 1759 1826 FreeAndNil(TribeNames); 1760 // AdvisorDlg.DeInit;1761 1827 end; 1762 1828 … … 1866 1932 end; 1867 1933 InitCityMark(MainTexture); 1868 CityDlg.CheckAge;1869 NatStatDlg.CheckAge;1870 UnitStatDlg.CheckAge;1871 HelpDlg.Difficulty := G.Difficulty[Me];1934 if Assigned(FCityDlg) then FCityDlg.CheckAge; 1935 if Assigned(FNatStatDlg) then FNatStatDlg.CheckAge; 1936 if Assigned(FUnitStatDlg) then FUnitStatDlg.CheckAge; 1937 if Assigned(FHelpDlg) then FHelpDlg.Difficulty := G.Difficulty[Me]; 1872 1938 1873 1939 UnFocus := -1; … … 2521 2587 2522 2588 HaveStrategyAdvice := False; 2523 // (GameMode<>cMovie) and not supervising2524 // and AdvisorDlg.HaveStrategyAdvice;2525 2589 GoOnPhase := True; 2526 2590 if Supervising or (GameMode = cMovie) then … … 2628 2692 begin 2629 2693 Server := TInitModuleData(Data).Server; 2630 // AdvisorDlg.Init;2631 2694 InitModule; 2632 2695 TInitModuleData(Data).DataSize := SizeOf(TPersistentData); … … 2642 2705 MainTexture.Age := -1; 2643 2706 Tribes.Init; 2644 HelpDlg.UserLeft := (Screen. width - HelpDlg.width) div 2;2645 HelpDlg.UserTop := (Screen. height - HelpDlg.height) div 2;2707 HelpDlg.UserLeft := (Screen.Width - HelpDlg.Width) div 2; 2708 HelpDlg.UserTop := (Screen.Height - HelpDlg.Height) div 2; 2646 2709 HelpDlg.Difficulty := 0; 2647 2710 if Command = cStartCredits then … … 2654 2717 cNewGame, cLoadGame, cMovie, cNewMap: 2655 2718 begin 2656 { if (Command=cNewGame) or (Command=cLoadGame) then2657 AdvisorDlg.NewGame(Data); }2658 2719 GenerateNames := mNames.Checked; 2659 2720 GameOK := True; … … 2695 2756 begin 2696 2757 CityID := -1; 2697 EffectiveOwner := -1 2758 EffectiveOwner := -1; 2698 2759 end; 2699 2760 FillChar(ToldTech, SizeOf(ToldTech), Byte(tsNA)); … … 2702 2763 end; 2703 2764 2704 // arrange dialogs 2705 ListDlg.UserLeft := 8; 2706 ListDlg.UserTop := TopBarHeight + 8; 2707 HelpDlg.UserLeft := Screen.width - HelpDlg.width - 8; 2708 HelpDlg.UserTop := TopBarHeight + 8; 2709 UnitStatDlg.UserLeft := 397; 2710 UnitStatDlg.UserTop := TopBarHeight + 64; 2711 DiaDlg.UserLeft := (Screen.width - DiaDlg.width) div 2; 2712 DiaDlg.UserTop := (Screen.height - DiaDlg.height) div 2; 2713 NatStatDlg.UserLeft := Screen.width - NatStatDlg.width - 8; 2714 NatStatDlg.UserTop := Screen.height - PanelHeight - 2715 NatStatDlg.height - 8; 2716 if NatStatDlg.UserTop < 8 then 2717 NatStatDlg.UserTop := 8; 2765 ArrangeDialogs; 2718 2766 2719 2767 Age := 0; 2720 2768 MovieSpeed := 1; 2721 2769 LogDlg.mSlot.Visible := True; 2722 LogDlg.Host := self;2723 HelpDlg.ClearHistory;2724 CityDlg.Reset;2770 LogDlg.Host := Self; 2771 if Assigned(FHelpDlg) then FHelpDlg.ClearHistory; 2772 if Assigned(FCityDlg) then FCityDlg.Reset; 2725 2773 2726 2774 MiniMap.Size := Point(G.lx, G.ly); … … 2831 2879 Closable := True; 2832 2880 Close; 2833 { if (GameMode=cNewGame) or (GameMode=cLoadGame) then2834 AdvisorDlg.BreakGame; }2835 2881 end; 2836 2882 … … 2858 2904 begin 2859 2905 StayOnTop_Ensured := True; 2860 CityDlg.StayOnTop_Workaround;2861 CityTypeDlg.StayOnTop_Workaround;2862 DiaDlg.StayOnTop_Workaround;2863 DraftDlg.StayOnTop_Workaround;2864 EnhanceDlg.StayOnTop_Workaround;2865 HelpDlg.StayOnTop_Workaround;2866 NatStatDlg.StayOnTop_Workaround;2867 NegoDlg.StayOnTop_Workaround;2868 ModalSelectDlg.StayOnTop_Workaround;2869 ListDlg.StayOnTop_Workaround;2870 UnitStatDlg.StayOnTop_Workaround;2871 WondersDlg.StayOnTop_Workaround;2872 RatesDlg.StayOnTop_Workaround;2906 //CityDlg.StayOnTop_Workaround; 2907 //CityTypeDlg.StayOnTop_Workaround; 2908 //DiaDlg.StayOnTop_Workaround; 2909 //DraftDlg.StayOnTop_Workaround; 2910 //EnhanceDlg.StayOnTop_Workaround; 2911 //HelpDlg.StayOnTop_Workaround; 2912 //NatStatDlg.StayOnTop_Workaround; 2913 //NegoDlg.StayOnTop_Workaround; 2914 //ModalSelectDlg.StayOnTop_Workaround; 2915 //ListDlg.StayOnTop_Workaround; 2916 //UnitStatDlg.StayOnTop_Workaround; 2917 //WondersDlg.StayOnTop_Workaround; 2918 //RatesDlg.StayOnTop_Workaround; 2873 2919 end; 2874 2920 end; … … 2934 2980 NegoDlg.Visible then 2935 2981 NegoDlg.Close; 2936 skipped := False; // always show my moves during my turn2982 Skipped := False; // always show my moves during my turn 2937 2983 Idle := True; 2938 2984 InitTurn(NewPlayer); … … 2953 2999 pTurn := NewPlayer; 2954 3000 pLogo := -1; 2955 skipped := False; // always show my moves during my turn3001 Skipped := False; // always show my moves during my turn 2956 3002 Idle := True; 2957 3003 if FirstMovieTurn then … … 2978 3024 ClientMode := -1; 2979 3025 Idle := False; 2980 skipped := False;3026 Skipped := False; 2981 3027 end; 2982 3028 … … 3632 3678 I: Integer; 3633 3679 begin 3680 if Assigned(FWondersDlg) then FreeAndNil(FWondersDlg); 3681 if Assigned(FTechTreeDlg) then FreeAndNil(FTechTreeDlg); 3682 if Assigned(FEnhanceDlg) then FreeAndNil(FEnhanceDlg); 3683 if Assigned(FNegoDlg) then FreeAndNil(FNegoDlg); 3684 if Assigned(FCityTypeDlg) then FreeAndNil(FCityTypeDlg); 3685 if Assigned(FDiaDlg) then FreeAndNil(FDiaDlg); 3686 if Assigned(FCityDlg) then FreeAndNil(FCityDlg); 3687 if Assigned(FRatesDlg) then FreeAndNil(FRatesDlg); 3688 if Assigned(FBattleDlg) then FreeAndNil(FBattleDlg); 3689 if Assigned(FNatStatDlg) then FreeAndNil(FNatStatDlg); 3690 if Assigned(FUnitStatDlg) then FreeAndNil(FUnitStatDlg); 3691 if Assigned(FDraftDlg) then FreeAndNil(FDraftDlg); 3692 if Assigned(FModalSelectDlg) then FreeAndNil(FModalSelectDlg); 3693 if Assigned(FListDlg) then FreeAndNil(FListDlg); 3694 if Assigned(FMessgExDlg) then FreeAndNil(FMessgExDlg); 3695 if Assigned(FHelpDlg) then FreeAndNil(FHelpDlg); 3696 3634 3697 MainFormKeyDown := nil; 3635 3698 FreeAndNil(sb); … … 4340 4403 end 4341 4404 else if ClientMode < 0 then 4342 skipped := True4405 Skipped := True 4343 4406 else if ClientMode >= scContact then 4344 4407 NegoDlg.ShowNewContent(wmPersistent) … … 4590 4653 ClientMode := -1; 4591 4654 Idle := False; 4592 skipped := WasSkipped;4655 Skipped := WasSkipped; 4593 4656 for p1 := 1 to nPl - 1 do 4594 4657 if G.RO[p1] <> nil then 4595 skipped := True; // don't show enemy moves in hotseat mode4658 Skipped := True; // don't show enemy moves in hotseat mode 4596 4659 end 4597 4660 else … … 4604 4667 NegoDlg.Close; 4605 4668 HaveStrategyAdvice := False; 4606 // AdvisorDlg.HaveStrategyAdvice;4607 // negotiation might have changed advices4608 4669 EOT.ButtonIndex := eotCancel; 4609 4670 EOT.Visible := True; … … 5816 5877 Exit; 5817 5878 5818 if CityDlg.Visible then5879 if Assigned(FCityDlg) and CityDlg.Visible then 5819 5880 CityDlg.Close; 5820 if UnitStatDlg.Visible then5881 if Assigned(FUnitStatDlg) and UnitStatDlg.Visible then 5821 5882 UnitStatDlg.Close; 5822 5883 MouseLoc := LocationOfScreenPixel(X, Y); … … 7381 7442 end; 7382 7443 7444 function TMainScreen.GetBattleDlg: TBattleDlg; 7445 begin 7446 if not Assigned(FBattleDlg) then FBattleDlg := TBattleDlg.Create(nil); 7447 Result := FBattleDlg; 7448 end; 7449 7450 function TMainScreen.GetCityDlg: TCityDlg; 7451 begin 7452 if not Assigned(FCityDlg) then begin 7453 FCityDlg := TCityDlg.Create(nil); 7454 FCityDlg.CheckAge; 7455 end; 7456 Result := FCityDlg; 7457 end; 7458 7459 function TMainScreen.GetCityTypeDlg: TCityTypeDlg; 7460 begin 7461 if not Assigned(FCityTypeDlg) then FCityTypeDlg := TCityTypeDlg.Create(nil); 7462 Result := FCityTypeDlg; 7463 end; 7464 7465 function TMainScreen.GetDiaDlg: TDiaDlg; 7466 begin 7467 if not Assigned(FDiaDlg) then begin 7468 FDiaDlg := TDiaDlg.Create(nil); 7469 ArrangeDialog(FDiaDlg); 7470 end; 7471 Result := FDiaDlg; 7472 end; 7473 7474 function TMainScreen.GetDraftDlg: TDraftDlg; 7475 begin 7476 if not Assigned(FDraftDlg) then FDraftDlg := TDraftDlg.Create(nil); 7477 Result := FDraftDlg; 7478 end; 7479 7480 function TMainScreen.GetEnhanceDlg: TEnhanceDlg; 7481 begin 7482 if not Assigned(FEnhanceDlg) then FEnhanceDlg := TEnhanceDlg.Create(nil); 7483 Result := FEnhanceDlg; 7484 end; 7485 7486 function TMainScreen.GetHelpDlg: THelpDlg; 7487 begin 7488 if not Assigned(FHelpDlg) then begin 7489 FHelpDlg := THelpDlg.Create(nil); 7490 ArrangeDialog(FHelpDlg); 7491 FHelpDlg.Difficulty := G.Difficulty[Me]; 7492 end; 7493 Result := FHelpDlg; 7494 end; 7495 7496 function TMainScreen.GetListDlg: TListDlg; 7497 begin 7498 if not Assigned(FListDlg) then begin 7499 FListDlg := TListDlg.Create(nil); 7500 ArrangeDialog(FListDlg); 7501 end; 7502 Result := FListDlg; 7503 end; 7504 7505 function TMainScreen.GetMessgExDlg: TMessgExDlg; 7506 begin 7507 if not Assigned(FMessgExDlg) then FMessgExDlg := TMessgExDlg.Create(nil); 7508 Result := FMessgExDlg; 7509 end; 7510 7511 function TMainScreen.GetModalSelectDlg: TModalSelectDlg; 7512 begin 7513 if not Assigned(FModalSelectDlg) then FModalSelectDlg := TModalSelectDlg.Create(nil); 7514 Result := FModalSelectDlg; 7515 end; 7516 7517 function TMainScreen.GetNatStatDlg: TNatStatDlg; 7518 begin 7519 if not Assigned(FNatStatDlg) then begin 7520 FNatStatDlg := TNatStatDlg.Create(nil); 7521 ArrangeDialog(FNatStatDlg); 7522 FNatStatDlg.CheckAge; 7523 end; 7524 Result := FNatStatDlg; 7525 end; 7526 7527 function TMainScreen.GetNegoDlg: TNegoDlg; 7528 begin 7529 if not Assigned(FNegoDlg) then FNegoDlg := TNegoDlg.Create(nil); 7530 Result := FNegoDlg; 7531 end; 7532 7533 function TMainScreen.GetRatesDlg: TRatesDlg; 7534 begin 7535 if not Assigned(FRatesDlg) then FRatesDlg := TRatesDlg.Create(nil); 7536 Result := FRatesDlg; 7537 end; 7538 7539 function TMainScreen.GetTechTreeDlg: TTechTreeDlg; 7540 begin 7541 if not Assigned(FTechTreeDlg) then FTechTreeDlg := TTechTreeDlg.Create(nil); 7542 Result := FTechTreeDlg; 7543 end; 7544 7383 7545 procedure TMainScreen.mDisbandOrUtilizeClick(Sender: TObject); 7384 7546 var … … 8177 8339 end; 8178 8340 8179 { procedure TMainScreen.AdviceBtnClick;8180 var8181 OldAdviceLoc: Integer;8182 begin8183 DestinationMarkON:=False;8184 PaintDestination;8185 AdvisorDlg.GiveStrategyAdvice;8186 OldAdviceLoc:=MainMap.AdviceLoc;8187 MainMap.AdviceLoc:=-1;8188 PaintLoc(OldAdviceLoc);8189 end; }8190 8191 { procedure TMainScreen.SetAdviceLoc(Loc: integer; AvoidRect: TRect);8192 var8193 OldAdviceLoc,X,Y: Integer;8194 begin8195 if Loc<>MainMap.AdviceLoc then8196 begin8197 if Loc>=0 then8198 begin // center8199 Y:=Loc div G.lx;8200 X:=(Loc+G.lx - AvoidRect.Right div (2*66)) mod G.lx;8201 Centre(Y*G.lx+X);8202 PaintAllMaps;8203 end;8204 OldAdviceLoc:=MainMap.AdviceLoc;8205 MainMap.AdviceLoc:=Loc;8206 PaintLoc(OldAdviceLoc);8207 PaintLoc(MainMap.AdviceLoc);8208 end;8209 end; }8210 8211 8341 procedure TMainScreen.UnitInfoBtnClick(Sender: TObject); 8212 8342 begin … … 8294 8424 end; 8295 8425 8426 procedure TMainScreen.ArrangeDialogs; 8427 begin 8428 ArrangeDialog(FListDlg); 8429 ArrangeDialog(FHelpDlg); 8430 ArrangeDialog(FUnitStatDlg); 8431 ArrangeDialog(FDiaDlg); 8432 ArrangeDialog(FNatStatDlg); 8433 end; 8434 8435 procedure TMainScreen.ArrangeDialog(Form: TBufferedDrawDlg); 8436 begin 8437 if not Assigned(Form) then Exit; 8438 8439 if Form is TListDlg then begin; 8440 ListDlg.UserLeft := 8; 8441 ListDlg.UserTop := TopBarHeight + 8; 8442 end; 8443 if Form is THelpDlg then begin 8444 HelpDlg.UserLeft := Screen.Width - HelpDlg.Width - 8; 8445 HelpDlg.UserTop := TopBarHeight + 8; 8446 end; 8447 if Form is TUnitStatDlg then begin 8448 UnitStatDlg.UserLeft := 397; 8449 UnitStatDlg.UserTop := TopBarHeight + 64; 8450 end; 8451 if Form is TDiaDlg then begin 8452 DiaDlg.UserLeft := (Screen.Width - DiaDlg.Width) div 2; 8453 DiaDlg.UserTop := (Screen.Height - DiaDlg.Height) div 2; 8454 end; 8455 if Form is TNatStatDlg then begin 8456 NatStatDlg.UserLeft := Screen.Width - NatStatDlg.Width - 8; 8457 NatStatDlg.UserTop := Screen.Height - PanelHeight - NatStatDlg.Height - 8; 8458 if NatStatDlg.UserTop < 8 then 8459 NatStatDlg.UserTop := 8; 8460 end; 8461 end; 8462 8296 8463 procedure TMainScreen.ScrollBarUpdate(Sender: TObject); 8297 8464 begin
Note:
See TracChangeset
for help on using the changeset viewer.