mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
display selected color in toolbar and improve pipette workflow (switch back to edit mode on right-click)
This commit is contained in:
parent
667ca2d0c8
commit
e71fde8c4e
|
@ -1110,7 +1110,7 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
|||
TB_Bottom.VSplitLeft(10.0f, 0, &TB_Bottom);
|
||||
|
||||
// pipette / color picking
|
||||
TB_Bottom.VSplitLeft(40.0f, &Button, &TB_Bottom);
|
||||
TB_Bottom.VSplitLeft(50.0f, &Button, &TB_Bottom);
|
||||
static int s_ColorPickingButton = 0;
|
||||
if(DoButton_Editor(&s_ColorPickingButton, "Pipette", m_MouseEdMode == MOUSE_PIPETTE, &Button, 0, "Pick color from view"))
|
||||
{
|
||||
|
@ -1121,6 +1121,15 @@ void CEditor::DoToolbar(CUIRect ToolBar)
|
|||
m_MouseEdMode = MOUSE_PIPETTE;
|
||||
}
|
||||
|
||||
// display selected color
|
||||
if(m_SelectedColor.a > 0.0f)
|
||||
{
|
||||
TB_Bottom.VSplitLeft(4.0f, 0, &TB_Bottom);
|
||||
|
||||
TB_Bottom.VSplitLeft(24.0f, &Button, &TB_Bottom);
|
||||
RenderTools()->DrawUIRect(&Button, m_SelectedColor, 0, 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void Rotate(const CPoint *pCenter, CPoint *pPoint, float Rotation)
|
||||
|
@ -2176,6 +2185,11 @@ void CEditor::DoMapEditor(CUIRect View, CUIRect ToolBar)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// leave pipette mode on right-click
|
||||
if(UI()->MouseButton(1))
|
||||
m_MouseEdMode = MOUSE_EDIT;
|
||||
|
||||
} break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue