1
0
forked from 0ad/0ad

Delete SGUIMessage GUIM_SETTINGS_UPDATED broadcasts redundant with the broadcast initiated from SetSetting from e21ebb37f5.

659a9ea57a introduced the call rightfully in ShowTooltip since
CTooltip::SetupText() depends on the just changed _mousepos setting.
But then 0382cdd9b1 moved that _mousepos SetSetting call, resulting in
the message becoming redundant; and it inserted the second redundant
message in HideTooltip.

These were the only redundant SGUIMessage HandleMessage calls.

This was SVN commit r22790.
This commit is contained in:
elexis 2019-08-26 23:39:16 +00:00
parent 92b6cdfeab
commit 0a6b650189

View File

@ -143,13 +143,10 @@ void GUITooltip::ShowTooltip(IGUIObject* obj, const CPos& pos, const CStr& style
GUI<bool>::SetSetting(usedobj, "hidden", false);
const CStrW& text = obj->GetSetting<CStrW>(m_IsIconTooltip ? "_icon_tooltip" : "tooltip");
const CStrW& text = obj->GetSetting<CStrW>(m_IsIconTooltip ? "_icon_tooltip" : "tooltip");
if (usedobj->SetSetting("caption", text) != PSRETURN_OK)
debug_warn(L"Failed to set tooltip caption");
SGUIMessage msg(GUIM_SETTINGS_UPDATED, "caption");
usedobj->HandleMessage(msg);
}
void GUITooltip::HideTooltip(const CStr& style, CGUI& pGUI)
@ -175,10 +172,8 @@ void GUITooltip::HideTooltip(const CStr& style, CGUI& pGUI)
}
usedobj->SetSetting("caption", L"");
SGUIMessage msg(GUIM_SETTINGS_UPDATED, "caption");
usedobj->HandleMessage(msg);
if (tooltipobj->GetSetting<bool>("hide_object"))
if (tooltipobj->GetSetting<bool>("hide_object"))
GUI<bool>::SetSetting(usedobj, "hidden", true);
}
else