rodecomp/Source/UI/Shop/UIMerchantShopTitle.cpp
ragnarok-clanker d7c1911fa6 Maintenance: Move explicit-template linkage declarations out of the game source. 105 units' extern template lines (and the std tree a
Batch #17237 by ragnarok-clanker: no function's compiled code changes; checked with 105 compiled unit(s), including every includer of Source/Linkage/Source/Client/Mode/LoginMode.cpp.h, Source/Linkage/Source/Client/Session/SessionAchievements.cpp.h, Source/Linkage/Source/Client/Session/SessionPredicates.cpp.h, Source/Linkage/Source/Client/Session/SessionState.cpp.h, Source/Linkage/Source/Contents/Achievement/AchievementMgr.cpp.h, Source/Linkage/Source/Contents/Actors/ActorPickNode.cpp.h, Source/Linkage/Source/Contents/Actors/MercenaryAI.cpp.h, Source/Linkage/Source/Contents/Actors/Resources/RobeResources.cpp.h, Source/Linkage/Source/Contents/CashEmotion/CashEmotionMgr.cpp.h, Source/Linkage/Source/Contents/Effects/EffectResourceSwitcher.cpp.h, Source/Linkage/Source/Contents/Effects/Particles/AnimatedEmitterEffect.cpp.h, Source/Linkage/Source/Contents/Effects/Particles/Particle.cpp.h, Source/Linkage/Source/Contents/Effects/Skills/MonsterSkillEffects.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemCache.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataDownloadAsyncWork.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataMgr.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataUploadAsyncWork.cpp.h, Source/Linkage/Source/Contents/Emblems/GuildEmblemLookup.cpp.h, Source/Linkage/Source/Contents/Hotkeys/EmotionHotkeys.cpp.h, Source/Linkage/Source/Contents/Items/ItemInfo.cpp.h, Source/Linkage/Source/Contents/Items/ItemNaming.cpp.h, Source/Linkage/Source/Contents/Map/PrivateAirplaneMgr.cpp.h, Source/Linkage/Source/Contents/Map/TownInfoMgr.cpp.h, Source/Linkage/Source/Contents/Messenger/MessengerMember.cpp.h, Source/Linkage/Source/Contents/Messenger/WhisperBlockMgr.cpp.h, Source/Linkage/Source/Contents/Models/ModelLighting.cpp.h, Source/Linkage/Source/Contents/Movies/BinkMovies.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationDestinations.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationRequest.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationRoute.cpp.h, Source/Linkage/Source/Contents/Party/AgencyRequests.cpp.h, Source/Linkage/Source/Contents/Party/LoadPartyInfoAsyncWork.cpp.h, Source/Linkage/Source/Contents/Party/LoadPartyListAsyncWork.cpp.h, Source/Linkage/Source/Contents/Party/RegisterPartyAsyncWork.cpp.h, Source/Linkage/Source/Contents/Repute/ReputeMgr.cpp.h, Source/Linkage/Source/Contents/Sound/SoundMgr.cpp.h, Source/Linkage/Source/Contents/Store/MCStoreInfoBackup.cpp.h, Source/Linkage/Source/Contents/Store/MCStoreInfoBackupAsyncWork.cpp.h, Source/Linkage/Source/Contents/Time/ClientTiming.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataSaveAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterConfigSave.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterLinkedUserDataLoadAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterLinkedUserDataSaveAsyncWork.cpp.h, Source/Linkage/Source/File/DirectoryRemoval.cpp.h, Source/Linkage/Source/Network/NIPAddr.cpp.h, Source/Linkage/Source/Network/Packets/ActorNamePacket.cpp.h, Source/Linkage/Source/Render/Device/RenderBackends.cpp.h, Source/Linkage/Source/Render/Primitives/ScreenLine.cpp.h, Source/Linkage/Source/Render/Text/EmbedFont.cpp.h, Source/Linkage/Source/Resource/Models/RmaResource.cpp.h, Source/Linkage/Source/Resource/ResourceFailures.cpp.h, Source/Linkage/Source/Script/LuaScript.cpp.h, Source/Linkage/Source/Security/NProtectGameGuardMgr.cpp.h, Source/Linkage/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp.h, Source/Linkage/Source/UI/Achievement/UIAchWnd.cpp.h, Source/Linkage/Source/UI/Buttons/UINaviLinkButton.cpp.h, Source/Linkage/Source/UI/CashShop/UICashShopWnd.cpp.h, Source/Linkage/Source/UI/Chat/UIChatRoomTitle.cpp.h, Source/Linkage/Source/UI/Dialogs/UIMessageBox.cpp.h, Source/Linkage/Source/UI/Dialogs/UINoteWnd.cpp.h, Source/Linkage/Source/UI/Edit/UIEditCtrl3.cpp.h, Source/Linkage/Source/UI/Enchant/UIEnchantUI.cpp.h, Source/Linkage/Source/UI/EntryQueue/UIEntryQueueWnd.cpp.h, Source/Linkage/Source/UI/Events/UICheckAttendanceWnd.cpp.h, Source/Linkage/Source/UI/GameSettings/GameSettingsUI.cpp.h, Source/Linkage/Source/UI/GameSettings/UIHotkeyGuideWnd.cpp.h, Source/Linkage/Source/UI/Gauges/UIBarGraph.cpp.h, Source/Linkage/Source/UI/Guild/UIGuildHelperWnd.cpp.h, Source/Linkage/Source/UI/Items/UIEquipmentPropertiesWnd.cpp.h, Source/Linkage/Source/UI/Items/UIItemReformWnd.cpp.h, Source/Linkage/Source/UI/Items/UIItemStoreComboBox.cpp.h, Source/Linkage/Source/UI/Items/UILapineBoxWnd.cpp.h, Source/Linkage/Source/UI/Items/UIMakeTargetProcessWnd.cpp.h, Source/Linkage/Source/UI/Items/UIMerchantItemLogWnd.cpp.h, Source/Linkage/Source/UI/Items/UISwapEquipmentWnd.cpp.h, Source/Linkage/Source/UI/Lists/UIChatHisBox.cpp.h, Source/Linkage/Source/UI/Lists/UIComboBoxDefWnd.cpp.h, Source/Linkage/Source/UI/Login/UIPasswordWnd.cpp.h, Source/Linkage/Source/UI/Macro/UIMacroDetectorWnd.cpp.h, Source/Linkage/Source/UI/Navigation/NavigationLink.cpp.h, Source/Linkage/Source/UI/Party/UIApplyForPartyWnd.cpp.h, Source/Linkage/Source/UI/Party/UIRegisterPartyWnd.cpp.h, Source/Linkage/Source/UI/Party/UISeekPartyMBWnd.cpp.h, Source/Linkage/Source/UI/Quest/UIRecommendedQuestInfo.cpp.h, Source/Linkage/Source/UI/Repute/UIReputeWnd.cpp.h, Source/Linkage/Source/UI/Rodex/UIRodexComposeWnd.cpp.h, Source/Linkage/Source/UI/RuneSystem/UIRuneSystemWnd.cpp.h, Source/Linkage/Source/UI/Shop/UIMerchantShopTitle.cpp.h, Source/Linkage/Source/UI/Shortcuts/UIShortCutWnd.cpp.h, Source/Linkage/Source/UI/Skill/UIGraffiStrboxWnd.cpp.h, Source/Linkage/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp.h, Source/Linkage/Source/UI/Status/UIBasicInfoWnd.cpp.h, Source/Linkage/Source/UI/Text/ColoredText.cpp.h, Source/Linkage/Source/UI/Text/ItemLinkDisplay.cpp.h, Source/Linkage/Source/UI/Text/TextMarkup.cpp.h, Source/Linkage/Source/UI/Text/UITagTextViewer.cpp.h, Source/Linkage/Source/UI/Text/UITextViewer.cpp.h, Source/Linkage/Source/UI/Window/UIFrameWnd.cpp.h, Source/Linkage/Source/UI/Window/UIWindow.cpp.h, Source/Linkage/Source/UI/Window/UIWindowFactory.cpp.h, Source/Linkage/Source/UI/Window/WindowRegistration.cpp.h, Source/Linkage/Source/UI/Window/WindowRetirement.cpp.h, Source/Linkage/Source/Utility/Threading/NThread.cpp.h.
2026-11-11 16:21:46 +00:00

163 lines
4.6 KiB
C++

#include "Client/Mode/CMode.h"
#include "Client/Mode/ModeMessage.h"
#include "UI/Window/UIEnums.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session/Session.h"
#include "Contents/Configuration/ServiceOptions.h"
#include "Contents/Tables/ForbiddenWords.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "Resource/ResourceMgr.h"
#include "Resource/Bitmap/TextureNames.h"
#include "UI/Shop/UIMerchantShopTitle.h"
#include "UI/Login/UINewSelectCharWnd.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Window/WindowBorder.h"
#include "UI/Text/UIStaticText.h"
// OFFSET: 0x0085ACE0
// FUNCTION: fn_10788
void UIMerchantShopTitle::OnCreate(int, int) {
this->label = new UIStaticText();
this->label->SetSize(this->geometry.width - 34, 15);
this->label->Move(31, 8);
this->label->SetTextFitted("");
auto* const label = this->label;
label->fontFamily = 0;
label->fontHeight = 12;
label->bold = 0;
label->italic = 0;
this->AddChild(this->label);
}
// OFFSET: 0x0085D150
// FUNCTION: fn_10811
void UIMerchantShopTitle::Paint() {
this->ClearSurface(0xFFFF00FF);
const std::uint32_t color = this->ownerAid == g_session.storeSearchOwnerAid ? 0x7DFAFF : 0xFFFFFF;
DrawFilledRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height - 6, color);
DrawRoundedBorder(*this, 2, 2, this->geometry.width - 4, this->geometry.height - 10, 0xC3C3C3);
const char* icon = this->buyingShop != 0 ? "유저인터페이스\\buyingshop.bmp" : "유저인터페이스\\shop.bmp";
this->DrawBitmap(3, 3, static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(icon))), true);
}
// OFFSET: 0x0085EC40
// FUNCTION: fn_10843
void UIMerchantShopTitle::OnLBtnDown(int, int) {
if (!g_serviceOptions.Get(167)) {
return;
}
CMode* mode = g_modeMgr.GetGameMode();
if (this->buyingShop != 0) {
if (g_windowMgr.merchantItemPurchaseWnd == 0) {
mode->SendMsg(MM_REQ_CLICK_TO_BUYING_STORE, this->ownerAid, 0, 0, 0);
}
} else if (g_windowMgr.buyingShopItemsWnd == 0) {
mode->SendMsg(MM_REQ_BUY_FROMMC, this->ownerAid, 0, 0, 0);
}
}
// OFFSET: 0x0085E920
// FUNCTION: fn_10832
void UIMerchantShopTitle::OnLBtnDblClk(int, int) {
CMode* mode = g_modeMgr.GetGameMode();
if (this->buyingShop != 0) {
if (g_windowMgr.merchantItemPurchaseWnd == 0) {
mode->SendMsg(MM_REQ_CLICK_TO_BUYING_STORE, this->ownerAid, 0, 0, 0);
}
} else if (g_windowMgr.buyingShopItemsWnd == 0) {
mode->SendMsg(MM_REQ_BUY_FROMMC, this->ownerAid, 0, 0, 0);
}
}
// OFFSET: 0x0085F9E0
// FUNCTION: fn_10878
void UIMerchantShopTitle::ResetCursor(int x, int y) {
if (x >= 0 && x < this->geometry.width && y >= 0 && y <= this->geometry.height) {
g_modeMgr.gameMode->SetCursorAction(2);
} else {
g_modeMgr.gameMode->SetCursorAction(0);
}
}
// OFFSET: 0x0085FE20
// FUNCTION: fn_10886
void UIMerchantShopTitle::OnRBtnDown(int, int) {
if (g_serviceOptions.Get(167)) {
g_modeMgr.gameMode->SendMsg(MM_RELEASE_QUEST_SH, 0, 0, 0, 0);
g_session.ClearItems1760And1748();
}
}
// OFFSET: 0x0084FE60
// FUNCTION: fn_10667
UIMerchantShopTitle::UIMerchantShopTitle(int buyingShop) : UIWindow(0), buyingShop(buyingShop) {
this->geometry.id = 189;
}
// OFFSET: 0x00864DB0
// FUNCTION: fn_10918
int UIMerchantShopTitle::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message == UM_COMMAND) {
return 0;
}
if (message == UM_SETNAID) {
this->ownerAid = a;
return 0;
}
if (message != UM_SETINFO) {
return UIWindow::SendMsg(sender, message, a, b, c, d);
}
char* text = reinterpret_cast<char*>(a);
if (g_forbiddenWords.Contains(text) == true) {
std::string masked;
g_forbiddenWords.Mask(text, &masked);
}
std::string title(text);
const std::size_t end = title.find('\r');
if (end != std::string::npos) {
title = title.substr(0, end);
}
this->fontStyle = static_cast<std::int16_t>(b);
switch (this->fontStyle) {
case 1:
this->label->fontFamily = 21;
break;
case 2:
this->label->fontFamily = 20;
break;
case 3:
this->label->fontFamily = 22;
break;
case 4:
this->label->fontFamily = 23;
break;
case 5:
this->label->fontFamily = 24;
break;
case 6:
this->label->fontFamily = 25;
break;
case 7:
this->label->fontFamily = 26;
break;
case 8:
this->label->fontFamily = 27;
break;
case 9:
this->label->fontFamily = 28;
break;
default:
this->label->fontFamily = 0;
break;
}
this->label->bold = 0;
this->label->italic = 0;
this->label->fontHeight = 12;
this->label->SetTextFitted(title.c_str());
this->Invalidate();
return 0;
}