|
|
|
@ -50,50 +50,10 @@ extern ULandscape *Landscape;
|
|
|
|
|
namespace R2
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CDisplayerVisualGroup::CDisplayerVisualGroup()
|
|
|
|
|
// create a special selectable polygon
|
|
|
|
|
class CCtrlPolygonSelectable : public CCtrlPolygon, public IDisplayerUIHandle
|
|
|
|
|
{
|
|
|
|
|
_ArrayName = "Components";
|
|
|
|
|
_DrawnThisFrame = false;
|
|
|
|
|
_TimeOver = 0;
|
|
|
|
|
_CurrPrimValid = true;
|
|
|
|
|
touch();
|
|
|
|
|
_Active = false;
|
|
|
|
|
_CurrPrimInaccessible = false;
|
|
|
|
|
_ContextualVisibilityActive = false;
|
|
|
|
|
_ContextualVisibilityDate = -1;
|
|
|
|
|
_VisibleLastFrame = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
void CDisplayerVisualGroup::touch()
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_touch)
|
|
|
|
|
_PrimTouched = true;
|
|
|
|
|
_InstanceListTouched = true;
|
|
|
|
|
_AccessibilityTouched = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
void CDisplayerVisualGroup::setDisplayedInstance(CInstance *instance)
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_setDisplayedInstance)
|
|
|
|
|
CDisplayerVisual::setDisplayedInstance(instance);
|
|
|
|
|
_Prim.DisplayedInstance = instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() const
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
|
|
|
|
|
nlassert(DisplayedInstance);
|
|
|
|
|
// create a special selectable polygon
|
|
|
|
|
class CCtrlPolygonSelectable : public CCtrlPolygon, public IDisplayerUIHandle
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
public:
|
|
|
|
|
CCtrlPolygonSelectable(CInstance &instance) : Instance(instance) {}
|
|
|
|
|
// from IDisplayerUIHandle
|
|
|
|
|
virtual CInstance &getDisplayedInstance() { return Instance; }
|
|
|
|
@ -122,9 +82,9 @@ CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() con
|
|
|
|
|
_Parent->getCorner(winX, winY, _ParentPosRef);
|
|
|
|
|
return contains(x - winX, y - winY);
|
|
|
|
|
}
|
|
|
|
|
public:
|
|
|
|
|
public:
|
|
|
|
|
CInstance &Instance;
|
|
|
|
|
protected:
|
|
|
|
|
protected:
|
|
|
|
|
// TMP TMP until matrix precision is solved
|
|
|
|
|
// from CCtrlPolygon
|
|
|
|
|
void computeScaledVertex(NLMISC::CVector2f &dest, const NLMISC::CVector2f &src)
|
|
|
|
@ -133,24 +93,12 @@ CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() con
|
|
|
|
|
if (!gm) dest = CVector::Null;
|
|
|
|
|
gm->worldToWindow(dest, src);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
CCtrlPolygonSelectable *result = new CCtrlPolygonSelectable(*DisplayedInstance);
|
|
|
|
|
result->setId(DisplayedInstance->getId());
|
|
|
|
|
result->setToolTipParent(CCtrlBase::TTMouse);
|
|
|
|
|
result->setToolTipParentPosRef(Hotspot_BR);
|
|
|
|
|
result->setToolTipPosRef(Hotspot_TL);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIndex) const
|
|
|
|
|
// create a special selectable polygon
|
|
|
|
|
class CCtrlQuadSelectable : public CCtrlQuad, public IDisplayerUIHandle
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
|
|
|
|
|
nlassert(DisplayedInstance);
|
|
|
|
|
// create a special selectable polygon
|
|
|
|
|
class CCtrlQuadSelectable : public CCtrlQuad, public IDisplayerUIHandle
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
public:
|
|
|
|
|
CCtrlQuadSelectable(CInstance &instance, uint edgeIndex) : Instance(instance), EdgeIndex(edgeIndex) {}
|
|
|
|
|
// from IDisplayerUIHandle
|
|
|
|
|
virtual CInstance &getDisplayedInstance() { return Instance; }
|
|
|
|
@ -187,10 +135,63 @@ CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIn
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
public:
|
|
|
|
|
public:
|
|
|
|
|
CInstance &Instance;
|
|
|
|
|
uint EdgeIndex;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CDisplayerVisualGroup::CDisplayerVisualGroup()
|
|
|
|
|
{
|
|
|
|
|
_ArrayName = "Components";
|
|
|
|
|
_DrawnThisFrame = false;
|
|
|
|
|
_TimeOver = 0;
|
|
|
|
|
_CurrPrimValid = true;
|
|
|
|
|
touch();
|
|
|
|
|
_Active = false;
|
|
|
|
|
_CurrPrimInaccessible = false;
|
|
|
|
|
_ContextualVisibilityActive = false;
|
|
|
|
|
_ContextualVisibilityDate = -1;
|
|
|
|
|
_VisibleLastFrame = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
void CDisplayerVisualGroup::touch()
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_touch)
|
|
|
|
|
_PrimTouched = true;
|
|
|
|
|
_InstanceListTouched = true;
|
|
|
|
|
_AccessibilityTouched = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
void CDisplayerVisualGroup::setDisplayedInstance(CInstance *instance)
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_setDisplayedInstance)
|
|
|
|
|
CDisplayerVisual::setDisplayedInstance(instance);
|
|
|
|
|
_Prim.DisplayedInstance = instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() const
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
|
|
|
|
|
nlassert(DisplayedInstance);
|
|
|
|
|
CCtrlPolygonSelectable *result = new CCtrlPolygonSelectable(*DisplayedInstance);
|
|
|
|
|
result->setId(DisplayedInstance->getId());
|
|
|
|
|
result->setToolTipParent(CCtrlBase::TTMouse);
|
|
|
|
|
result->setToolTipParentPosRef(Hotspot_BR);
|
|
|
|
|
result->setToolTipPosRef(Hotspot_TL);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// *********************************************************************************************************
|
|
|
|
|
CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIndex) const
|
|
|
|
|
{
|
|
|
|
|
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
|
|
|
|
|
nlassert(DisplayedInstance);
|
|
|
|
|
CCtrlQuadSelectable *result = new CCtrlQuadSelectable(*DisplayedInstance, edgeIndex);
|
|
|
|
|
result->setToolTipParent(CCtrlBase::TTMouse);
|
|
|
|
|
result->setToolTipParentPosRef(Hotspot_BR);
|
|
|
|
|