Editor: Scroll Speedup angles by 45° (finer with shift)

This commit is contained in:
def 2015-07-08 13:55:02 +02:00
parent 5f6752d238
commit f5d31b595c
3 changed files with 14 additions and 1 deletions

View file

@ -2623,6 +2623,18 @@ int CEditor::DoProperties(CUIRect *pToolBox, CProperty *pProps, int *pIDs, int *
Change = i;
}
}
else if(pProps[i].m_Type == PROPTYPE_ANGLE_SCROLL)
{
bool Shift = Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT);
if (!Shift)
pProps[i].m_Value = (pProps[i].m_Value / 45) * 45;
int NewValue = UiDoValueSelector(&pIDs[i], &Shifter, "", pProps[i].m_Value, pProps[i].m_Min, Shift ? pProps[i].m_Max : 315, Shift ? 1 : 45, Shift ? 1.0f : 10.0f, "Use left mouse button to drag and change the value. Hold shift to be more precise. Rightclick to edit as text.");
if(NewValue != pProps[i].m_Value)
{
*pNewVal = NewValue;
Change = i;
}
}
else if(pProps[i].m_Type == PROPTYPE_COLOR)
{
static const char *s_paTexts[4] = {"R", "G", "B", "A"};

View file

@ -481,6 +481,7 @@ enum
PROPTYPE_BOOL,
PROPTYPE_INT_STEP,
PROPTYPE_INT_SCROLL,
PROPTYPE_ANGLE_SCROLL,
PROPTYPE_COLOR,
PROPTYPE_IMAGE,
PROPTYPE_ENVELOPE,

View file

@ -1420,7 +1420,7 @@ int CEditor::PopupSpeedup(CEditor *pEditor, CUIRect View)
CProperty aProps[] = {
{"Force", pEditor->m_SpeedupForce, PROPTYPE_INT_SCROLL, 0, 255},
{"Max Speed", pEditor->m_SpeedupMaxSpeed, PROPTYPE_INT_SCROLL, 0, 255},
{"Angle", pEditor->m_SpeedupAngle, PROPTYPE_INT_SCROLL, 0, 359},
{"Angle", pEditor->m_SpeedupAngle, PROPTYPE_ANGLE_SCROLL, 0, 359},
{0},
};