From 3824d885a22b5ed212d53266c5a2e9a4a10a1d5d Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 18 Jul 2010 13:57:17 +0200 Subject: [PATCH] fixed envelope index in the quad popup, so that it fits the envelope menu. Closes #118 --- src/game/editor/ed_popups.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp index 001a7249c..19b0af26c 100644 --- a/src/game/editor/ed_popups.cpp +++ b/src/game/editor/ed_popups.cpp @@ -300,9 +300,9 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View) }; CProperty aProps[] = { - {Localize("Pos. Env"), pQuad->m_PosEnv, PROPTYPE_INT_STEP, -1, pEditor->m_Map.m_lEnvelopes.size()}, + {Localize("Pos. Env"), pQuad->m_PosEnv+1, PROPTYPE_INT_STEP, 0, pEditor->m_Map.m_lEnvelopes.size()+1}, {Localize("Pos. TO"), pQuad->m_PosEnvOffset, PROPTYPE_INT_SCROLL, -1000000, 1000000}, - {Localize("Color Env"), pQuad->m_ColorEnv, PROPTYPE_INT_STEP, -1, pEditor->m_Map.m_lEnvelopes.size()}, + {Localize("Color Env"), pQuad->m_ColorEnv+1, PROPTYPE_INT_STEP, 0, pEditor->m_Map.m_lEnvelopes.size()+1}, {Localize("Color TO"), pQuad->m_ColorEnvOffset, PROPTYPE_INT_SCROLL, -1000000, 1000000}, {0}, @@ -312,9 +312,9 @@ int CEditor::PopupQuad(CEditor *pEditor, CUIRect View) int NewVal = 0; int Prop = pEditor->DoProperties(&View, aProps, s_aIds, &NewVal); - if(Prop == PROP_POS_ENV) pQuad->m_PosEnv = clamp(NewVal, -1, pEditor->m_Map.m_lEnvelopes.size()-1); + if(Prop == PROP_POS_ENV) pQuad->m_PosEnv = clamp(NewVal-1, -1, pEditor->m_Map.m_lEnvelopes.size()-1); if(Prop == PROP_POS_ENV_OFFSET) pQuad->m_PosEnvOffset = NewVal; - if(Prop == PROP_COLOR_ENV) pQuad->m_ColorEnv = clamp(NewVal, -1, pEditor->m_Map.m_lEnvelopes.size()-1); + if(Prop == PROP_COLOR_ENV) pQuad->m_ColorEnv = clamp(NewVal-1, -1, pEditor->m_Map.m_lEnvelopes.size()-1); if(Prop == PROP_COLOR_ENV_OFFSET) pQuad->m_ColorEnvOffset = NewVal; return 0;