Changeset 293 for trunk/LocalPlayer
- Timestamp:
- Mar 5, 2021, 1:36:47 PM (4 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r292 r293 235 235 Closable, RepaintOnResize, Tracking, TurnComplete, Edited, GoOnPhase, 236 236 HaveStrategyAdvice, FirstMovieTurn: boolean; 237 PrevWindowState: TWindowState; 238 CurrentWindowState: TWindowState; 237 239 function ChooseUnusedTribe: integer; 238 240 procedure GetTribeList; … … 284 286 procedure SoundPreload(Check: integer); 285 287 procedure UpdateKeyShortcuts; 288 procedure SetFullScreen(Active: Boolean); 286 289 public 287 290 UsedOffscreenWidth, UsedOffscreenHeight: integer; … … 308 311 FileName: ShortString; 309 312 end; 310 311 313 TCityNameInfo = record 312 314 ID: integer; 313 NewName: ShortString end; 314 TModelNameInfo = record mix: integer; 315 NewName: ShortString end; 316 TPriceSet = Set of $00 .. $FF; 315 NewName: ShortString; 316 end; 317 TModelNameInfo = record 318 mix: integer; 319 NewName: ShortString; 320 end; 321 TPriceSet = Set of $00 .. $FF; 317 322 318 323 const … … 532 537 SmallScreen, GameOK, MapValid, skipped, idle: boolean; 533 538 534 SaveOption: array [0 ..nSaveOption - 1] of integer;535 MiniColors: array [0 .. 11, 0 ..1] of TColor;539 SaveOption: array [0..nSaveOption - 1] of integer; 540 MiniColors: array [0..11, 0..1] of TColor; 536 541 MainMap: TIsoMap; 537 542 CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer; … … 737 742 ChooseModelPicture(Owner, mix, ModelCode(MyRO.EnemyModel[emix]), 738 743 ModelHash(MyRO.EnemyModel[emix]), MyRO.Turn, false, true); 739 result := true 744 result := true; 740 745 end; 741 746 … … 874 879 MyModel[mix].Status := MyModel[mix].Status or msObsolete; 875 880 end; 876 inc(MyData.ToldModels) 881 inc(MyData.ToldModels); 877 882 end; 878 883 end; … … 3612 3617 RectInvalidate(0, TopBarHeight, ClientWidth, TopBarHeight + MapHeight); 3613 3618 MapValid := false; 3614 PaintAll 3615 end 3619 PaintAll; 3620 end; 3616 3621 end; 3617 3622 … … 4058 4063 var 4059 4064 uix, cix, x, y, Loc, i, hw, xm, cm, cmPolOcean, cmPolNone: integer; 4060 PrevMiniPixel, MiniPixel: TPixelPointer; 4065 PrevMiniPixel: TPixelPointer; 4066 MiniPixel: TPixelPointer; 4067 TerrainTile: Cardinal; 4061 4068 begin 4062 4069 cmPolOcean := GrExt[HGrSystem].Data.Canvas.Pixels[101, 67]; … … 4082 4089 ScaleToNative(G.lx) * 5) mod (ScaleToNative(G.lx) * 2); 4083 4090 MiniPixel.SetXY(xm, y); 4084 cm := MiniColors[MyMap[Loc] and fTerrain, i]; 4091 TerrainTile := MyMap[Loc] and fTerrain; 4092 if TerrainTile > 11 then TerrainTile := 0; 4093 cm := MiniColors[TerrainTile, i]; 4085 4094 if ClientMode = cEditMap then 4086 4095 begin … … 4572 4581 Brush.Style := bsClear; 4573 4582 if UnFocus >= 0 then 4574 with MyUn[UnFocus], MyModel[mix] do 4583 with MyUn[UnFocus] do 4584 with MyModel[mix] do 4575 4585 begin { display info about selected unit } 4576 4586 if Job = jCity then … … 6492 6502 end; 6493 6503 6504 procedure TMainScreen.SetFullScreen(Active: Boolean); 6505 begin 6506 (* if FullScreen then begin 6507 ShowWindow(Handle, SW_SHOWFULLSCREEN); 6508 {$IFDEF WINDOWS} 6509 Form.BorderStyle := bsNone; 6510 {$ENDIF} 6511 end else begin 6512 {$IFDEF WINDOWS} 6513 Form.BorderStyle := bsSizeable; 6514 {$ENDIF} 6515 ShowWindow(Handle, SW_SHOWNORMAL); 6516 WindowState := wsMaximized; 6517 BorderStyle := bsSizeable; 6518 BorderIcons := [biSystemMenu, biMinimize, biMaximize]; 6519 end; 6520 *) 6521 if Active and (CurrentWindowState <> wsFullScreen) then begin 6522 PrevWindowState := WindowState; 6523 CurrentWindowState := wsFullScreen; 6524 WindowState := CurrentWindowState; 6525 {$IFDEF WINDOWS} 6526 BorderStyle := bsNone; 6527 {$ENDIF} 6528 BorderIcons := []; 6529 end else 6530 if not Active and (CurrentWindowState = wsFullScreen) then begin 6531 if PrevWindowState = wsMaximized then begin 6532 CurrentWindowState := wsMaximized; 6533 WindowState := CurrentWindowState; 6534 end else begin 6535 CurrentWindowState := wsNormal; 6536 WindowState := CurrentWindowState; 6537 WindowState := wsFullScreen; 6538 WindowState := CurrentWindowState; 6539 end; 6540 {$IFDEF WINDOWS} 6541 BorderStyle := bsSizeable; 6542 {$ENDIF} 6543 BorderIcons := [biSystemMenu, biMinimize, biMaximize]; 6544 end; 6545 end; 6546 6494 6547 procedure TMainScreen.FormKeyDown(Sender: TObject; var Key: word; 6495 6548 Shift: TShiftState); … … 6558 6611 6559 6612 if BEndTurn.Test(ShortCut) then EndTurn 6613 else if BFullScreen.Test(ShortCut) then begin 6614 FullScreen := not FullScreen; 6615 SetFullScreen(FullScreen); 6616 end 6560 6617 else if BHelp.Test(ShortCut) then MenuClick(mHelp) 6561 6618 else if BUnitStat.Test(ShortCut) then MenuClick_Check(StatPopup, mUnitStat) … … 7758 7815 procedure TMainScreen.FormShow(Sender: TObject); 7759 7816 begin 7760 if FullScreen then begin 7761 WindowState := wsFullScreen; 7762 BorderStyle := bsNone; 7763 BorderIcons := []; 7764 end else begin 7765 WindowState := wsMaximized; 7766 BorderStyle := bsSizeable; 7767 BorderIcons := [biSystemMenu, biMinimize, biMaximize]; 7768 end; 7817 SetFullScreen(FullScreen); 7769 7818 Timer1.Enabled := True; 7770 7819 end; -
trunk/LocalPlayer/UKeyBindings.pas
r292 r293 44 44 BNations: TKeyBinding; 45 45 BEmpire: TKeyBinding; 46 BFullScreen: TKeyBinding; 46 47 BResign: TKeyBinding; 47 48 BRandomMap: TKeyBinding; … … 222 223 BNations := AddItem('Nations', 'Nations', 'F9'); 223 224 BEmpire := AddItem('Empire', 'Empire', 'F10'); 225 BFullScreen := AddItem('FullScreen', 'Full screen', 'F11'); 224 226 BResign := AddItem('Resign', 'Resign', 'Ctrl+Q'); 225 227 BRandomMap := AddItem('RandomMap', 'Random map', 'Ctrl+R');
Note:
See TracChangeset
for help on using the changeset viewer.