Decompile 2 functions in Source/UI/StylingShop/UIStylingShopWnd.cpp

Batch #17098 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_10378 ToggleStylingAccessory: logic confirmed by peer review
- fn_10371 UIDisplayCharacter::SendMsg: logic confirmed by peer review

Peer-reviewed-by: alisonrag, Toshiro, br4yan
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-11 14:01:23 +00:00
commit a7d8300d9c

View file

@ -837,32 +837,32 @@ __declspec(noinline) void ToggleStylingAccessory(int itemId, int slot) {
switch (slot) {
case 0:
display = tab->m_display;
if (desc.viewId == display->topAccessory) {
display->topAccessoryItemId = 0;
display->topAccessory = 0;
} else {
if (desc.viewId != display->topAccessory) {
display->topAccessoryItemId = itemId;
display->topAccessory = desc.viewId;
} else {
display->topAccessoryItemId = 0;
display->topAccessory = 0;
}
break;
case 1:
display = tab->m_display;
if (desc.viewId == display->middleAccessory) {
display->middleAccessoryItemId = 0;
display->middleAccessory = 0;
} else {
if (desc.viewId != display->middleAccessory) {
display->middleAccessoryItemId = itemId;
display->middleAccessory = desc.viewId;
} else {
display->middleAccessoryItemId = 0;
display->middleAccessory = 0;
}
break;
case 2:
display = tab->m_display;
if (desc.viewId == display->bottomAccessory) {
display->bottomAccessoryItemId = 0;
display->bottomAccessory = 0;
} else {
if (desc.viewId != display->bottomAccessory) {
display->bottomAccessoryItemId = itemId;
display->bottomAccessory = desc.viewId;
} else {
display->bottomAccessoryItemId = 0;
display->bottomAccessory = 0;
}
break;
}
@ -1097,34 +1097,25 @@ int UIDisplayCharacter::SendMsg(UIWindow* sender, int message, std::intptr_t arg
}
switch (argument1) {
case ID_CANCEL:
this->LoadSessionStyle();
break;
case ID_RIGHT:
if (this->direction > 0) {
--this->direction;
} else {
this->direction = 7;
}
break;
case ID_LEFT:
this->direction = this->direction < 7 ? this->direction + 1 : 0;
break;
case ID_RIGHT:
if (this->direction <= 0) {
this->direction = 7;
} else {
--this->direction;
}
break;
case ID_PREVIEW:
this->SelectPreviousStyle(this->GetStyleTable(3).c_str(), &this->bodyStyle);
break;
case ID_CANCEL:
this->LoadSessionStyle();
break;
case ID_NEXTVIEW:
this->SelectNextStyle(this->GetStyleTable(3).c_str(), &this->bodyStyle);
break;
case ID_BOOKMARK:
if (this->m_favoriteButton->m_argument == 0) {
if (shop->AddToMyStyle() == true) {
g_windowMgr.Confirm(LookupMessage(MSI_PRIVATE_AIRPLANE_FAIL_LOCALIZING), 0, true, false, 0, "Message", 280, 120, 0);
} else {
this->m_favoriteButton->SetTooltip(LookupMessage(MSI_STYLING_SHOP_SUGGEST_TO_GO_TO_BANK));
}
}
break;
case 450:
this->SelectPreviousStyle(this->GetStyleTable(2).c_str(), &this->head);
break;
@ -1134,6 +1125,15 @@ int UIDisplayCharacter::SendMsg(UIWindow* sender, int message, std::intptr_t arg
case 495:
shop->SendMsg(nullptr, 495, 0, 0, 0, 0);
break;
case ID_BOOKMARK:
if (this->m_favoriteButton->m_argument == 0) {
if (shop->AddToMyStyle() == true) {
g_windowMgr.Confirm(LookupMessage(MSI_PRIVATE_AIRPLANE_FAIL_LOCALIZING), 0, true, false, 0, "Message", 280, 120, 0);
} else {
this->m_favoriteButton->SetTooltip(LookupMessage(MSI_STYLING_SHOP_SUGGEST_TO_GO_TO_BANK));
}
}
break;
}
this->Invalidate();