Changeset 622 for trunk/LocalPlayer
- Timestamp:
- Sep 15, 2024, 10:04:45 PM (2 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r565 r622 207 207 OKBtn.Visible := True; 208 208 CancelBtn.Visible := True; 209 Left := (Screen.Width - ClientWidth) div 2; // center on screen 210 Top := (Screen.Height - ClientHeight) div 2; 209 CenterToScreen; 211 210 end 212 211 else -
trunk/LocalPlayer/CityScreen.pas
r617 r622 1100 1100 end; 1101 1101 1102 if WindowMode = wmModal then 1103 begin { center on screen } 1104 Left := (Screen.Width - Width) div 2; 1105 Top := (Screen.Height - Height) div 2; 1106 end; 1102 if WindowMode = wmModal then CenterToScreen; 1107 1103 1108 1104 Caption := CityName(C.ID); -
trunk/LocalPlayer/Diagram.pas
r550 r622 291 291 procedure TDiaDlg.FormShow(Sender: TObject); 292 292 begin 293 if WindowMode = wmModal then 294 begin { center on screen } 295 Left := (Screen.Width - Width) div 2; 296 Top := (Screen.Height - Height) div 2; 297 end; 293 if WindowMode = wmModal then CenterToScreen; 298 294 OffscreenPaint; 299 295 end; -
trunk/LocalPlayer/Draft.pas
r558 r622 485 485 yView := yView0 - Cut; 486 486 487 if WindowMode = wmModal then 488 begin { center on screen } 489 Left := (Screen.Width - Template.Width) div 2; 490 Top := (Screen.Height - (Template.Height - Cut)) div 2; 491 end; 487 if WindowMode = wmModal then CenterToScreen(Template.Width, Template.Height - Cut); 492 488 493 489 SetDomain(Domain); -
trunk/LocalPlayer/Enhance.pas
r558 r622 131 131 TypeChanged: Boolean; 132 132 begin 133 OffscreenUser := Self;133 inherited; 134 134 Offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 135 135 FillOffscreen(0, 0, InnerWidth, InnerHeight); -
trunk/LocalPlayer/MessgEx.pas
r570 r622 169 169 0: 170 170 begin 171 Left := (Screen.Width - Width) div 2;172 Top := (Screen.Height - Height) div 2 - MapCenterUp;171 Left := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2; 172 Top := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 2 - MapCenterUp; 173 173 end; 174 174 1: 175 175 begin 176 Left := (Screen.Width - Width) div 4;177 Top := (Screen.Height - Height) * 2 div 3 - MapCenterUp;176 Left := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 4; 177 Top := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) * 2 div 3 - MapCenterUp; 178 178 end; 179 179 -1: 180 180 begin 181 Left := (Screen.Width - Width) div 4;182 Top := (Screen.Height - Height) div 3 - MapCenterUp;181 Left := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 4; 182 Top := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 3 - MapCenterUp; 183 183 end; 184 184 end; -
trunk/LocalPlayer/Nego.pas
r592 r622 485 485 OkEnabled: Boolean; 486 486 begin 487 if (OffscreenUser <> nil) and (OffscreenUser <> Self) then 488 OffscreenUser.Update; 489 // complete working with old owner to prevent rebound 490 OffscreenUser := Self; 487 inherited; 491 488 492 489 if (DipCommand >= 0) and (Page = History[Me].N) then … … 917 914 { opLowTreaty: 918 915 begin 919 if MyRO.Treaty[DipMem[Me].pContact] =trNone then Price:=opTreaty+trCeaseFire920 else Price :=opTreaty+MyRO.Treaty[DipMem[Me].pContact]-1;916 if MyRO.Treaty[DipMem[Me].pContact] = trNone then Price := opTreaty + trCeaseFire 917 else Price := opTreaty + MyRO.Treaty[DipMem[Me].pContact]- 1; 921 918 end } 922 919 end; -
trunk/LocalPlayer/Rates.pas
r565 r622 40 40 procedure TRatesDlg.FormCreate(Sender: TObject); 41 41 begin 42 TitleHeight := Screen. Height;42 TitleHeight := Screen.PrimaryMonitor.Height; 43 43 InitButtons; 44 44 end; -
trunk/LocalPlayer/Select.pas
r613 r622 1545 1545 var 1546 1546 I: Integer; 1547 NewTop, NewLeft: Integer; 1547 1548 begin 1548 1549 Result := -1; … … 1643 1644 begin { center on screen } 1644 1645 if Kind = kTribe then 1645 Left := (Screen.Width - 800) * 3 div 8 + 1301646 NewLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - 800) * 3 div 8 + 130 1646 1647 else 1647 Left := (Screen.Width - Width) div 2;1648 Top := (Screen.Height - Height) div 2;1648 NewLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2; 1649 NewTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 2; 1649 1650 if Kind = kProject then 1650 Top := Top + 48; 1651 NewTop := NewTop + 48; 1652 BoundsRect := Bounds(NewLeft, NewTop, Width, Height); 1651 1653 end; 1652 1654 -
trunk/LocalPlayer/TechTree.pas
r577 r622 214 214 215 215 // Fit window to image, center image in window, center window to screen 216 NewWidth := Min(Screen. Width - 40, Image.Width + LeftBorder + RightBorder +216 NewWidth := Min(Screen.PrimaryMonitor.Width - 40, Image.Width + LeftBorder + RightBorder + 217 217 2 * BlackBorder); 218 NewHeight := Min(Screen. Height - 40, Image.Height + TopBorder + BottomBorder +218 NewHeight := Min(Screen.PrimaryMonitor.Height - 40, Image.Height + TopBorder + BottomBorder + 219 219 2 * BlackBorder); 220 BoundsRect := Bounds( (Screen.Width - NewWidth) div 2,221 (Screen.Height - NewHeight) div 2, NewWidth, NewHeight);220 BoundsRect := Bounds(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - NewWidth) div 2, 221 Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - NewHeight) div 2, NewWidth, NewHeight); 222 222 CloseBtn.Left := Width - CloseBtn.Width - BlackBorder - 8; 223 223 CloseBtn.Top := BlackBorder + 8; -
trunk/LocalPlayer/Term.pas
r621 r622 12 12 {$ENDIF} 13 13 Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase, 14 LCLIntf, LCLType, Menus,SysUtils, Classes, DrawDlg, Types, Math,14 LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types, Math, 15 15 DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area, Help, 16 16 GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType, … … 2643 2643 MainTexture.Age := -1; 2644 2644 Tribes.Init; 2645 HelpDlg.UserLeft := (Screen.Width - HelpDlg.Width) div 2;2646 HelpDlg.UserTop := (Screen.Height - HelpDlg.Height) div 2;2645 HelpDlg.UserLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - HelpDlg.Width) div 2; 2646 HelpDlg.UserTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - HelpDlg.Height) div 2; 2647 2647 HelpDlg.Difficulty := 0; 2648 2648 if Command = cStartCredits then … … 5963 5963 if BattleDlg.Left < 0 then 5964 5964 BattleDlg.Left := 0 5965 else if BattleDlg.Left + BattleDlg.Width > Screen. Width then5966 BattleDlg.Left := Screen. Width - BattleDlg.Width;5965 else if BattleDlg.Left + BattleDlg.Width > Screen.DesktopWidth then 5966 BattleDlg.Left := Screen.DesktopWidth - BattleDlg.Width; 5967 5967 BattleDlg.Top := Y - BattleDlg.Height div 2; 5968 5968 if BattleDlg.Top < 0 then 5969 5969 BattleDlg.Top := 0 5970 else if BattleDlg.Top + BattleDlg.Height > Screen. Height then5971 BattleDlg.Top := Screen. Height - BattleDlg.Height;5970 else if BattleDlg.Top + BattleDlg.Height > Screen.DesktopHeight then 5971 BattleDlg.Top := Screen.DesktopHeight - BattleDlg.Height; 5972 5972 BattleDlg.IsSuicideQuery := False; 5973 5973 BattleDlg.Show; … … 8065 8065 procedure TMainScreen.FormShow(Sender: TObject); 8066 8066 begin 8067 if FullScreen then BoundsRect := Bounds(0, 0, Screen.Width, Screen.Height)8067 if FullScreen then BoundsRect := Screen.PrimaryMonitor.BoundsRect 8068 8068 else BoundsRect := TermBounds; 8069 8069 FormRestoredSize := TermBounds; … … 8387 8387 8388 8388 if Form is TListDlg then begin; 8389 ListDlg.UserLeft := 8;8390 ListDlg.UserTop := TopBarHeight + 8;8389 ListDlg.UserLeft := Screen.PrimaryMonitor.Left + 8; 8390 ListDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 8; 8391 8391 end; 8392 8392 if Form is THelpDlg then begin 8393 HelpDlg.UserLeft := Screen.Width - HelpDlg.Width - 8;8394 HelpDlg.UserTop := TopBarHeight + 8;8393 HelpDlg.UserLeft := Screen.PrimaryMonitor.Left + Screen.PrimaryMonitor.Width - HelpDlg.Width - 8; 8394 HelpDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 8; 8395 8395 end; 8396 8396 if Form is TUnitStatDlg then begin 8397 UnitStatDlg.UserLeft := 397;8398 UnitStatDlg.UserTop := TopBarHeight + 64;8397 UnitStatDlg.UserLeft := Screen.PrimaryMonitor.Left + 397; 8398 UnitStatDlg.UserTop := Screen.PrimaryMonitor.Top + TopBarHeight + 64; 8399 8399 end; 8400 8400 if Form is TDiaDlg then begin 8401 DiaDlg.UserLeft := (Screen.Width - DiaDlg.Width) div 2;8402 DiaDlg.UserTop := (Screen.Height - DiaDlg.Height) div 2;8401 DiaDlg.UserLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - DiaDlg.Width) div 2; 8402 DiaDlg.UserTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - DiaDlg.Height) div 2; 8403 8403 end; 8404 8404 if Form is TNatStatDlg then begin 8405 NatStatDlg.UserLeft := Screen. Width - NatStatDlg.Width - 8;8406 NatStatDlg.UserTop := Screen. Height - PanelHeight - NatStatDlg.Height - 8;8405 NatStatDlg.UserLeft := Screen.PrimaryMonitor.Left + Screen.PrimaryMonitor.Width - NatStatDlg.Width - 8; 8406 NatStatDlg.UserTop := Screen.PrimaryMonitor.Top + Screen.PrimaryMonitor.Height - PanelHeight - NatStatDlg.Height - 8; 8407 8407 if NatStatDlg.UserTop < 8 then 8408 8408 NatStatDlg.UserTop := 8; -
trunk/LocalPlayer/UnitStat.pas
r536 r622 77 77 NoMap := TIsoMap.Create; 78 78 AgePrepared := -2; 79 TitleHeight := Screen. Height;79 TitleHeight := Screen.PrimaryMonitor.Height; 80 80 InitButtons; 81 81 … … 164 164 if Kind in [dkOwnModel, dkEnemyModel] then 165 165 begin 166 Left := UserLeft; 167 Top := UserTop; 166 BoundsRect := Bounds(UserLeft, UserTop, Width, Height); 168 167 end else begin 169 Left := (Screen.Width - Width) div 2; 170 Top := (Screen.Height - Height) div 2; 168 BoundsRect := Bounds(Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2, 169 Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 2, 170 Width, Height); 171 171 end; 172 172
Note:
See TracChangeset
for help on using the changeset viewer.