CCmpSelectable::CCmpSelectable |
( |
| ) |
|
|
inline |
CCmpSelectable::~CCmpSelectable |
( |
| ) |
|
|
inline |
static void CCmpSelectable::Deallocate |
( |
IComponent * |
cmp | ) |
|
|
inlinestatic |
virtual void CCmpSelectable::Deinit |
( |
| ) |
|
|
inlinevirtual |
virtual int CCmpSelectable::GetComponentTypeId |
( |
| ) |
const |
|
inlinevirtual |
static std::string CCmpSelectable::GetSchema |
( |
| ) |
|
|
inlinestatic |
void CCmpSelectable::HandleMessage |
( |
const CMessage & |
msg, |
|
|
bool |
global |
|
) |
| |
|
virtual |
virtual void CCmpSelectable::Init |
( |
const CParamNode & |
paramNode | ) |
|
|
inlinevirtual |
void CCmpSelectable::InvalidateStaticOverlay |
( |
| ) |
|
Explicitly invalidates the static overlay.
virtual bool CCmpSelectable::IsEditorOnly |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the entity is only selectable in Atlas editor, e.g.
a decorative visual actor.
Implements ICmpSelectable.
virtual void CCmpSelectable::Serialize |
( |
ISerializer & |
serialize | ) |
|
|
inlinevirtual |
virtual void CCmpSelectable::SetSelectionHighlight |
( |
const CColor & |
color, |
|
|
bool |
selected |
|
) |
| |
|
inlinevirtual |
Set the selection highlight state.
The highlight is typically a circle/square overlay around the unit.
- Parameters
-
color | color and alpha of the selection highlight. Set color.a = 0 to hide the highlight. |
selected | whether the entity is selected; affects desaturation for always visible highlights. |
Implements ICmpSelectable.
virtual void CCmpSelectable::SetSelectionHighlightAlpha |
( |
float |
alpha | ) |
|
|
inlinevirtual |
Set the alpha of the selection highlight.
Set to 0 to hide the highlight.
Implements ICmpSelectable.
virtual void CCmpSelectable::SetVisibility |
( |
bool |
visible | ) |
|
|
inlinevirtual |
Enables or disables rendering of an entity's selectable.
- Parameters
-
visible | Whether the selectable should be visible. |
Implements ICmpSelectable.
void CCmpSelectable::UpdateDynamicOverlay |
( |
float |
frameOffset | ) |
|
Called from the interpolation handler; responsible for ensuring the dynamic overlay (provided we're using one) is up-to-date and ready to be submitted to the next rendering run.
void CCmpSelectable::UpdateMessageSubscriptions |
( |
| ) |
|
Subscribe/unsubscribe to MT_Interpolate, MT_RenderSubmit, depending on whether we will do any actual work when receiving them.
(This is to avoid the performance cost of receiving messages in the typical case when the entity is not selected.)
Must be called after changing m_Visible, m_FadeDeltaAlpha, m_Color.a
void CCmpSelectable::UpdateStaticOverlay |
( |
| ) |
|
Called from RenderSubmit if using a static outline; responsible for ensuring that the static overlay is up-to-date before it is rendered.
Has no effect unless the static overlay is explicitly marked as invalid first (see InvalidateStaticOverlay).
const double CCmpSelectable::FADE_DURATION = 0.3 |
|
staticprivate |
Total duration of a single fade, in seconds.
Assumed constant for now; feel free to change this into a member variable if you need to adjust it per component.
float CCmpSelectable::m_AlphaMin |
|
private |
Minimum value for current selection overlay alpha.
bool CCmpSelectable::m_AlwaysVisible |
|
private |
bool CCmpSelectable::m_Cached |
|
private |
Whether the selectable's player color has been cached for rendering.
CColor CCmpSelectable::m_Color |
|
private |
Current selection overlay color. Alpha component is subject to fading.
bool CCmpSelectable::m_EditorOnly |
|
private |
bool CCmpSelectable::m_EnabledInterpolate |
|
private |
bool CCmpSelectable::m_EnabledRenderSubmit |
|
private |
float CCmpSelectable::m_FadeBaselineAlpha |
|
private |
Baseline alpha value to start fading from. Constant during a single fade.
float CCmpSelectable::m_FadeDeltaAlpha |
|
private |
Delta between target and baseline alpha. Constant during a single fade. Can be positive or negative.
float CCmpSelectable::m_FadeProgress |
|
private |
Linear time progress of the fade, between 0 and m_FadeDuration.
bool CCmpSelectable::m_Selected |
|
private |
Whether the parent entity is selected (caches GUI's selection state).
bool CCmpSelectable::m_Visible |
|
private |
The documentation for this class was generated from the following file: