Code:
procedure TTheProbe.RenderAudioOptions;
var
x,y: Integer;
GuiFont: Integer;
ValueF: Single;
begin
GuiFont := FGUIFont;
FGUI.Prepare;
FGUI.SetFontColor(255,255,255,255);
FGUI.SetBackgroundColor(64,64,64,255);
FGUI.StartWindow(100,100,270,218,'Audio Options',App_SysFont);
x := 8;
y := 16;
// music options
if FGUI.DoCheckBox(FMusicEnabled,x,y,'music enabled',GuiFont) then
begin
if not FMusicEnabled then
begin
FMusicVolume := 0;
Audio_SetMusicVol(FMusicVolume)
end;
end;
y := 44;
FGUI.DoLabel(x,y,'music volume',GuiFont,White);
y := 72;
ValueF := FMusicVolume;
if FGUI.DoHorizontalTrackBar(x,
y,
255,
0,1,
ValueF) then
begin
if (ValueF > 0) and not FMusicEnabled then
FMusicEnabled := True;
FMusicVolume := ValueF;
Audio_SetMusicVol(FMusicVolume);
end;
y := 124;
// sfx options
if FGUI.DoCheckBox(FSfxEnabled,x,y,'sfx enabled',GuiFont) then
begin
if not FSfxEnabled then
FSfxVolume := 0;
end;
y := 152;
FGUI.DoLabel(x,y,'sfx volume',GuiFont,White);
y := 180;
ValueF := FSfxVolume;
if FGUI.DoHorizontalTrackBar(x,
y,
255,
0,1,
ValueF) then
begin
if (ValueF > 0) and not FSfxEnabled then
FSfxEnabled := True;
FSfxVolume := ValueF;
end;
FGUI.EndWindow;
FGUI.Finish;
end;
cheers,
Bookmarks