mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Merge #6543
6543: adjust corners of Button_Env r=def- a=Marmare314 Before: ![buttons-old](https://user-images.githubusercontent.com/49279081/235272933-a40e8255-67b0-4d11-8e54-bf62f4bc1a76.png) After: ![buttons-adjusted](https://user-images.githubusercontent.com/49279081/235272940-854fe87e-3916-4e6d-aee4-9a2e1a07667f.png) ## Checklist - [x] Tested the change ingame - [x] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [x] Considered possible null pointers and out of bounds array indexing - [x] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: marmare314 <49279081+Marmare314@users.noreply.github.com>
This commit is contained in:
commit
ab5531f5cb
|
@ -407,13 +407,13 @@ int CEditor::DoButton_Editor(const void *pID, const char *pText, int Checked, co
|
||||||
return DoButton_Editor_Common(pID, pText, Checked, pRect, Flags, pToolTip);
|
return DoButton_Editor_Common(pID, pText, Checked, pRect, Flags, pToolTip);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEditor::DoButton_Env(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pToolTip, ColorRGBA BaseColor)
|
int CEditor::DoButton_Env(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pToolTip, ColorRGBA BaseColor, int Corners)
|
||||||
{
|
{
|
||||||
float Bright = Checked ? 1.0f : 0.5f;
|
float Bright = Checked ? 1.0f : 0.5f;
|
||||||
float Alpha = UI()->HotItem() == pID ? 1.0f : 0.75f;
|
float Alpha = UI()->HotItem() == pID ? 1.0f : 0.75f;
|
||||||
ColorRGBA Color = ColorRGBA(BaseColor.r * Bright, BaseColor.g * Bright, BaseColor.b * Bright, Alpha);
|
ColorRGBA Color = ColorRGBA(BaseColor.r * Bright, BaseColor.g * Bright, BaseColor.b * Bright, Alpha);
|
||||||
|
|
||||||
pRect->Draw(Color, IGraphics::CORNER_ALL, 3.0f);
|
pRect->Draw(Color, Corners, 3.0f);
|
||||||
UI()->DoLabel(pRect, pText, 10.0f, TEXTALIGN_MC);
|
UI()->DoLabel(pRect, pText, 10.0f, TEXTALIGN_MC);
|
||||||
Checked %= 2;
|
Checked %= 2;
|
||||||
return DoButton_Editor_Common(pID, pText, Checked, pRect, 0, pToolTip);
|
return DoButton_Editor_Common(pID, pText, Checked, pRect, 0, pToolTip);
|
||||||
|
@ -5549,7 +5549,15 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
||||||
ToolBar.VSplitLeft(15.0f, &Button, &ToolBar);
|
ToolBar.VSplitLeft(15.0f, &Button, &ToolBar);
|
||||||
if(i < pEnvelope->m_Channels)
|
if(i < pEnvelope->m_Channels)
|
||||||
{
|
{
|
||||||
if(DoButton_Env(&s_aChannelButtons[i], s_aapNames[pEnvelope->m_Channels - 1][i], s_ActiveChannels & Bit, &Button, s_aapDescriptions[pEnvelope->m_Channels - 1][i], aColors[i]))
|
int Corners = IGraphics::CORNER_NONE;
|
||||||
|
if(pEnvelope->m_Channels == 1)
|
||||||
|
Corners = IGraphics::CORNER_ALL;
|
||||||
|
else if(i == 0)
|
||||||
|
Corners = IGraphics::CORNER_L;
|
||||||
|
else if(i == pEnvelope->m_Channels - 1)
|
||||||
|
Corners = IGraphics::CORNER_R;
|
||||||
|
|
||||||
|
if(DoButton_Env(&s_aChannelButtons[i], s_aapNames[pEnvelope->m_Channels - 1][i], s_ActiveChannels & Bit, &Button, s_aapDescriptions[pEnvelope->m_Channels - 1][i], aColors[i], Corners))
|
||||||
s_ActiveChannels ^= Bit;
|
s_ActiveChannels ^= Bit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1115,7 +1115,7 @@ public:
|
||||||
void UpdateTooltip(const void *pID, const CUIRect *pRect, const char *pToolTip);
|
void UpdateTooltip(const void *pID, const CUIRect *pRect, const char *pToolTip);
|
||||||
int DoButton_Editor_Common(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
int DoButton_Editor_Common(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
||||||
int DoButton_Editor(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
int DoButton_Editor(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
||||||
int DoButton_Env(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pToolTip, ColorRGBA Color);
|
int DoButton_Env(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pToolTip, ColorRGBA Color, int Corners);
|
||||||
|
|
||||||
int DoButton_Tab(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
int DoButton_Tab(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip);
|
||||||
int DoButton_Ex(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip, int Corners, float FontSize = 10.0f);
|
int DoButton_Ex(const void *pID, const char *pText, int Checked, const CUIRect *pRect, int Flags, const char *pToolTip, int Corners, float FontSize = 10.0f);
|
||||||
|
|
Loading…
Reference in a new issue