From 46d045a46bcb1e1825f6a7343dacc1d88eacc658 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 23 Dec 2009 17:12:58 +0100 Subject: [PATCH] - Fixed frmLightLevel to repaint the game window (when the slider changes) --- Client/Tools/UfrmLightlevel.pas | 98 +++++++++++++++++---------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/Client/Tools/UfrmLightlevel.pas b/Client/Tools/UfrmLightlevel.pas index 58f4047..6bd4e55 100644 --- a/Client/Tools/UfrmLightlevel.pas +++ b/Client/Tools/UfrmLightlevel.pas @@ -1,48 +1,50 @@ -unit UfrmLightlevel; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, - ExtCtrls, ComCtrls, UfrmToolWindow; - -type - - { TfrmLightlevel } - - TfrmLightlevel = class(TfrmToolWindow) - tbLightlevel: TTrackBar; - procedure tbLightlevelChange(Sender: TObject); - private - { private declarations } - public - { public declarations } - end; - -var - frmLightlevel: TfrmLightlevel; - -implementation - -uses - UfrmMain; - -{ TfrmLightlevel } - -procedure TfrmLightlevel.tbLightlevelChange(Sender: TObject); -begin - if frmMain.LightManager.LightLevel = 0 then - begin - frmMain.LightManager.LightLevel := tbLightlevel.Position; - frmMain.InvalidateFilter; - end else - frmMain.LightManager.LightLevel := tbLightlevel.Position; -end; - -initialization - {$I UfrmLightlevel.lrs} - -end. - +unit UfrmLightlevel; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + ExtCtrls, ComCtrls, UfrmToolWindow; + +type + + { TfrmLightlevel } + + TfrmLightlevel = class(TfrmToolWindow) + tbLightlevel: TTrackBar; + procedure tbLightlevelChange(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + frmLightlevel: TfrmLightlevel; + +implementation + +uses + UfrmMain; + +{ TfrmLightlevel } + +procedure TfrmLightlevel.tbLightlevelChange(Sender: TObject); +begin + if frmMain.LightManager.LightLevel = 0 then + begin + frmMain.LightManager.LightLevel := tbLightlevel.Position; + frmMain.InvalidateFilter; + end else + frmMain.LightManager.LightLevel := tbLightlevel.Position; + + frmMain.oglGameWindow.Repaint; +end; + +initialization + {$I UfrmLightlevel.lrs} + +end. +