From cb64bc68596692c8c352936e3e54557230a76b86 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 21 Apr 2015 04:34:14 +0200 Subject: [PATCH] Move "Add Sound" button down for 5:4 resolutions --- src/game/editor/editor.cpp | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 881f42fed..391d8baf5 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -1074,31 +1074,6 @@ void CEditor::DoToolbar(CUIRect ToolBar) } } - // sound source manipulation - { - // do add button - TB_Top.VSplitLeft(10.0f, &Button, &TB_Top); - TB_Top.VSplitLeft(60.0f, &Button, &TB_Top); - static int s_NewButton = 0; - - CLayerSounds *pSoundLayer = (CLayerSounds *)GetSelectedLayerType(0, LAYERTYPE_SOUNDS); - if(DoButton_Editor(&s_NewButton, "Add Source", pSoundLayer?0:-1, &Button, 0, "Adds a new sound source")) - { - if(pSoundLayer) - { - float Mapping[4]; - CLayerGroup *g = GetSelectedGroup(); - g->Mapping(Mapping); - int AddX = f2fx(Mapping[0] + (Mapping[2]-Mapping[0])/2); - int AddY = f2fx(Mapping[1] + (Mapping[3]-Mapping[1])/2); - - CSoundSource *pSource = pSoundLayer->NewSource(); - pSource->m_Position.x += AddX; - pSource->m_Position.y += AddY; - } - } - } - // tile manipulation { TB_Bottom.VSplitLeft(40.0f, &Button, &TB_Bottom); @@ -1199,6 +1174,32 @@ void CEditor::DoToolbar(CUIRect ToolBar) if(m_GridFactor < 15) m_GridFactor++; } + + // sound source manipulation + { + // do add button + TB_Bottom.VSplitLeft(10.0f, &Button, &TB_Bottom); + TB_Bottom.VSplitLeft(60.0f, &Button, &TB_Bottom); + static int s_NewButton = 0; + + CLayerSounds *pSoundLayer = (CLayerSounds *)GetSelectedLayerType(0, LAYERTYPE_SOUNDS); + if(DoButton_Editor(&s_NewButton, "Add Sound", pSoundLayer?0:-1, &Button, 0, "Adds a new sound source")) + { + if(pSoundLayer) + { + float Mapping[4]; + CLayerGroup *g = GetSelectedGroup(); + g->Mapping(Mapping); + int AddX = f2fx(Mapping[0] + (Mapping[2]-Mapping[0])/2); + int AddY = f2fx(Mapping[1] + (Mapping[3]-Mapping[1])/2); + + CSoundSource *pSource = pSoundLayer->NewSource(); + pSource->m_Position.x += AddX; + pSource->m_Position.y += AddY; + } + } + } + } static void Rotate(const CPoint *pCenter, CPoint *pPoint, float Rotation)