Batch #17060 by eAthena: 12 byte-identical, 6 confirmed by peer review. - fn_14418 CUIDropDownBox::HasOwnerChild: byte-identical - fn_45427 CUIDropDownBox::~CUIDropDownBox: byte-identical (already on main) - fn_14773 CUIListBoxEx<EnchantUI::CUIEnchantItem,EnchantUI::CEnchantItemData>::~CUIListBoxEx<EnchantUI::CUIEnchantItem,EnchantUI::CEnchantItemData>: byte-identical (already on main) - fn_14774 CUIListBoxEx<EnchantUI::CUITargetItem,ITEM_INFO>::~CUIListBoxEx<EnchantUI::CUITargetItem,ITEM_INFO>: byte-identical (already on main) - fn_15026 CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::~CUIListBoxEx<EquipmentPropertiesWnd::CUIItemEquipmentPropertiesLine,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >: byte-identical (already on main) - fn_15181 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::~CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>: logic confirmed by peer review (already on main) - fn_15348 CUIListBoxEx<GameSettingsUI::CUIComboItem,RenderAdapter>::~CUIListBoxEx<GameSettingsUI::CUIComboItem,RenderAdapter>: logic confirmed by peer review (already on main) - fn_15349 CUIListBoxEx<GameSettingsUI::CUIComboItem,DisplayMode>::~CUIListBoxEx<GameSettingsUI::CUIComboItem,DisplayMode>: logic confirmed by peer review (already on main) - fn_15350 CUIListBoxEx<GameSettingsUI::CUIComboItem,RenderBackend>::~CUIListBoxEx<GameSettingsUI::CUIComboItem,RenderBackend>: logic confirmed by peer review (already on main) - fn_15351 CUIListBoxEx<GameSettingsUI::CUIComboItem,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::~CUIListBoxEx<GameSettingsUI::CUIComboItem,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >: byte-identical (already on main) - fn_15352 CUIListBoxEx<GameSettingsUI::CUIOptionItem,TALKTYPE>::~CUIListBoxEx<GameSettingsUI::CUIOptionItem,TALKTYPE>: byte-identical (already on main) - fn_16109 CUIListBoxEx<ProbabilityTable::CUIItem,ProbabilityTable::CItemData>::~CUIListBoxEx<ProbabilityTable::CUIItem,ProbabilityTable::CItemData>: byte-identical (already on main) - fn_16218 CUIListBoxEx<OngoingQuestInfo::CUIRewardItem,OngoingQuestInfo::CRewardItemData>::~CUIListBoxEx<OngoingQuestInfo::CUIRewardItem,OngoingQuestInfo::CRewardItemData>: byte-identical (already on main) - fn_16368 CUIListBoxEx<RenewQuestUI::CUIQuestItem,unsigned long>::~CUIListBoxEx<RenewQuestUI::CUIQuestItem,unsigned long>: byte-identical (already on main) - fn_16648 CUIListBoxEx<SelectPackageItemBox::CUIItemInfo,ITEM_INFO>::~CUIListBoxEx<SelectPackageItemBox::CUIItemInfo,ITEM_INFO>: logic confirmed by peer review (already on main) - fn_16649 CUIListBoxEx<SelectPackageItemBox::CUITabInfo,SelectPackageItemBox::CTabInfoData>::~CUIListBoxEx<SelectPackageItemBox::CUITabInfo,SelectPackageItemBox::CTabInfoData>: logic confirmed by peer review (already on main) - fn_16800 CUIListBoxEx<SkillDelayInfo::CUIDelayItem,SkillDelayInfo::CDelayItemData>::~CUIListBoxEx<SkillDelayInfo::CUIDelayItem,SkillDelayInfo::CDelayItemData>: byte-identical (already on main) - fn_16877 SkillDelayInfo::CUITime::`scalar deleting destructor': byte-identical (already on main) Peer-reviewed-by: Yommy, Toshiro, br4yan Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
93 lines
2.2 KiB
C++
93 lines
2.2 KiB
C++
#include "Render/DeviceContext/DeviceContext.h"
|
|
#include "UI/Lists/UIDropDownBox.h"
|
|
#include "UI/Window/UIWindowMgr.h"
|
|
#include "UI/Window/WindowBorder.h"
|
|
|
|
#include <algorithm>
|
|
|
|
// INLINED
|
|
CUIDropDownBox::CUIDropDownBox() : CUIControl(), owner(nullptr) {
|
|
}
|
|
|
|
// OFFSET: 0x009E3300
|
|
// FUNCTION: fn_45427
|
|
CUIDropDownBox::~CUIDropDownBox() {
|
|
this->Detach();
|
|
}
|
|
|
|
// OFFSET: 0x009E3430
|
|
// FUNCTION: fn_14416
|
|
void CUIDropDownBox::Detach() {
|
|
if (!this->m_children.empty()) {
|
|
this->ClearChildren(false);
|
|
this->owner = nullptr;
|
|
this->Invalidate();
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x009E3460
|
|
// FUNCTION: fn_14417
|
|
bool CUIDropDownBox::HasChild(const UIWindow* window) const {
|
|
return this->m_children.end() != std::find(this->m_children.begin(), this->m_children.end(), window);
|
|
}
|
|
|
|
// OFFSET: 0x009E3490
|
|
// FUNCTION: fn_14418
|
|
bool CUIDropDownBox::HasOwnerChild(const UIWindow* window) const {
|
|
if (!window || !this->owner) {
|
|
return false;
|
|
}
|
|
|
|
return this->owner->m_children.end() != std::find(this->owner->m_children.begin(), this->owner->m_children.end(), window);
|
|
}
|
|
|
|
// OFFSET: 0x009E3500
|
|
// FUNCTION: fn_14420
|
|
void CUIDropDownBox::Attach(UIWindow* value, UIWindow* child) {
|
|
if (this->HasChild(child)) {
|
|
return;
|
|
}
|
|
|
|
this->Detach();
|
|
this->Resize(child->geometry.width + 2, child->geometry.height + 2);
|
|
this->AddChild(child);
|
|
this->owner = value;
|
|
this->Invalidate();
|
|
}
|
|
|
|
// OFFSET: 0x009E34D0
|
|
// FUNCTION: fn_14419
|
|
void CUIDropDownBox::Paint() {
|
|
const std::uint32_t background = 0xFFFFFFFFu;
|
|
this->ClearSurface(background);
|
|
|
|
const std::uint32_t border = 0x00C6C6C6u;
|
|
DrawRectangleBorder(*this, 0, 0, this->geometry.width, this->geometry.height, border);
|
|
}
|
|
|
|
// OFFSET: 0x00AA27B0
|
|
// FUNCTION: fn_17217
|
|
void UIWindowMgr::ShowDropDown(UIWindow* owner, UIWindow* child, int x, int y) {
|
|
CUIDropDownBox*& popup = reinterpret_cast<CUIDropDownBox*&>(this->dropDownBoxWnd);
|
|
if (popup && popup->geometry.visible != 0) {
|
|
popup->Detach();
|
|
popup->Show(0);
|
|
}
|
|
|
|
if (!popup) {
|
|
popup = new CUIDropDownBox();
|
|
}
|
|
|
|
popup->Attach(owner, child);
|
|
popup->Move(x, y);
|
|
|
|
auto& rendered = this->rendered;
|
|
if (std::find(rendered.begin(), rendered.end(), popup) == rendered.end()) {
|
|
rendered.push_back(popup);
|
|
} else {
|
|
this->Promote(popup);
|
|
}
|
|
|
|
popup->Show(1);
|
|
}
|
|
|