- Added lightlevel slider

This commit is contained in:
Andreas Schneider 2009-12-21 20:12:45 +01:00
parent 3ffe710c31
commit 21e398ae92
8 changed files with 1016 additions and 881 deletions

View File

@ -5,6 +5,7 @@
<General> <General>
<Flags> <Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/> <MainUnitHasUsesSectionForAllUnits Value="False"/>
<AlwaysBuild Value="False"/>
<LRSInOutputDirectory Value="False"/> <LRSInOutputDirectory Value="False"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
@ -56,7 +57,7 @@
<MinVersion Major="4" Minor="5" Release="1" Valid="True"/> <MinVersion Major="4" Minor="5" Release="1" Valid="True"/>
</Item5> </Item5>
</RequiredPackages> </RequiredPackages>
<Units Count="45"> <Units Count="46">
<Unit0> <Unit0>
<Filename Value="CentrED.lpr"/> <Filename Value="CentrED.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -320,6 +321,13 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ULightProvider"/> <UnitName Value="ULightProvider"/>
</Unit44> </Unit44>
<Unit45>
<Filename Value="Tools/UfrmLightlevel.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmLightlevel"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="UfrmLightlevel"/>
</Unit45>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -0,0 +1,22 @@
inherited frmLightlevel: TfrmLightlevel
Height = 171
Width = 40
ActiveControl = tbLightlevel
Caption = 'Lightlevel'
ClientHeight = 171
ClientWidth = 40
object tbLightlevel: TTrackBar[0]
Left = 0
Height = 171
Top = 0
Width = 40
Max = 32
OnChange = tbLightlevelChange
Orientation = trVertical
Position = 0
Align = alClient
TabOrder = 0
end
inherited tmClose: TTimer[1]
end
end

View File

@ -0,0 +1,48 @@
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.

View File

@ -78,7 +78,7 @@ uses
UGameResources, UfrmAccountControl, UfrmEditAccount, UfrmDrawSettings, UGameResources, UfrmAccountControl, UfrmEditAccount, UfrmDrawSettings,
UfrmBoundaries, UfrmElevateSettings, UfrmConfirmation, UfrmMoveSettings, UfrmBoundaries, UfrmElevateSettings, UfrmConfirmation, UfrmMoveSettings,
UfrmAbout, UfrmHueSettings, UfrmRadar, UfrmLargeScaleCommand, UfrmAbout, UfrmHueSettings, UfrmRadar, UfrmLargeScaleCommand,
UfrmVirtualLayer, UfrmFilter, UfrmRegionControl; UfrmVirtualLayer, UfrmFilter, UfrmRegionControl, UfrmLightlevel;
{$I version.inc} {$I version.inc}
@ -210,6 +210,7 @@ begin
frmBoundaries := TfrmBoundaries.Create(frmMain); frmBoundaries := TfrmBoundaries.Create(frmMain);
frmFilter := TfrmFilter.Create(frmMain); frmFilter := TfrmFilter.Create(frmMain);
frmVirtualLayer := TfrmVirtualLayer.Create(frmMain); frmVirtualLayer := TfrmVirtualLayer.Create(frmMain);
frmLightlevel := TfrmLightlevel.Create(frmMain);
frmAbout := TfrmAbout.Create(frmMain); frmAbout := TfrmAbout.Create(frmMain);
frmMain.Show; frmMain.Show;
frmInitialize.Hide; frmInitialize.Hide;
@ -306,6 +307,7 @@ begin
FreeAndNil(frmRegionControl); FreeAndNil(frmRegionControl);
FreeAndNil(frmLargeScaleCommand); FreeAndNil(frmLargeScaleCommand);
FreeAndNil(frmRadarMap); FreeAndNil(frmRadarMap);
FreeAndNil(frmLightlevel);
if frmMain <> nil then if frmMain <> nil then
begin begin

View File

@ -25,7 +25,7 @@ object frmLogin: TfrmLogin
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 18 Height = 19
Top = 239 Top = 239
Width = 481 Width = 481
Alignment = taCenter Alignment = taCenter
@ -439,7 +439,7 @@ object frmLogin: TfrmLogin
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 330 Left = 330
Height = 76 Height = 78
Top = 12 Top = 12
Width = 143 Width = 143
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
@ -447,7 +447,7 @@ object frmLogin: TfrmLogin
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
ClientHeight = 74 ClientHeight = 76
ClientWidth = 141 ClientWidth = 141
TabOrder = 2 TabOrder = 2
object btnOK: TButton object btnOK: TButton
@ -515,7 +515,7 @@ object frmLogin: TfrmLogin
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 4 BorderSpacing.Top = 4
BorderSpacing.Right = 8 BorderSpacing.Right = 8
Caption = 'Select the directory containing art.mul, artidx.mul, hues.mul, tiledata.mul, animdata.mul, texmaps.mul and texidx.mul.' Caption = 'Select the directory containing art.mul, artidx.mul, hues.mul, tiledata.mul, animdata.mul, texmaps.mul, texidx.mul, light.mul and lightidx.mul.'
ParentColor = False ParentColor = False
WordWrap = True WordWrap = True
end end
@ -544,7 +544,7 @@ object frmLogin: TfrmLogin
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 330 Left = 330
Height = 85 Height = 85
Top = 96 Top = 98
Width = 143 Width = 143
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoSize = True AutoSize = True

View File

@ -110,7 +110,9 @@ begin
(not FileExists(path + 'tiledata.mul')) or (not FileExists(path + 'tiledata.mul')) or
(not FileExists(path + 'animdata.mul')) or (not FileExists(path + 'animdata.mul')) or
(not FileExists(path + 'texmaps.mul')) or (not FileExists(path + 'texmaps.mul')) or
(not FileExists(path + 'texidx.mul')) then (not FileExists(path + 'texidx.mul')) or
(not FileExists(path + 'light.mul')) or
(not FileExists(path + 'lightidx.mul')) then
begin begin
MessageDlg('Incorrect directory', 'The data path you specified does not ' MessageDlg('Incorrect directory', 'The data path you specified does not '
+ 'seem to be correct.', mtWarning, [mbOK], 0); + 'seem to be correct.', mtWarning, [mbOK], 0);

View File

@ -968,14 +968,14 @@ object frmMain: TfrmMain
OnClick = tbStaticsClick OnClick = tbStaticsClick
end end
object tbSeparator5: TToolButton object tbSeparator5: TToolButton
Left = 415 Left = 438
Top = 2 Top = 2
Width = 17 Width = 17
Caption = 'tbSeparator5' Caption = 'tbSeparator5'
Style = tbsDivider Style = tbsDivider
end end
object tbRadarMap: TToolButton object tbRadarMap: TToolButton
Left = 432 Left = 455
Hint = 'Radar Map' Hint = 'Radar Map'
Top = 2 Top = 2
Caption = 'Radar Map' Caption = 'Radar Map'
@ -997,7 +997,7 @@ object frmMain: TfrmMain
OnMouseMove = tbFilterMouseMove OnMouseMove = tbFilterMouseMove
end end
object tbFlat: TToolButton object tbFlat: TToolButton
Left = 380 Left = 403
Top = 2 Top = 2
Action = acFlat Action = acFlat
DropdownMenu = pmFlatViewSettings DropdownMenu = pmFlatViewSettings
@ -1021,6 +1021,11 @@ object frmMain: TfrmMain
Top = 2 Top = 2
Action = acUndo Action = acUndo
end end
object ToolButton1: TToolButton
Left = 380
Top = 2
Action = acLightlevel
end
end end
object pnlChatHeader: TPanel object pnlChatHeader: TPanel
AnchorSideLeft.Control = pnlChat AnchorSideLeft.Control = pnlChat
@ -1456,7 +1461,7 @@ object frmMain: TfrmMain
left = 264 left = 264
top = 32 top = 32
Bitmap = { Bitmap = {
4C69150000001000000010000000000000000000000000000000000000000000 4C69160000001000000010000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000D9A781FFD39E76FF00000000000000000000000000000000000000000000 0000D9A781FFD39E76FF00000000000000000000000000000000000000000000
0000000000000000000000000000ECBEA1FFE7BB9DFFE4B697FFE0B292FFDAAE 0000000000000000000000000000ECBEA1FFE7BB9DFFE4B697FFE0B292FFDAAE
@ -2128,6 +2133,38 @@ object frmMain: TfrmMain
3DD2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 3DD2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0036813C03337D FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0036813C03337D
3978FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 3978FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B0E2
F55CA7DCF5B59DD9F5E291D1F1F782CBF0F876C4EFED6DBFEDD177C3EE80FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00AFE0F619ADDEF6B7B7E4
F8FFC7ECFBFFD7F3FCFFE1F7FDFFE2F8FEFFD8F0FCFFB6DFF8FF6BBBEDFF56AF
E8DE77BEEC2CFFFFFF00FFFFFF00FFFFFF00B2E1F50BA2DBF4CAC3EBFAFFE2F9
FDFFE0F9FDFFD5F7FDFFCFF6FDFFC9F4FCFFC7F4FCFFD6F9FDFFEBFAFEFF90CA
F2FF43A2E4ED78BEE917FFFFFF00FFFFFF0098D6F489B4E3F8FFE5FAFEFFDBF8
FDFFE4FAFEFFF0FCFEFFF9FEFFFFF9FEFFFFEFFCFEFFD2F6FDFFB4F1FBFFEDFD
FFFF6BB3EAFF58A9E4B6FFFFFF00FFFFFF0088CDF1E4D2EFFBFFDBF9FEFFDFF9
FDFFECFBFEFFEEFCFEFFEFFCFEFFEFFCFEFFEBFBFEFFE0F9FEFFB8F1FBFFA8F1
FBFFCBE5F8FF3892DCF7FFFFFF00FFFFFF007BC5EEF9DFF6FDFFC8F5FCFFCDF6
FCFFD6F7FDFFD3F4FCFFCFF2FCFFCAF1FBFFC4F0FCFFBAF2FBFF96EAF8FF72E5
F7FFE2F4FDFF3189D8FEFFFFFF00FFFFFF006FBEECE3C9E9F9FFD4F9FDFF7CE3
F7FF86E5F8FF60B1EFFF68B5EFFF63B4EFFF4CA6ECFF82E4F7FF59DCF5FF8AEB
FAFFCBE2F7FF338BD9F7FFFFFF00FFFFFF0078C0EC888BC8EFFFECFCFEFF77E1
F7FF2F99EAFF75E1F6FF74E1F6FF68DEF5FF73E1F6FF0986E6FF46D5F3FFDCFE
FEFF6FAAE5FF4C99DEBFFFFFFF00FFFFFF0080C6F00468B5E9D8A5D4F3FFDCFA
FEFF38A1EBFF74E1F6FF6AE4F6FF5DE2F5FF72E0F6FF1691E8FFC0F5FDFFACCE
F1FF2780D6F86FAEE425FFFFFF00FFFFFF00FFFFFF0078BDEB2F5CACE7EBA6D3
F3FF65AEF0FF74E1F6FF73E1F6FF72E0F6FF71E0F6FF4CA3ECFF9CC3EFFF297F
D6FB65A8E25AFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0075B9EA3461A7
DEE7469DE6FF4BBEF7FF47E6FDFF41E5FDFF51C3FBFF167CDEFF3382D1F266AA
E346FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0085A7
BF4B638195FA7A95A3FF3A8A98FF357F8CFF606E76FF2D4357FE7FA2BE40FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0068777DE2A6A5A2FFA8A2A2FF9D9998FF948F8BFF434B53EBFFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF005F6E77C6BCBCBBFFEBEAEAFFCDCCCCFFA3A19FFF3F4C55DBFFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF0088A7BB5D485055F5444545FE3F4141FE3F474AF67D9CB16AFFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00 FF00FFFFFF00FFFFFF00FFFFFF00
} }
end end
@ -2609,6 +2646,13 @@ object frmMain: TfrmMain
OnExecute = acUndoExecute OnExecute = acUndoExecute
ShortCut = 16474 ShortCut = 16474
end end
object acLightlevel: TAction
Category = 'Settings'
Caption = 'Lightlevel'
Hint = 'Set Lightlevel'
ImageIndex = 21
OnExecute = acLightlevelExecute
end
end end
object tmGrabTileInfo: TTimer object tmGrabTileInfo: TTimer
Enabled = False Enabled = False

View File

@ -68,6 +68,7 @@ type
acFilter: TAction; acFilter: TAction;
acFlat: TAction; acFlat: TAction;
acNoDraw: TAction; acNoDraw: TAction;
acLightlevel: TAction;
acUndo: TAction; acUndo: TAction;
acVirtualLayer: TAction; acVirtualLayer: TAction;
ActionList1: TActionList; ActionList1: TActionList;
@ -147,6 +148,7 @@ type
tbNoDraw: TToolButton; tbNoDraw: TToolButton;
tbSeparator2: TToolButton; tbSeparator2: TToolButton;
tbUndo: TToolButton; tbUndo: TToolButton;
ToolButton1: TToolButton;
tsLocations: TTabSheet; tsLocations: TTabSheet;
tbSetHue: TToolButton; tbSetHue: TToolButton;
tmGrabTileInfo: TTimer; tmGrabTileInfo: TTimer;
@ -181,6 +183,7 @@ type
procedure acFilterExecute(Sender: TObject); procedure acFilterExecute(Sender: TObject);
procedure acFlatExecute(Sender: TObject); procedure acFlatExecute(Sender: TObject);
procedure acHueExecute(Sender: TObject); procedure acHueExecute(Sender: TObject);
procedure acLightlevelExecute(Sender: TObject);
procedure acMoveExecute(Sender: TObject); procedure acMoveExecute(Sender: TObject);
procedure acNoDrawExecute(Sender: TObject); procedure acNoDrawExecute(Sender: TObject);
procedure acSelectExecute(Sender: TObject); procedure acSelectExecute(Sender: TObject);
@ -373,6 +376,7 @@ type
property Landscape: TLandscape read FLandscape; property Landscape: TLandscape read FLandscape;
property CurrentTile: TWorldItem read FCurrentTile write SetCurrentTile; property CurrentTile: TWorldItem read FCurrentTile write SetCurrentTile;
property SelectedTile: TWorldItem read FSelectedTile write SetSelectedTile; property SelectedTile: TWorldItem read FSelectedTile write SetSelectedTile;
property LightManager: TLightManager read FLightManager;
{ Methods } { Methods }
procedure InvalidateFilter; procedure InvalidateFilter;
procedure InvalidateScreenBuffer; procedure InvalidateScreenBuffer;
@ -395,7 +399,7 @@ uses
UfrmBoundaries, UfrmElevateSettings, UfrmConfirmation, UfrmMoveSettings, UfrmBoundaries, UfrmElevateSettings, UfrmConfirmation, UfrmMoveSettings,
UfrmAbout, UPacketHandlers, UfrmHueSettings, UfrmRadar, UfrmLargeScaleCommand, UfrmAbout, UPacketHandlers, UfrmHueSettings, UfrmRadar, UfrmLargeScaleCommand,
UfrmLogin, UResourceManager, UfrmVirtualLayer, UfrmFilter, UfrmRegionControl, UfrmLogin, UResourceManager, UfrmVirtualLayer, UfrmFilter, UfrmRegionControl,
Logging, LConvEncoding, LCLType; Logging, LConvEncoding, LCLType, UfrmLightlevel;
type type
TGLArrayf4 = array[0..3] of GLfloat; TGLArrayf4 = array[0..3] of GLfloat;
@ -1171,6 +1175,11 @@ begin
frmHueSettings.Show; frmHueSettings.Show;
end; end;
procedure TfrmMain.acLightlevelExecute(Sender: TObject);
begin
frmLightlevel.Show;
end;
procedure TfrmMain.acMoveExecute(Sender: TObject); procedure TfrmMain.acMoveExecute(Sender: TObject);
begin begin
acMove.Checked := True; acMove.Checked := True;