Move "Add Sound" button down for 5:4 resolutions

This commit is contained in:
def 2015-04-21 04:34:14 +02:00
parent a1d62d297a
commit cb64bc6859

View file

@ -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)