Changeset 681 for trunk/Settings.pas
- Timestamp:
- Jul 26, 2025, 6:31:47 PM (17 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Settings.pas
r674 r681 13 13 14 14 TSettingsDlg = class(TDrawDlg) 15 ButtonMusic: TButtonC; 15 16 ButtonMusicVolumeDown: TButtonC; 16 17 ButtonMusicVolumeUp: TButtonC; … … 33 34 procedure ButtonFullscreenClick(Sender: TObject); 34 35 procedure ButtonCancelClick(Sender: TObject); 36 procedure ButtonMusicClick(Sender: TObject); 35 37 procedure ButtonMusicVolumeDownClick(Sender: TObject); 36 38 procedure ButtonMusicVolumeUpClick(Sender: TObject); … … 54 56 LocalGamma: Integer; 55 57 LocalKeyBindings: TKeyBindings; 58 LocalMusicEnabled: Integer; 56 59 LocalMusicVolume: Integer; 57 60 CurrentKeyBinding: TKeyBinding; … … 59 62 procedure UpdateShortCutItem; 60 63 function GetLocalCustomDpiEnabled: Boolean; 64 function GetLocalMusicEnabled: Boolean; 61 65 procedure UpdateInterface; 62 66 public … … 86 90 var 87 91 SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary, 88 SLanguages, SKeyBindings, SCustomDpi, SDpi, SMusic : string;92 SLanguages, SKeyBindings, SCustomDpi, SDpi, SMusic, SMusicVolume: string; 89 93 90 94 procedure ReloadLanguages; … … 100 104 SDpi := Phrases.Lookup('SETTINGS', 8); 101 105 SMusic := Phrases.Lookup('SETTINGS', 9); 106 SMusicVolume := Phrases.Lookup('SETTINGS', 10); 102 107 end; 103 108 … … 123 128 end; 124 129 130 procedure TSettingsDlg.ButtonMusicClick(Sender: TObject); 131 begin 132 ButtonMusic.ButtonIndex := ButtonMusic.ButtonIndex xor 1; 133 UpdateInterface; 134 end; 135 125 136 procedure TSettingsDlg.ButtonMusicVolumeDownClick(Sender: TObject); 126 137 begin … … 142 153 ListLanguages.ItemIndex := 0; 143 154 ButtonFullscreen.ButtonIndex := 3; 155 ButtonMusic.ButtonIndex := 3; 144 156 LocalMusicVolume := 50; 145 157 ButtonCustomDpi.ButtonIndex := 2; … … 258 270 {$ENDIF} 259 271 260 UnderlinedTitleValue(Canvas, SMusic, IntToStr(LocalMusicVolume) + '%', 272 RFrame(Canvas, ButtonMusic.Left - 1, ButtonMusic.Top - 1, 273 ButtonMusic.Left + 12, ButtonMusic.Top + 12, MainTexture.ColorBevelShade, 274 MainTexture.ColorBevelLight); 275 LoweredTextOut(Canvas, -2, MainTexture, ButtonMusic.Left + TextDistanceX, 276 ButtonMusic.Top - 4, SMusic); 277 UnderlinedTitleValue(Canvas, SMusicVolume, IntToStr(LocalMusicVolume) + '%', 261 278 ButtonMusicVolumeUp.Left - UpDownTextWidth - 4, ButtonMusicVolumeUp.Top + 2, UpDownTextWidth); 262 279 … … 367 384 end; 368 385 386 function TSettingsDlg.GetLocalMusicEnabled: Boolean; 387 begin 388 Result := (ButtonMusic.ButtonIndex and 1) = 1; 389 end; 390 369 391 procedure TSettingsDlg.UpdateInterface; 370 392 begin 371 393 ButtonDpiUp.Enabled := GetLocalCustomDpiEnabled; 372 394 ButtonDpiDown.Enabled := GetLocalCustomDpiEnabled; 395 ButtonMusicVolumeDown.Enabled := GetLocalMusicEnabled; 396 ButtonMusicVolumeUp.Enabled := GetLocalMusicEnabled; 373 397 end; 374 398 … … 381 405 if FullScreen then ButtonFullscreen.ButtonIndex := 3 382 406 else ButtonFullscreen.ButtonIndex := 2; 383 if MusicEnabled then LocalMusicVolume := Round(MusicVolume * 100) 384 else LocalMusicVolume := 0; 407 if MusicEnabled then ButtonMusic.ButtonIndex := 3 408 else ButtonMusic.ButtonIndex := 2; 409 LocalMusicVolume := Round(MusicVolume * 100); 385 410 LocalGamma := Gamma; 386 411 LocalKeyBindings.Assign(KeyBindings.KeyBindings); … … 406 431 end; 407 432 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 408 MusicEnabled := LocalMusicVolume > 0;433 MusicEnabled := GetLocalMusicEnabled; 409 434 MusicVolume := LocalMusicVolume / 100; 410 435 Gamma := LocalGamma;
Note:
See TracChangeset
for help on using the changeset viewer.