mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Merge pull request #8872 from ChillerDragon/pr_action_pipettte
Add quick action "Pipette"
This commit is contained in:
commit
ccaddd2016
|
@ -1228,10 +1228,10 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
|
|||
static char s_PipetteButton;
|
||||
ColorPalette.VSplitLeft(PipetteButtonWidth, &Button, &ColorPalette);
|
||||
ColorPalette.VSplitLeft(Spacing, nullptr, &ColorPalette);
|
||||
if(DoButton_FontIcon(&s_PipetteButton, FONT_ICON_EYE_DROPPER, m_ColorPipetteActive ? 1 : 0, &Button, 0, "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.", IGraphics::CORNER_ALL) ||
|
||||
if(DoButton_FontIcon(&s_PipetteButton, FONT_ICON_EYE_DROPPER, m_QuickActionPipette.Active(), &Button, 0, m_QuickActionPipette.Description(), IGraphics::CORNER_ALL) ||
|
||||
(CLineInput::GetActiveInput() == nullptr && ModPressed && ShiftPressed && Input()->KeyPress(KEY_C)))
|
||||
{
|
||||
m_ColorPipetteActive = !m_ColorPipetteActive;
|
||||
m_QuickActionPipette.Call();
|
||||
}
|
||||
|
||||
// Palette color pickers
|
||||
|
|
|
@ -228,6 +228,14 @@ REGISTER_QUICK_ACTION(
|
|||
[&]() -> bool { return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
|
||||
DEFAULT_BTN,
|
||||
"[Ctrl+Shift+I] Show tile information in hexadecimal.")
|
||||
REGISTER_QUICK_ACTION(
|
||||
Pipette,
|
||||
"Pipette",
|
||||
[&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
|
||||
ALWAYS_FALSE,
|
||||
[&]() -> bool { return m_ColorPipetteActive; },
|
||||
DEFAULT_BTN,
|
||||
"[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
|
||||
|
||||
#undef ALWAYS_FALSE
|
||||
#undef DEFAULT_BTN
|
||||
|
|
Loading…
Reference in a new issue