Changeset 293
- Timestamp:
- Mar 5, 2021, 1:36:47 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 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'); -
trunk/Settings.pas
r259 r293 42 42 public 43 43 Languages: TLanguages; 44 procedure LoadData; 45 procedure SaveData; 44 46 end; 45 47 … … 105 107 106 108 ButtonFullscreen.Graphic := GrExt[HGrSystem].Data; 107 if FullScreen then ButtonFullscreen.ButtonIndex := 3108 else ButtonFullscreen.ButtonIndex := 2;109 109 end; 110 110 … … 116 116 procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject); 117 117 begin 118 FullScreen := not FullScreen;119 118 ButtonFullscreen.ButtonIndex := ButtonFullscreen.ButtonIndex xor 1; 120 119 end; … … 151 150 begin 152 151 Languages.LoadToStrings(List.Items); 153 List.ItemIndex := Languages.Search(LocaleCode);154 if (List.ItemIndex = -1) and (Languages.Count > 0) then155 List.ItemIndex := 0;156 152 List.Font.Color := MainTexture.clMark; 153 LoadData; 157 154 end; 158 155 159 156 procedure TSettingsDlg.OKBtnClick(Sender: TObject); 160 157 begin 158 SaveData; 159 ModalResult := mrOk; 160 end; 161 162 procedure TSettingsDlg.LoadData; 163 begin 164 List.ItemIndex := Languages.Search(LocaleCode); 165 if (List.ItemIndex = -1) and (Languages.Count > 0) then 166 List.ItemIndex := 0; 167 if FullScreen then ButtonFullscreen.ButtonIndex := 3 168 else ButtonFullscreen.ButtonIndex := 2; 169 end; 170 171 procedure TSettingsDlg.SaveData; 172 begin 161 173 LocaleCode := Languages[List.ItemIndex].ShortName; 162 ModalResult := mrOk;174 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 163 175 end; 164 176
Note:
See TracChangeset
for help on using the changeset viewer.