- Fixed frmLightLevel to repaint the game window (when the slider changes)
This commit is contained in:
parent
8332241ab7
commit
46d045a46b
|
@ -1,48 +1,50 @@
|
||||||
unit UfrmLightlevel;
|
unit UfrmLightlevel;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
ExtCtrls, ComCtrls, UfrmToolWindow;
|
ExtCtrls, ComCtrls, UfrmToolWindow;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TfrmLightlevel }
|
{ TfrmLightlevel }
|
||||||
|
|
||||||
TfrmLightlevel = class(TfrmToolWindow)
|
TfrmLightlevel = class(TfrmToolWindow)
|
||||||
tbLightlevel: TTrackBar;
|
tbLightlevel: TTrackBar;
|
||||||
procedure tbLightlevelChange(Sender: TObject);
|
procedure tbLightlevelChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
frmLightlevel: TfrmLightlevel;
|
frmLightlevel: TfrmLightlevel;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
UfrmMain;
|
UfrmMain;
|
||||||
|
|
||||||
{ TfrmLightlevel }
|
{ TfrmLightlevel }
|
||||||
|
|
||||||
procedure TfrmLightlevel.tbLightlevelChange(Sender: TObject);
|
procedure TfrmLightlevel.tbLightlevelChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if frmMain.LightManager.LightLevel = 0 then
|
if frmMain.LightManager.LightLevel = 0 then
|
||||||
begin
|
begin
|
||||||
frmMain.LightManager.LightLevel := tbLightlevel.Position;
|
frmMain.LightManager.LightLevel := tbLightlevel.Position;
|
||||||
frmMain.InvalidateFilter;
|
frmMain.InvalidateFilter;
|
||||||
end else
|
end else
|
||||||
frmMain.LightManager.LightLevel := tbLightlevel.Position;
|
frmMain.LightManager.LightLevel := tbLightlevel.Position;
|
||||||
end;
|
|
||||||
|
frmMain.oglGameWindow.Repaint;
|
||||||
initialization
|
end;
|
||||||
{$I UfrmLightlevel.lrs}
|
|
||||||
|
initialization
|
||||||
end.
|
{$I UfrmLightlevel.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue