From 3fd87df844b7c0f522d39096c499c4531735e3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 4 Sep 2022 12:58:39 +0200 Subject: [PATCH 1/3] Fix mouse staying locked when activating text mode in editor --- src/game/editor/editor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 7af82e196..1448f7c5d 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -549,6 +549,7 @@ int CEditor::UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, in { s_pLastTextpID = pID; s_TextMode = true; + m_LockMouse = false; if(IsHex) str_format(s_aNumStr, sizeof(s_aNumStr), "%06X", Current); else From 2e8d203ed4086f8175f29f553c51acf82757a847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 4 Sep 2022 13:02:31 +0200 Subject: [PATCH 2/3] Fix editor value selector not allowing minimal value change For example, when the scale is 1, changing the value by exactly 1 was not possible. --- src/game/editor/editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 1448f7c5d..e7208fff3 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -605,7 +605,7 @@ int CEditor::UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, in else s_Value += m_MouseDeltaX; - if(absolute(s_Value) > Scale) + if(absolute(s_Value) >= Scale) { int Count = (int)(s_Value / Scale); s_Value = fmod(s_Value, Scale); From cef984294cffa4121729a22ed97548fed2dcdba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 4 Sep 2022 13:06:15 +0200 Subject: [PATCH 3/3] Fix minimum/maximum values of editor properties The Order-property maximum value was too large, so it was temporarily (only visually) possible to go beyond the maximum. The minimum/maximum values for the Color-property were incorrect and redundant, as `PROPTYPE_COLOR` is used for RGBA color properties and not for envelope IDs. --- src/game/editor/popups.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 900edfe1b..d5f2264fc 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -473,7 +473,7 @@ int CEditor::PopupLayer(CEditor *pEditor, CUIRect View, void *pContext) CProperty aProps[] = { {"Group", pEditor->m_SelectedGroup, PROPTYPE_INT_STEP, 0, (int)pEditor->m_Map.m_vpGroups.size() - 1}, - {"Order", pEditor->m_vSelectedLayers[0], PROPTYPE_INT_STEP, 0, (int)pCurrentGroup->m_vpLayers.size()}, + {"Order", pEditor->m_vSelectedLayers[0], PROPTYPE_INT_STEP, 0, (int)pCurrentGroup->m_vpLayers.size() - 1}, {"Detail", pCurrentLayer && pCurrentLayer->m_Flags & LAYERFLAG_DETAIL, PROPTYPE_BOOL, 0, 1}, {nullptr}, }; @@ -955,7 +955,7 @@ int CEditor::PopupPoint(CEditor *pEditor, CUIRect View, void *pContext) CProperty aProps[] = { {"Pos X", x, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {"Pos Y", y, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {"Color", Color, PROPTYPE_COLOR, -1, (int)pEditor->m_Map.m_vpEnvelopes.size()}, + {"Color", Color, PROPTYPE_COLOR, 0, 0}, {"Tex U", tu, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {"Tex V", tv, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {nullptr},