fix additional preview overlay after combining with other structure

This caused an overlay warning in the previewer object when constructing an elevetor and combining it with another elevator and detaching it again.
stable-7
Maikel de Vries 2016-01-30 12:28:15 +01:00
parent c0382ceb7f
commit 8d63ddfdef
1 changed files with 5 additions and 3 deletions

View File

@ -90,18 +90,18 @@ public func AdjustPreview(bool below_surface, bool look_up, bool no_call)
{
if (!stick_to)
{
SetClrModulation(RGBa(50,255,50, 100), GFX_PreviewerPictureOverlay);
if (extra_overlay) SetClrModulation(RGBa(50,255,50, 100), GFX_PreviewerPictureOverlay);
SetClrModulation(RGBa(50,255,50, 100), GFX_StructureOverlay);
}
else
{
SetClrModulation(RGBa(255,255,50, 200), GFX_PreviewerPictureOverlay);
if (extra_overlay) SetClrModulation(RGBa(255,255,50, 200), GFX_PreviewerPictureOverlay);
SetClrModulation(RGBa(255,255,50, 200), GFX_StructureOverlay);
}
}
else
{
SetClrModulation(RGBa(255,50,50, 100), GFX_PreviewerPictureOverlay);
if (extra_overlay) SetClrModulation(RGBa(255,50,50, 100), GFX_PreviewerPictureOverlay);
SetClrModulation(RGBa(255,50,50, 100), GFX_StructureOverlay);
}
}
@ -169,6 +169,8 @@ func Reposition(int x, int y)
dir = 0;
SetObjDrawTransform(1000, 0, dimension_x/2 * 1000 * dir, 0, 1000, 0, GFX_CombineIconOverlay);
}
// Update the extra overlay possibly added to the preview.
extra_overlay = structure->~ConstructionPreview(this, GFX_PreviewerPictureOverlay, direction);
// Update alternative preview in the definition to be placed.
structure->~AlternativeConstructionPreview(this, direction, stick_to);
SetPosition(x, y);