diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index c1ef76584..800f12757 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -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"}; diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index 6783e6f67..1e7dece9d 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -481,6 +481,7 @@ enum PROPTYPE_BOOL, PROPTYPE_INT_STEP, PROPTYPE_INT_SCROLL, + PROPTYPE_ANGLE_SCROLL, PROPTYPE_COLOR, PROPTYPE_IMAGE, PROPTYPE_ENVELOPE, diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 6cf4c13fe..dc445fba4 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -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}, };