Changeset 666 for trunk/Start.pas
- Timestamp:
- Jul 9, 2025, 10:36:23 PM (14 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r664 r666 123 123 LastGame: string; 124 124 LastMap: string; 125 procedure UpdateMusic; 125 126 procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 126 127 procedure InitPopup(PlayerIndex: Integer); … … 337 338 338 339 procedure TStartDlg.SmartInvalidate(x0, y0, x1, y1: Integer; 339 invalidateTab0: Boolean);340 InvalidateTab0: Boolean); 340 341 var 341 342 I: Integer; … … 414 415 else ScreenMode := 1; 415 416 FullScreen := ScreenMode > 0; 417 if ValueExists('MusicEnabled') then MusicEnabled := ReadBool('MusicEnabled') 418 else MusicEnabled := True; 419 if ValueExists('MusicVolume') then MusicVolume := ReadFloat('MusicVolume') 420 else MusicVolume := 0.5; 416 421 if ValueExists('TermLeft') then TermBounds.Left := ReadInteger('TermLeft') 417 422 else TermBounds.Left := 0; … … 460 465 if FullScreen then WriteInteger('ScreenMode', 1) 461 466 else WriteInteger('ScreenMode', 0); 467 WriteBool('MusicEnabled', MusicEnabled); 468 WriteFloat('MusicVolume', MusicVolume); 462 469 WriteInteger('TermWidth', TermBounds.Width); 463 470 WriteInteger('TermHeight', TermBounds.Height); … … 537 544 UpdateInterface; 538 545 Background.UpdateInterface; 546 UpdateMusic; 539 547 end; 540 548 FreeAndNil(SettingsDlg); … … 943 951 Background.Enabled := False; 944 952 945 MusicPlayer.LoadPlaylistFromDir(GetMusicDir + DirectorySeparator + 'Start'); 946 MusicPlayer.RandomizePlaylist; 947 if MusicPlayer.Playlist.Count > 0 then MusicPlayer.Play; 953 UpdateMusic; 948 954 end; 949 955 … … 1961 1967 end; 1962 1968 1969 procedure TStartDlg.UpdateMusic; 1970 begin 1971 if MusicEnabled then begin 1972 MusicPlayer.Volume := MusicVolume; 1973 if not MusicPlayer.Playing then begin 1974 MusicPlayer.LoadPlaylistFromDir(GetMusicDir + DirectorySeparator + 'Start'); 1975 MusicPlayer.RandomizePlaylist; 1976 if MusicPlayer.Playlist.Count > 0 then MusicPlayer.Play; 1977 end; 1978 end else begin 1979 if MusicPlayer.Playing then MusicPlayer.Stop; 1980 end; 1981 end; 1982 1963 1983 end.
Note:
See TracChangeset
for help on using the changeset viewer.