* Fixed compilation with current Lazarus/LCL
This commit is contained in:
parent
395c8fbe96
commit
88e18b7659
|
@ -25,7 +25,7 @@
|
||||||
<Item1 Name="default" Default="True"/>
|
<Item1 Name="default" Default="True"/>
|
||||||
<Item2 Name="Release Win32">
|
<Item2 Name="Release Win32">
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="../bin/CentrED"/>
|
<Filename Value="../bin/CentrED"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<DebugInfoType Value="dsAuto"/>
|
<GenerateDebugInfo Value="False"/>
|
||||||
<UseLineInfoUnit Value="False"/>
|
<UseLineInfoUnit Value="False"/>
|
||||||
<StripSymbols Value="True"/>
|
<StripSymbols Value="True"/>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
</Item2>
|
</Item2>
|
||||||
<Item3 Name="Release Linux GTK2 x86">
|
<Item3 Name="Release Linux GTK2 x86">
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="../bin/CentrED"/>
|
<Filename Value="../bin/CentrED"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<DebugInfoType Value="dsAuto"/>
|
<GenerateDebugInfo Value="False"/>
|
||||||
<UseLineInfoUnit Value="False"/>
|
<UseLineInfoUnit Value="False"/>
|
||||||
<StripSymbols Value="True"/>
|
<StripSymbols Value="True"/>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
|
@ -431,7 +431,7 @@
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="10"/>
|
<Version Value="11"/>
|
||||||
<Target>
|
<Target>
|
||||||
<Filename Value="../bin/CentrED"/>
|
<Filename Value="../bin/CentrED"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -455,7 +455,6 @@
|
||||||
</CodeGeneration>
|
</CodeGeneration>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<GenerateDebugInfo Value="True"/>
|
|
||||||
<DebugInfoType Value="dsStabs"/>
|
<DebugInfoType Value="dsStabs"/>
|
||||||
<UseHeaptrc Value="True"/>
|
<UseHeaptrc Value="True"/>
|
||||||
</Debugging>
|
</Debugging>
|
||||||
|
|
|
@ -858,11 +858,11 @@ object frmMain: TfrmMain
|
||||||
object tbSeparator1: TToolButton
|
object tbSeparator1: TToolButton
|
||||||
Left = 24
|
Left = 24
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 4
|
Width = 5
|
||||||
Style = tbsDivider
|
Style = tbsDivider
|
||||||
end
|
end
|
||||||
object tbSelect: TToolButton
|
object tbSelect: TToolButton
|
||||||
Left = 28
|
Left = 29
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acSelect
|
Action = acSelect
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -871,7 +871,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbDrawTile: TToolButton
|
object tbDrawTile: TToolButton
|
||||||
Left = 51
|
Left = 52
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acDraw
|
Action = acDraw
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -880,7 +880,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbMoveTile: TToolButton
|
object tbMoveTile: TToolButton
|
||||||
Left = 74
|
Left = 75
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acMove
|
Action = acMove
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -889,7 +889,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbElevateTile: TToolButton
|
object tbElevateTile: TToolButton
|
||||||
Left = 97
|
Left = 98
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acElevate
|
Action = acElevate
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -898,7 +898,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbDeleteTile: TToolButton
|
object tbDeleteTile: TToolButton
|
||||||
Left = 120
|
Left = 121
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acDelete
|
Action = acDelete
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -907,7 +907,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbSetHue: TToolButton
|
object tbSetHue: TToolButton
|
||||||
Left = 143
|
Left = 144
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acHue
|
Action = acHue
|
||||||
Grouped = True
|
Grouped = True
|
||||||
|
@ -916,28 +916,28 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbSeparator3: TToolButton
|
object tbSeparator3: TToolButton
|
||||||
Left = 193
|
Left = 195
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 4
|
Width = 5
|
||||||
Caption = 'tbSeparator3'
|
Caption = 'tbSeparator3'
|
||||||
Style = tbsDivider
|
Style = tbsDivider
|
||||||
end
|
end
|
||||||
object tbBoundaries: TToolButton
|
object tbBoundaries: TToolButton
|
||||||
Left = 197
|
Left = 200
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acBoundaries
|
Action = acBoundaries
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
end
|
end
|
||||||
object tbSeparator4: TToolButton
|
object tbSeparator4: TToolButton
|
||||||
Left = 266
|
Left = 269
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 4
|
Width = 5
|
||||||
Caption = 'tbSeparator4'
|
Caption = 'tbSeparator4'
|
||||||
Style = tbsDivider
|
Style = tbsDivider
|
||||||
end
|
end
|
||||||
object tbTerrain: TToolButton
|
object tbTerrain: TToolButton
|
||||||
Left = 270
|
Left = 274
|
||||||
Hint = 'Show Terrain'
|
Hint = 'Show Terrain'
|
||||||
Top = 2
|
Top = 2
|
||||||
Caption = 'Terrain'
|
Caption = 'Terrain'
|
||||||
|
@ -949,7 +949,7 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbStatics: TToolButton
|
object tbStatics: TToolButton
|
||||||
Left = 293
|
Left = 297
|
||||||
Hint = 'Show Statics'
|
Hint = 'Show Statics'
|
||||||
Top = 2
|
Top = 2
|
||||||
Caption = 'Statics'
|
Caption = 'Statics'
|
||||||
|
@ -961,14 +961,14 @@ object frmMain: TfrmMain
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbSeparator5: TToolButton
|
object tbSeparator5: TToolButton
|
||||||
Left = 420
|
Left = 424
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 4
|
Width = 5
|
||||||
Caption = 'tbSeparator5'
|
Caption = 'tbSeparator5'
|
||||||
Style = tbsDivider
|
Style = tbsDivider
|
||||||
end
|
end
|
||||||
object tbRadarMap: TToolButton
|
object tbRadarMap: TToolButton
|
||||||
Left = 424
|
Left = 429
|
||||||
Hint = 'Radar Map'
|
Hint = 'Radar Map'
|
||||||
Top = 2
|
Top = 2
|
||||||
Caption = 'Radar Map'
|
Caption = 'Radar Map'
|
||||||
|
@ -978,49 +978,49 @@ object frmMain: TfrmMain
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
end
|
end
|
||||||
object tbVirtualLayer: TToolButton
|
object tbVirtualLayer: TToolButton
|
||||||
Left = 220
|
Left = 223
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acVirtualLayer
|
Action = acVirtualLayer
|
||||||
end
|
end
|
||||||
object tbFilter: TToolButton
|
object tbFilter: TToolButton
|
||||||
Left = 243
|
Left = 246
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acFilter
|
Action = acFilter
|
||||||
OnMouseMove = tbFilterMouseMove
|
OnMouseMove = tbFilterMouseMove
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbFlat: TToolButton
|
object tbFlat: TToolButton
|
||||||
Left = 385
|
Left = 389
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acFlat
|
Action = acFlat
|
||||||
DropdownMenu = pmFlatViewSettings
|
DropdownMenu = pmFlatViewSettings
|
||||||
Style = tbsDropDown
|
Style = tbsDropDown
|
||||||
end
|
end
|
||||||
object tbNoDraw: TToolButton
|
object tbNoDraw: TToolButton
|
||||||
Left = 316
|
Left = 320
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acNoDraw
|
Action = acNoDraw
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
end
|
end
|
||||||
object tbSeparator2: TToolButton
|
object tbSeparator2: TToolButton
|
||||||
Left = 166
|
Left = 167
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 4
|
Width = 5
|
||||||
Caption = 'tbSeparator2'
|
Caption = 'tbSeparator2'
|
||||||
Style = tbsDivider
|
Style = tbsDivider
|
||||||
end
|
end
|
||||||
object tbUndo: TToolButton
|
object tbUndo: TToolButton
|
||||||
Left = 170
|
Left = 172
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acUndo
|
Action = acUndo
|
||||||
end
|
end
|
||||||
object tbLightlevel: TToolButton
|
object tbLightlevel: TToolButton
|
||||||
Left = 362
|
Left = 366
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acLightlevel
|
Action = acLightlevel
|
||||||
end
|
end
|
||||||
object tbWalkable: TToolButton
|
object tbWalkable: TToolButton
|
||||||
Left = 339
|
Left = 343
|
||||||
Top = 2
|
Top = 2
|
||||||
Action = acWalkable
|
Action = acWalkable
|
||||||
Style = tbsCheck
|
Style = tbsCheck
|
||||||
|
|
|
@ -646,7 +646,7 @@ var
|
||||||
blockInfo: PBlockInfo;
|
blockInfo: PBlockInfo;
|
||||||
targetRect: TRect;
|
targetRect: TRect;
|
||||||
offsetX, offsetY: Integer;
|
offsetX, offsetY: Integer;
|
||||||
tile: TWorldItem;
|
item: TWorldItem;
|
||||||
tileX, tileY, newX, newY: Word;
|
tileX, tileY, newX, newY: Word;
|
||||||
targetBlocks: TBlockInfoList;
|
targetBlocks: TBlockInfoList;
|
||||||
targetTile: TWorldItem;
|
targetTile: TWorldItem;
|
||||||
|
@ -704,13 +704,13 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Logger.Send([lcClient, lcDebug], 'Virtual tiles', FVirtualTiles.Count);
|
Logger.Send([lcClient, lcDebug], 'Virtual tiles', FVirtualTiles.Count);
|
||||||
for tile in FVirtualTiles do
|
for item in FVirtualTiles do
|
||||||
begin
|
begin
|
||||||
if tile is TGhostTile then
|
if item is TGhostTile then
|
||||||
begin
|
begin
|
||||||
dmNetwork.Send(TInsertStaticPacket.Create(tile.X, tile.Y, tile.Z,
|
dmNetwork.Send(TInsertStaticPacket.Create(item.X, item.Y, item.Z,
|
||||||
tile.TileID, TGhostTile(tile).Hue));
|
item.TileID, TGhostTile(item).Hue));
|
||||||
FUndoList.Add(TDeleteStaticPacket.Create(TGhostTile(tile)));
|
FUndoList.Add(TDeleteStaticPacket.Create(TGhostTile(item)));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else if (SelectedTile <> targetTile) or targetTile.CanBeEdited then
|
end else if (SelectedTile <> targetTile) or targetTile.CanBeEdited then
|
||||||
|
@ -744,75 +744,75 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if acMove.Checked then //***** Move tile *****//
|
if acMove.Checked then //***** Move item *****//
|
||||||
begin
|
begin
|
||||||
offsetX := frmMoveSettings.GetOffsetX;
|
offsetX := frmMoveSettings.GetOffsetX;
|
||||||
offsetY := frmMoveSettings.GetOffsetY;
|
offsetY := frmMoveSettings.GetOffsetY;
|
||||||
for blockInfo in targetBlocks do
|
for blockInfo in targetBlocks do
|
||||||
begin
|
begin
|
||||||
tile := blockInfo^.Item;
|
item := blockInfo^.Item;
|
||||||
if tile is TStaticItem then
|
if item is TStaticItem then
|
||||||
begin
|
begin
|
||||||
newX := EnsureRange(tile.X + offsetX, 0, FLandscape.CellWidth - 1);
|
newX := EnsureRange(item.X + offsetX, 0, FLandscape.CellWidth - 1);
|
||||||
newY := EnsureRange(tile.Y + offsetY, 0, FLandscape.CellHeight - 1);
|
newY := EnsureRange(item.Y + offsetY, 0, FLandscape.CellHeight - 1);
|
||||||
FUndoList.Add(TMoveStaticPacket.Create(newX, newY, tile.Z,
|
FUndoList.Add(TMoveStaticPacket.Create(newX, newY, item.Z,
|
||||||
tile.TileID, TStaticItem(tile).Hue, tile.X, tile.Y));
|
item.TileID, TStaticItem(item).Hue, item.X, item.Y));
|
||||||
dmNetwork.Send(TMoveStaticPacket.Create(TStaticItem(tile),
|
dmNetwork.Send(TMoveStaticPacket.Create(TStaticItem(item),
|
||||||
newX, newY));
|
newX, newY));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else if acElevate.Checked then //***** Elevate tile *****//
|
end else if acElevate.Checked then //***** Elevate item *****//
|
||||||
begin
|
begin
|
||||||
for blockInfo in targetBlocks do
|
for blockInfo in targetBlocks do
|
||||||
begin
|
begin
|
||||||
tile := blockInfo^.Item;
|
item := blockInfo^.Item;
|
||||||
|
|
||||||
z := frmElevateSettings.seZ.Value;
|
z := frmElevateSettings.seZ.Value;
|
||||||
if frmElevateSettings.rbRaise.Checked then
|
if frmElevateSettings.rbRaise.Checked then
|
||||||
z := EnsureRange(tile.Z + z, -128, 127)
|
z := EnsureRange(item.Z + z, -128, 127)
|
||||||
else if frmElevateSettings.rbLower.Checked then
|
else if frmElevateSettings.rbLower.Checked then
|
||||||
z := EnsureRange(tile.Z - z, -128, 127);
|
z := EnsureRange(item.Z - z, -128, 127);
|
||||||
|
|
||||||
if tile is TMapCell then
|
if item is TMapCell then
|
||||||
begin
|
begin
|
||||||
if frmElevateSettings.cbRandomHeight.Checked then
|
if frmElevateSettings.cbRandomHeight.Checked then
|
||||||
Inc(z, Random(frmElevateSettings.seRandomHeight.Value));
|
Inc(z, Random(frmElevateSettings.seRandomHeight.Value));
|
||||||
FUndoList.Add(TDrawMapPacket.Create(tile.X, tile.Y, tile.Z,
|
FUndoList.Add(TDrawMapPacket.Create(item.X, item.Y, item.Z,
|
||||||
tile.TileID));
|
item.TileID));
|
||||||
dmNetwork.Send(TDrawMapPacket.Create(tile.X, tile.Y, z,
|
dmNetwork.Send(TDrawMapPacket.Create(item.X, item.Y, z,
|
||||||
tile.TileID));
|
item.TileID));
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
FUndoList.Add(TElevateStaticPacket.Create(tile.X, tile.Y,
|
FUndoList.Add(TElevateStaticPacket.Create(item.X, item.Y,
|
||||||
z, tile.TileID, TStaticItem(tile).Hue, tile.Z));
|
z, item.TileID, TStaticItem(item).Hue, item.Z));
|
||||||
dmNetwork.Send(TElevateStaticPacket.Create(TStaticItem(tile), z));
|
dmNetwork.Send(TElevateStaticPacket.Create(TStaticItem(item), z));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else if acDelete.Checked then //***** Delete tile *****//
|
end else if acDelete.Checked then //***** Delete item *****//
|
||||||
begin
|
begin
|
||||||
for blockInfo in targetBlocks do
|
for blockInfo in targetBlocks do
|
||||||
begin
|
begin
|
||||||
tile := blockInfo^.Item;
|
item := blockInfo^.Item;
|
||||||
if tile is TStaticItem then
|
if item is TStaticItem then
|
||||||
begin
|
begin
|
||||||
FUndoList.Add(TInsertStaticPacket.Create(tile.X, tile.Y,
|
FUndoList.Add(TInsertStaticPacket.Create(item.X, item.Y,
|
||||||
tile.Z, tile.TileID, TStaticItem(tile).Hue));
|
item.Z, item.TileID, TStaticItem(item).Hue));
|
||||||
dmNetwork.Send(TDeleteStaticPacket.Create(TStaticItem(tile)));
|
dmNetwork.Send(TDeleteStaticPacket.Create(TStaticItem(item)));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else if acHue.Checked then //***** Hue tile *****//
|
end else if acHue.Checked then //***** Hue item *****//
|
||||||
begin
|
begin
|
||||||
for blockInfo in targetBlocks do
|
for blockInfo in targetBlocks do
|
||||||
begin
|
begin
|
||||||
tile := blockInfo^.Item;
|
item := blockInfo^.Item;
|
||||||
|
|
||||||
if blockInfo^.HueOverride and (tile is TStaticItem) then
|
if blockInfo^.HueOverride and (item is TStaticItem) then
|
||||||
begin
|
begin
|
||||||
if TStaticItem(tile).Hue <> blockInfo^.Hue then
|
if TStaticItem(item).Hue <> blockInfo^.Hue then
|
||||||
begin
|
begin
|
||||||
FUndoList.Add(THueStaticPacket.Create(tile.X, tile.Y, tile.Z,
|
FUndoList.Add(THueStaticPacket.Create(item.X, item.Y, item.Z,
|
||||||
tile.TileID, blockInfo^.Hue, TStaticItem(tile).Hue));
|
item.TileID, blockInfo^.Hue, TStaticItem(item).Hue));
|
||||||
dmNetwork.Send(THueStaticPacket.Create(TStaticItem(tile),
|
dmNetwork.Send(THueStaticPacket.Create(TStaticItem(item),
|
||||||
blockInfo^.Hue));
|
blockInfo^.Hue));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -978,7 +978,7 @@ procedure TfrmMain.btnRandomPresetSaveClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
presetName: string;
|
presetName: string;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
preset, tile: TDOMElement;
|
presetElement, tileElement: TDOMElement;
|
||||||
children: TDOMNodeList;
|
children: TDOMNodeList;
|
||||||
tileNode: PVirtualNode;
|
tileNode: PVirtualNode;
|
||||||
tileInfo: PTileInfo;
|
tileInfo: PTileInfo;
|
||||||
|
@ -986,31 +986,31 @@ begin
|
||||||
presetName := cbRandomPreset.Text;
|
presetName := cbRandomPreset.Text;
|
||||||
if InputQuery('Save Preset', 'Enter the name of the preset:', presetName) then
|
if InputQuery('Save Preset', 'Enter the name of the preset:', presetName) then
|
||||||
begin
|
begin
|
||||||
preset := FindRandomPreset(presetName);
|
presetElement := FindRandomPreset(presetName);
|
||||||
if preset = nil then
|
if presetElement = nil then
|
||||||
begin
|
begin
|
||||||
preset := FRandomPresetsDoc.CreateElement('Preset');
|
presetElement := FRandomPresetsDoc.CreateElement('Preset');
|
||||||
preset.AttribStrings['Name'] := presetName;
|
presetElement.AttribStrings['Name'] := presetName;
|
||||||
FRandomPresetsDoc.DocumentElement.AppendChild(preset);
|
FRandomPresetsDoc.DocumentElement.AppendChild(presetElement);
|
||||||
cbRandomPreset.Items.AddObject(presetName, preset);
|
cbRandomPreset.Items.AddObject(presetName, presetElement);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
children := preset.ChildNodes;
|
children := presetElement.ChildNodes;
|
||||||
for i := children.Count - 1 downto 0 do
|
for i := children.Count - 1 downto 0 do
|
||||||
preset.RemoveChild(children[i]);
|
presetElement.RemoveChild(children[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tileNode := vdtRandom.GetFirst;
|
tileNode := vdtRandom.GetFirst;
|
||||||
while tileNode <> nil do
|
while tileNode <> nil do
|
||||||
begin
|
begin
|
||||||
tileInfo := vdtRandom.GetNodeData(tileNode);
|
tileInfo := vdtRandom.GetNodeData(tileNode);
|
||||||
tile := FRandomPresetsDoc.CreateElement('Tile');
|
tileElement := FRandomPresetsDoc.CreateElement('Tile');
|
||||||
tile.AttribStrings['ID'] := IntToStr(tileInfo^.ID);
|
tileElement.AttribStrings['ID'] := IntToStr(tileInfo^.ID);
|
||||||
preset.AppendChild(tile);
|
presetElement.AppendChild(tileElement);
|
||||||
tileNode := vdtRandom.GetNext(tileNode);
|
tileNode := vdtRandom.GetNext(tileNode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
cbRandomPreset.ItemIndex := cbRandomPreset.Items.IndexOfObject(preset);
|
cbRandomPreset.ItemIndex := cbRandomPreset.Items.IndexOfObject(presetElement);
|
||||||
|
|
||||||
SaveRandomPresets;
|
SaveRandomPresets;
|
||||||
end;
|
end;
|
||||||
|
@ -1018,7 +1018,7 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.cbRandomPresetChange(Sender: TObject);
|
procedure TfrmMain.cbRandomPresetChange(Sender: TObject);
|
||||||
var
|
var
|
||||||
preset, tile: TDOMElement;
|
presetElement, tileElement: TDOMElement;
|
||||||
tiles: TDOMNodeList;
|
tiles: TDOMNodeList;
|
||||||
tileNode: PVirtualNode;
|
tileNode: PVirtualNode;
|
||||||
tileInfo: PTileInfo;
|
tileInfo: PTileInfo;
|
||||||
|
@ -1027,13 +1027,13 @@ begin
|
||||||
if cbRandomPreset.ItemIndex > -1 then
|
if cbRandomPreset.ItemIndex > -1 then
|
||||||
begin
|
begin
|
||||||
vdtRandom.Clear;
|
vdtRandom.Clear;
|
||||||
preset := TDOMElement(cbRandomPreset.Items.Objects[cbRandomPreset.ItemIndex]);
|
presetElement := TDOMElement(cbRandomPreset.Items.Objects[cbRandomPreset.ItemIndex]);
|
||||||
tiles := preset.ChildNodes;
|
tiles := presetElement.ChildNodes;
|
||||||
for i := 0 to tiles.Count - 1 do
|
for i := 0 to tiles.Count - 1 do
|
||||||
begin
|
begin
|
||||||
tile := TDOMElement(tiles[i]);
|
tileElement := TDOMElement(tiles[i]);
|
||||||
if (tile.NodeName = 'Tile') and
|
if (tileElement.NodeName = 'Tile') and
|
||||||
TryStrToInt(tile.AttribStrings['ID'], id) and
|
TryStrToInt(tileElement.AttribStrings['ID'], id) and
|
||||||
(id < FLandscape.MaxStaticID + $4000) then
|
(id < FLandscape.MaxStaticID + $4000) then
|
||||||
begin
|
begin
|
||||||
tileNode := vdtRandom.AddChild(nil);
|
tileNode := vdtRandom.AddChild(nil);
|
||||||
|
|
Loading…
Reference in New Issue