| 142 | } |
| 143 | |
| 144 | void CObjectPropertiesManager::Display(int serial) |
| 145 | { |
| 146 | auto it = m_Map.find(serial); |
| 147 | if (it == m_Map.end() || it->second.Empty()) |
| 148 | { |
| 149 | if (m_Object != nullptr) |
| 150 | { |
| 151 | if (g_ConfigManager.GetItemPropertiesMode() == OPM_AT_ICON) |
| 152 | { |
| 153 | CGumpPropertyIcon *gump = |
| 154 | (CGumpPropertyIcon *)g_GumpManager.UpdateContent(0, 0, GT_PROPERTY_ICON); |
| 155 | |
| 156 | if (gump != nullptr) |
| 157 | { |
| 158 | gump->Object = nullptr; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | Reset(); |
| 163 | } |
| 164 | |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | if (!g_ConfigManager.GetItemPropertiesIcon() || |
| 169 | g_ConfigManager.GetItemPropertiesMode() == OPM_FOLLOW_MOUSE) |
| 170 | { |
| 171 | g_ToolTip.Set(it->second.CreateTextData(false)); |
| 172 | return; |
| 173 | } |
| 174 | if (g_ConfigManager.GetItemPropertiesMode() == OPM_SINGLE_CLICK) |
| 175 | { |
| 176 | return; |
| 177 | } |
| 178 | |
| 179 | CGumpPropertyIcon *gump = (CGumpPropertyIcon *)g_GumpManager.GetGump(0, 0, GT_PROPERTY_ICON); |
| 180 | |
| 181 | if (gump == nullptr) |
| 182 | { |
| 183 | return; |
| 184 | } |
| 185 | |
| 186 | bool condition = (g_ConfigManager.GetItemPropertiesMode() == OPM_ALWAYS_UP); |
| 187 | |
| 188 | CRenderObject *object = g_SelectedObject.Object; |
| 189 | |
| 190 | if (object != m_Object) |
| 191 | { |
| 192 | m_Object = object; |
| 193 | Timer = g_Ticks + g_ConfigManager.ToolTipsDelay; |
| 194 | } |
| 195 | |
| 196 | if (!condition) |
| 197 | { |
| 198 | condition = !(Timer > g_Ticks); |
| 199 | } |
| 200 | |
| 201 | if (condition && gump->Object != m_Object) |
no test coverage detected