mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #5103
5103: Remove unused DoButtonLogic pText argument r=def- a=Robyt3 <!-- What is the motivation for the changes of this pull request --> ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] 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: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
e9b59e72ff
|
@ -165,7 +165,7 @@ int CMenus::DoButton_Toggle(const void *pID, int Checked, const CUIRect *pRect,
|
|||
}
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
return Active ? UI()->DoButtonLogic(pID, "", Checked, pRect) : 0;
|
||||
return Active ? UI()->DoButtonLogic(pID, Checked, pRect) : 0;
|
||||
}
|
||||
|
||||
int CMenus::DoButton_Menu(const void *pID, const char *pText, int Checked, const CUIRect *pRect, const char *pImageName, int Corners, float r, float FontFactor, vec4 ColorHot, vec4 Color, int AlignVertically, bool CheckForActiveColorPicker)
|
||||
|
@ -221,7 +221,7 @@ int CMenus::DoButton_Menu(const void *pID, const char *pText, int Checked, const
|
|||
if(MouseInsideColorPicker)
|
||||
return 0;
|
||||
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
void CMenus::DoButton_KeySelect(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
|
@ -311,7 +311,7 @@ int CMenus::DoButton_MenuTab(const void *pID, const char *pText, int Checked, co
|
|||
Props.m_AlignVertically = AlignVertically;
|
||||
UI()->DoLabel(&Temp, pText, Temp.h * CUI::ms_FontmodHeight, TEXTALIGN_CENTER, Props);
|
||||
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
int CMenus::DoButton_GridHeader(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
|
@ -323,7 +323,7 @@ int CMenus::DoButton_GridHeader(const void *pID, const char *pText, int Checked,
|
|||
CUIRect t;
|
||||
pRect->VSplitLeft(5.0f, 0, &t);
|
||||
UI()->DoLabel(&t, pText, pRect->h * CUI::ms_FontmodHeight, TEXTALIGN_LEFT);
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
int CMenus::DoButton_CheckBox_Common(const void *pID, const char *pText, const char *pBoxText, const CUIRect *pRect)
|
||||
|
@ -353,7 +353,7 @@ int CMenus::DoButton_CheckBox_Common(const void *pID, const char *pText, const c
|
|||
TextRender()->SetRenderFlags(0);
|
||||
UI()->DoLabel(&t, pText, c.h * CUI::ms_FontmodHeight, TEXTALIGN_LEFT);
|
||||
|
||||
return UI()->DoButtonLogic(pID, pText, 0, pRect);
|
||||
return UI()->DoButtonLogic(pID, 0, pRect);
|
||||
}
|
||||
|
||||
void CMenus::DoLaserPreview(const CUIRect *pRect, const ColorHSLA LaserOutlineColor, const ColorHSLA LaserInnerColor)
|
||||
|
|
|
@ -300,7 +300,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
RenderTools()->DrawUIElRect(*pItem->m_pUIElement->Get(1), &r, ColorRGBA(1, 1, 1, 0.25f), CUI::CORNER_ALL, 4.0f);
|
||||
}
|
||||
|
||||
if(UI()->DoButtonLogic(pItem, "", Selected, &Row))
|
||||
if(UI()->DoButtonLogic(pItem, Selected, &Row))
|
||||
{
|
||||
NewSelected = ItemIndex;
|
||||
if(NewSelected == m_DoubleClickIndex)
|
||||
|
@ -754,7 +754,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
ColorRGBA Color(1.0f, 1.0f, 1.0f, g_Config.m_BrFilterCountry ? 1.0f : 0.5f);
|
||||
m_pClient->m_CountryFlags.Render(g_Config.m_BrFilterCountryIndex, &Color, Rect.x, Rect.y, Rect.w, Rect.h);
|
||||
|
||||
if(g_Config.m_BrFilterCountry && UI()->DoButtonLogic(&g_Config.m_BrFilterCountryIndex, "", 0, &Rect))
|
||||
if(g_Config.m_BrFilterCountry && UI()->DoButtonLogic(&g_Config.m_BrFilterCountryIndex, 0, &Rect))
|
||||
m_Popup = POPUP_COUNTRY;
|
||||
}
|
||||
|
||||
|
@ -861,7 +861,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
Rect.w = TypesWidth;
|
||||
Rect.h = TypesHeight;
|
||||
|
||||
int Click = UI()->DoButtonLogic(&s_aTypeButtons[TypeIndex], "", 0, &Rect);
|
||||
int Click = UI()->DoButtonLogic(&s_aTypeButtons[TypeIndex], 0, &Rect);
|
||||
if(Click == 1 || Click == 2)
|
||||
{
|
||||
// left/right click to toggle filter
|
||||
|
@ -956,7 +956,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
|
|||
Rect.w = FlagWidth;
|
||||
Rect.h = FlagHeight;
|
||||
|
||||
int Click = UI()->DoButtonLogic(&s_aFlagButtons[CountryIndex], "", 0, &Rect);
|
||||
int Click = UI()->DoButtonLogic(&s_aFlagButtons[CountryIndex], 0, &Rect);
|
||||
if(Click == 1 || Click == 2)
|
||||
{
|
||||
// left/right click to toggle filter
|
||||
|
|
|
@ -26,7 +26,7 @@ int CMenus::DoButton_DemoPlayer(const void *pID, const char *pText, int Checked,
|
|||
{
|
||||
RenderTools()->DrawUIRect(pRect, ColorRGBA(1, 1, 1, (Checked ? 0.10f : 0.5f) * UI()->ButtonColorMul(pID)), CUI::CORNER_ALL, 5.0f);
|
||||
UI()->DoLabel(pRect, pText, 14.0f, TEXTALIGN_CENTER);
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
int CMenus::DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners)
|
||||
|
@ -41,7 +41,7 @@ int CMenus::DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Chec
|
|||
Graphics()->QuadsDrawTL(&QuadItem, 1);
|
||||
Graphics()->QuadsEnd();
|
||||
|
||||
return UI()->DoButtonLogic(pID, "", Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
bool CMenus::DemoFilterChat(const void *pData, int Size, void *pUser)
|
||||
|
@ -630,7 +630,7 @@ CMenus::CListboxItem CMenus::UiDoListboxNextItem(const void *pId, bool Selected,
|
|||
HitRect.h = minimum(HitRect.h, (gs_ListBoxOriginalView.y + gs_ListBoxOriginalView.h) - HitRect.y);
|
||||
|
||||
bool DoubleClickable = false;
|
||||
if(Item.m_Visible && UI()->DoButtonLogic(pId, "", gs_ListBoxSelectedIndex == gs_ListBoxItemIndex, &HitRect))
|
||||
if(Item.m_Visible && UI()->DoButtonLogic(pId, gs_ListBoxSelectedIndex == gs_ListBoxItemIndex, &HitRect))
|
||||
{
|
||||
DoubleClickable |= gs_ListBoxNewSelected == ThisItemIndex;
|
||||
gs_ListBoxClicked = true;
|
||||
|
@ -1121,7 +1121,7 @@ void CMenus::RenderDemoList(CUIRect MainView)
|
|||
RenderTools()->DrawUIRect(&Rect, ColorRGBA(1, 1, 1, 0.25f), CUI::CORNER_ALL, 4.0f);
|
||||
}
|
||||
|
||||
if(UI()->DoButtonLogic(r.front().m_aName /* TODO: */, "", Selected, &Row))
|
||||
if(UI()->DoButtonLogic(r.front().m_aName, Selected, &Row))
|
||||
{
|
||||
DoubleClicked |= ItemIndex == m_DoubleClickIndex;
|
||||
str_copy(g_Config.m_UiDemoSelected, r.front().m_aName, sizeof(g_Config.m_UiDemoSelected));
|
||||
|
|
|
@ -1074,7 +1074,7 @@ void CMenus::RenderGhost(CUIRect MainView)
|
|||
RenderTools()->DrawUIRect(&r, ColorRGBA(1, 1, 1, 0.5f), CUI::CORNER_ALL, 4.0f);
|
||||
}
|
||||
|
||||
if(UI()->DoButtonLogic(pItem, "", 0, &Row))
|
||||
if(UI()->DoButtonLogic(pItem, 0, &Row))
|
||||
{
|
||||
NewSelected = i;
|
||||
DoubleClicked |= NewSelected == m_DoubleClickIndex;
|
||||
|
|
|
@ -425,11 +425,6 @@ bool CUIRect::Inside(float x_, float y_) const
|
|||
return x_ >= this->x && x_ < this->x + this->w && y_ >= this->y && y_ < this->y + this->h;
|
||||
}
|
||||
|
||||
int CUI::DoButtonLogic(const void *pID, const char *pText, int Checked, const CUIRect *pRect)
|
||||
{
|
||||
return DoButtonLogic(pID, Checked, pRect);
|
||||
}
|
||||
|
||||
int CUI::DoButtonLogic(const void *pID, int Checked, const CUIRect *pRect)
|
||||
{
|
||||
// logic
|
||||
|
|
|
@ -298,7 +298,6 @@ public:
|
|||
float Scale() const;
|
||||
|
||||
int DoButtonLogic(const void *pID, int Checked, const CUIRect *pRect);
|
||||
int DoButtonLogic(const void *pID, const char *pText /* TODO: Refactor: Remove */, int Checked, const CUIRect *pRect);
|
||||
int DoPickerLogic(const void *pID, const CUIRect *pRect, float *pX, float *pY);
|
||||
|
||||
float DoTextLabel(float x, float y, float w, float h, const char *pText, float Size, int Align, const SLabelProperties &LabelProps = {});
|
||||
|
|
|
@ -639,7 +639,7 @@ bool CUIEx::DoClearableEditBox(const void *pID, const void *pClearID, const CUIR
|
|||
Props.m_AlignVertically = 0;
|
||||
UI()->DoLabel(&ClearButton, "×", ClearButton.h * CUI::ms_FontmodHeight, TEXTALIGN_CENTER, Props);
|
||||
TextRender()->SetRenderFlags(0);
|
||||
if(UI()->DoButtonLogic(pClearID, "×", 0, &ClearButton))
|
||||
if(UI()->DoButtonLogic(pClearID, 0, &ClearButton))
|
||||
{
|
||||
pStr[0] = 0;
|
||||
UI()->SetActiveItem(pID);
|
||||
|
|
|
@ -366,7 +366,7 @@ int CEditor::DoButton_Editor_Common(const void *pID, const char *pText, int Chec
|
|||
if(UI()->HotItem() == pID && pToolTip)
|
||||
m_pTooltip = pToolTip;
|
||||
|
||||
return UI()->DoButtonLogic(pID, pText, Checked, pRect);
|
||||
return UI()->DoButtonLogic(pID, Checked, pRect);
|
||||
|
||||
// Draw here
|
||||
//return UI()->DoButton(id, text, checked, r, draw_func, 0);
|
||||
|
@ -4445,7 +4445,7 @@ void CEditor::RenderFileDialog()
|
|||
static int s_ClearButton = 0;
|
||||
RenderTools()->DrawUIRect(&ClearBox, ColorRGBA(1, 1, 1, 0.33f * UI()->ButtonColorMul(&s_ClearButton)), CUI::CORNER_R, 3.0f);
|
||||
UI()->DoLabel(&ClearBox, "×", 10.0f, TEXTALIGN_CENTER);
|
||||
if(UI()->DoButtonLogic(&s_ClearButton, "×", 0, &ClearBox))
|
||||
if(UI()->DoButtonLogic(&s_ClearButton, 0, &ClearBox))
|
||||
{
|
||||
m_aFileDialogSearchText[0] = 0;
|
||||
UI()->SetActiveItem(&s_SearchBoxID);
|
||||
|
|
Loading…
Reference in a new issue