mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 20:18:19 +00:00
Merge #5619
5619: Make UI inputs more secure r=def- a=C0D3D3V fixes #3560 finally :) what a dream xD This in addition also fixes an input bug, if you hold a mouse button on an input and then open f1 it no longer presses that button. ## Checklist - [x] Tested the change ingame - [ ] 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 - [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
This commit is contained in:
commit
96896ddf5c
|
@ -2385,6 +2385,8 @@ void CMenus::SetActive(bool Active)
|
|||
{
|
||||
ms_ColorPicker.m_Active = false;
|
||||
Input()->SetIMEState(Active);
|
||||
UI()->SetHotItem(nullptr);
|
||||
UI()->SetActiveItem(nullptr);
|
||||
}
|
||||
m_MenuActive = Active;
|
||||
if(!m_MenuActive)
|
||||
|
|
|
@ -155,6 +155,11 @@ void CUI::Update(float MouseX, float MouseY, float MouseWorldX, float MouseWorld
|
|||
if(m_pActiveItem)
|
||||
m_pHotItem = m_pActiveItem;
|
||||
m_pBecomingHotItem = 0;
|
||||
if(!Enabled())
|
||||
{
|
||||
m_pHotItem = nullptr;
|
||||
m_pActiveItem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool CUI::MouseInside(const CUIRect *pRect) const
|
||||
|
|
Loading…
Reference in a new issue