Changeset 63
- Timestamp:
- Jan 5, 2023, 11:03:33 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r62 r63 82 82 Action = AFullScreen 83 83 end 84 object MenuItem8: TMenuItem 85 Action = AShowRawImageDesc 86 end 84 87 end 85 88 object MenuItem7: TMenuItem … … 112 115 OnExecute = ANewGameExecute 113 116 ShortCut = 16462 117 Visible = False 114 118 end 115 119 object AShowMap: TAction … … 117 121 OnExecute = AShowMapExecute 118 122 ShortCut = 123 123 Visible = False 119 124 end 120 125 object AAbout: TAction … … 125 130 Caption = 'Show RawImage Description' 126 131 OnExecute = AShowRawImageDescExecute 132 Visible = False 127 133 end 128 134 end -
trunk/Forms/UFormMain.pas
r62 r63 31 31 MenuItem6: TMenuItem; 32 32 MenuItem7: TMenuItem; 33 MenuItem8: TMenuItem; 33 34 MenuItem9: TMenuItem; 34 35 StatusBar1: TStatusBar; … … 137 138 {$IFDEF DEBUG} 138 139 StatusBar1.Visible := not FullScreenEnabled; 140 AShowMap.Visible := True; 141 ANewGame.Visible := True; 142 AShowRawImageDesc.Visible := True; 139 143 {$ENDIF} 140 144 end; … … 148 152 begin 149 153 XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml'; 154 FullScreenEnabled := True; 150 155 151 156 PersistentForm := TPersistentForm.Create(nil); … … 244 249 PersistentForm.Load(Self, False, True); 245 250 FullScreenEnabled := PersistentForm.FormFullScreen; 246 UpdateInterface 251 PersistentForm.SetFullScreen(FullScreenEnabled); 252 UpdateInterface; 247 253 end; 248 254 -
trunk/Install/deb/debian/control
r37 r63 9 9 Architecture: any 10 10 Depends: ${shlibs:Depends}, ${misc:Depends}, 11 Description: Real-time diggingtank battle game11 Description: A real-time digging and shooting multi-player tank battle game 12 12 HomePage: https://app.zdechov.net/Tunneler -
trunk/Install/deb/debian/rules
r35 r63 17 17 install -s -m 755 Tunneler $(ROOT)/usr/bin 18 18 install -d -m 755 $(ROOT)/usr/share/applications 19 install -m 755 Install/ deb/Tunneler.desktop $(ROOT)/usr/share/applications19 install -m 755 Install/common/Tunneler.desktop $(ROOT)/usr/share/applications 20 20 install -d -m 755 $(ROOT)/usr/share/pixmaps 21 21 install -m 644 Images/64x64/Tunneler.png $(ROOT)/usr/share/pixmaps 22 install -d -m 755 $(ROOT)/usr/share/Tunneler/languages 23 install -D -m 755 Languages/* $(ROOT)/usr/share/Tunneler/languages 22 install -d -m 755 $(ROOT)/usr/share/Tunneler/Languages 23 install -D -m 755 Languages/*.pot $(ROOT)/usr/share/Tunneler/Languages 24 install -D -m 755 Languages/*.po $(ROOT)/usr/share/Tunneler/Languages 24 25 25 26 %: -
trunk/Packages/Common/UGeometric.pas
r54 r63 9 9 TPointArray = array of TPoint; 10 10 11 { TVector } 12 13 TVector = record 14 Position: TPoint; 15 Direction: TPoint; 16 function GetLength: Integer; 17 function GetAngle: Double; 18 end; 19 11 20 function Distance(P1, P2: TPoint): Integer; 12 21 function Dot(const P1, P2: TPoint): Double; 13 22 function AddPoint(const P1, P2: TPoint): TPoint; 14 23 function SubPoint(const P1, P2: TPoint): TPoint; 15 function PointToLineDistance(const P, V, W: TPoint ): Integer;24 function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer; 16 25 function ComparePoint(P1, P2: TPoint): Boolean; 17 26 function RotatePoint(Center, P: TPoint; Angle: Double): TPoint; … … 50 59 end; 51 60 52 function PointToLineDistance(const P, V, W: TPoint ): Integer;61 function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer; 53 62 var 54 63 l2, t: Double; … … 68 77 if T < 0 then begin 69 78 Result := Distance(P, V); // Beyond the 'v' end of the segment 70 exit; 79 Intersect := V; 80 Exit; 71 81 end 72 82 else if T > 1 then begin 73 83 Result := Distance(P, W); // Beyond the 'w' end of the segment 84 Intersect := W; 74 85 Exit; 75 86 end; … … 77 88 TT.Y := Trunc(V.Y + T * (W.Y - V.Y)); 78 89 Result := Distance(P, TT); 90 Intersect := TT; 79 91 end; 80 92 … … 162 174 end; 163 175 176 { TVector } 177 178 function TVector.GetLength: Integer; 179 begin 180 Result := Trunc(Sqrt(Sqr(Direction.X) + Sqr(Direction.Y))); 181 end; 182 183 function TVector.GetAngle: Double; 184 begin 185 Result := ArcTan2(Direction.Y, Direction.X); 186 end; 164 187 165 188 end. -
trunk/Packages/Common/UPersistentForm.pas
r54 r63 1 1 unit UPersistentForm; 2 3 // Date: 2020-11-264 2 5 3 interface … … 21 19 procedure SaveControl(Control: TControl); 22 20 public 23 FormNormalSize: TRect;24 21 FormRestoredSize: TRect; 25 22 FormWindowState: TWindowState; … … 155 152 RootKey := RegistryContext.RootKey; 156 153 OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True); 157 // Normal size 158 FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left); 159 FormNormalSize.Top := ReadIntegerWithDefault('NormalTop', FormNormalSize.Top); 160 FormNormalSize.Right := ReadIntegerWithDefault('NormalWidth', FormNormalSize.Right - FormNormalSize.Left) 161 + FormNormalSize.Left; 162 FormNormalSize.Bottom := ReadIntegerWithDefault('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top) 163 + FormNormalSize.Top; 154 164 155 // Restored size 165 156 FormRestoredSize.Left := ReadIntegerWithDefault('RestoredLeft', FormRestoredSize.Left); … … 169 160 FormRestoredSize.Bottom := ReadIntegerWithDefault('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top) 170 161 + FormRestoredSize.Top; 162 171 163 // Other state 172 164 FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(FormWindowState))); … … 183 175 RootKey := RegistryContext.RootKey; 184 176 OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True); 185 // Normal state 186 WriteInteger('NormalWidth', FormNormalSize.Right - FormNormalSize.Left); 187 WriteInteger('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top); 188 WriteInteger('NormalTop', FormNormalSize.Top); 189 WriteInteger('NormalLeft', FormNormalSize.Left); 190 // Restored state 177 178 // Restored size 191 179 WriteInteger('RestoredWidth', FormRestoredSize.Right - FormRestoredSize.Left); 192 180 WriteInteger('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top); 193 181 WriteInteger('RestoredTop', FormRestoredSize.Top); 194 182 WriteInteger('RestoredLeft', FormRestoredSize.Left); 183 195 184 // Other state 196 185 WriteInteger('WindowState', Integer(FormWindowState)); … … 257 246 begin 258 247 Self.Form := Form; 248 259 249 // Set default 260 FormNormalSize := Bounds((Screen.Width - Form.Width) div 2,261 (Screen.Height - Form.Height) div 2, Form.Width, Form.Height);262 250 FormRestoredSize := Bounds((Screen.Width - Form.Width) div 2, 263 251 (Screen.Height - Form.Height) div 2, Form.Width, Form.Height); … … 267 255 LoadFromRegistry(RegistryContext); 268 256 269 if not EqualRect(FormNormalSize, FormRestoredSize) or 270 DefaultMaximized then begin 257 if (FormWindowState = wsMaximized) or DefaultMaximized then begin 271 258 // Restore to maximized state 272 259 Form.WindowState := wsNormal; … … 277 264 // Restore to normal state 278 265 Form.WindowState := wsNormal; 279 if FEntireVisible then Form NormalSize := CheckEntireVisible(FormNormalSize)266 if FEntireVisible then FormRestoredSize := CheckEntireVisible(FormRestoredSize) 280 267 else if FMinVisiblePart > 0 then 281 FormNormalSize := CheckPartVisible(FormNormalSize, FMinVisiblePart);282 if not EqualRect(Form NormalSize, Form.BoundsRect) then283 Form.BoundsRect := Form NormalSize;268 FormRestoredSize := CheckPartVisible(FormRestoredSize, FMinVisiblePart); 269 if not EqualRect(FormRestoredSize, Form.BoundsRect) then 270 Form.BoundsRect := FormRestoredSize; 284 271 end; 285 272 if FormFullScreen then SetFullScreen(True); … … 290 277 begin 291 278 Self.Form := Form; 292 FormNormalSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height); 293 if not FormFullScreen then 294 FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth, 295 Form.RestoredHeight); 296 FormWindowState := Form.WindowState; 279 if not FormFullScreen then begin 280 FormWindowState := Form.WindowState; 281 if FormWindowState = wsMaximized then begin 282 FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth, 283 Form.RestoredHeight); 284 end else 285 if FormWindowState = wsNormal then begin 286 FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height); 287 end; 288 end; 297 289 SaveToRegistry(RegistryContext); 298 290 SaveControl(Form); … … 312 304 if State then begin 313 305 FormFullScreen := True; 314 FormNormalSize := Form.BoundsRect; 315 FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth, 316 Form.RestoredHeight); 306 if Form.WindowState = wsMaximized then begin 307 FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth, 308 Form.RestoredHeight); 309 end else 310 if Form.WindowState = wsNormal then begin 311 FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height); 312 end; 317 313 FormWindowState := Form.WindowState; 314 Form.WindowState := wsMaximized; 315 Form.WindowState := wsNormal; 318 316 ShowWindow(Form.Handle, SW_SHOWFULLSCREEN); 319 317 {$IFDEF WINDOWS} … … 327 325 ShowWindow(Form.Handle, SW_SHOWNORMAL); 328 326 if FormWindowState = wsNormal then begin 329 Form.BoundsRect := FormNormalSize; 327 Form.WindowState := wsNormal; 328 Form.BoundsRect := FormRestoredSize; 330 329 end else 331 330 if FormWindowState = wsMaximized then begin -
trunk/tunneler.lpi
r62 r63 50 50 <Debugging> 51 51 <GenerateDebugInfo Value="False"/> 52 <DebugInfoType Value="dsDwarf2Set"/> 52 53 <UseLineInfoUnit Value="False"/> 53 54 </Debugging>
Note:
See TracChangeset
for help on using the changeset viewer.