From cc9e0ea9f2624151bb25446ed742f84f9b190a90 Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Tue, 7 Apr 2015 23:21:57 +0200 Subject: [PATCH] construction site: sign in front and transparency for non-mesh structures --- .../Constructor.ocd/ConstructionSite.ocd/Script.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionSite.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionSite.ocd/Script.c index 0ffc11c42..edcaecea8 100644 --- a/planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionSite.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionSite.ocd/Script.c @@ -51,9 +51,17 @@ public func Set(id def, int dir, object stick) // Draw the building with a wired frame and large alpha unless site graphics is overloaded by definition if (!def->~SetConstructionSiteOverlay(this, direction, stick_to)) { + SetGraphics(nil, nil, 0); SetGraphics(nil, def, 1, GFXOV_MODE_Base); - SetClrModulation(RGBa(255,255,255,50), 1); - SetGraphics(nil, def, 2, GFXOV_MODE_Base, nil, GFX_BLIT_Wireframe); + SetClrModulation(RGBa(255, 255, 255, 128), 1); + // If the structure is a mesh, use wire frame mode to show the site. + // TODO: use def->IsMesh() once this becomes available. + if (def->GetMeshMaterial()) + { + SetClrModulation(RGBa(255, 255, 255, 50), 1); + SetGraphics(nil, def, 2, GFXOV_MODE_Base, nil, GFX_BLIT_Wireframe); + } + SetGraphics("", GetID(), 3, GFXOV_MODE_ExtraGraphics); } SetObjDrawTransform(xw,0,0,0,1000, -h*500,1); SetObjDrawTransform(xw,0,0,0,1000, -h*500,2);