mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Editor: Scroll Speedup angles by 45° (finer with shift)
This commit is contained in:
parent
5f6752d238
commit
f5d31b595c
|
@ -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"};
|
||||
|
|
|
@ -481,6 +481,7 @@ enum
|
|||
PROPTYPE_BOOL,
|
||||
PROPTYPE_INT_STEP,
|
||||
PROPTYPE_INT_SCROLL,
|
||||
PROPTYPE_ANGLE_SCROLL,
|
||||
PROPTYPE_COLOR,
|
||||
PROPTYPE_IMAGE,
|
||||
PROPTYPE_ENVELOPE,
|
||||
|
|
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue