Batch #14943 by ragnarok-clanker: no function's compiled code changes; checked with 741 compiled unit(s), including every includer of Source/ActorPickNode.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeDragState.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Contents/AchievementMgr.h, Source/Contents/ActorNameCard.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObjectState.h, Source/Contents/Actors/Skill.h, Source/Contents/AdventureGuideMgr.h, Source/Contents/Camera/Camera.h, Source/Contents/Camera/CameraState.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AMachineEffect.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CaneOfEvilEyeEffect.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/CloudKillEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectMaker.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/FuumaShouakuEffect.h, Source/Contents/Effects/GravityControlEffect.h, Source/Contents/Effects/HealSpEffect.h, Source/Contents/Effects/Level99Effect.h, Source/Contents/Effects/MapChainEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/NyanggrassEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/PowderingEffect.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Effects/ShadowExceedEffect.h, Source/Contents/Effects/SkillEffects.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StormCannonEffect.h, Source/Contents/Effects/ThrowEffects.h, Source/Contents/EntryQueueMgr.h, Source/Contents/EquipmentResourceMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/GuildInfo.h, Source/Contents/Items/ItemDescription.h, Source/Contents/Items/ItemInfo.h, Source/Contents/MapSkyMgr.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Models/ModelNode.h, Source/Contents/NavigationManager.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/RDamageVar.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/RouletteMgr.h, Source/Contents/Schedule/Schedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/ClientSkills.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Skills/SkillInfo.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TipBoxTitles.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/World/World.h, Source/Contents/WorldView/WorldViewData.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/Textures/SpritePixels.h, Source/Render/Textures/Texture.h, Source/Resource/EZeffectResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Resource/XmlNode.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UISpriteButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/CashEmotion/UICashEmotionPack.h, Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UIChatRoomMakeWnd.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Chat/UISubChatMiniWnd.h, Source/UI/Chat/UIWhisperWnd.h, Source/UI/Clan/UIClanWnd.h, Source/UI/Dialogs/UIBookWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIMenuWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIMinimapZoomWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Dialogs/UISelectCartWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/Exchange/UIExchangeUI.h, Source/UI/FrameSkin.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Gauges/UIPcGage.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Guild/UIGuild_Storage_Log.h, Source/UI/Item/UIEquipmentPropertiesWnd.h, Source/UI/Item/UIItemBaseWnd.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemShopWnd.h, Source/UI/Item/UIItemShopWnd2.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIMerchantItemLogWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UICardItemIllustWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIGameItem.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemIdentifyWnd.h, Source/UI/Items/UIItemParamChangeDisplayWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Layout/WindowGeometry.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBoxV2Wnd.h, Source/UI/Lists/UIImgMenu.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITagListBox.h, Source/UI/Lists/UITreeView.h, Source/UI/Menu/UIMenuIconWnd.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIQuestDisplay.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h, Source/UI/Shop/UIMerchantItemPurchaseWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/Skill/UISkillDescribeWnd.h, Source/UI/Skill/UISkillListWnd.h, Source/UI/SkillDelayInfo/SkillDelayInfo.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/UIAchWnd.h, Source/UI/Text/UIBalloonText.h, Source/UI/Text/UINameBalloonText.h, Source/UI/Text/UIStaticTextControl.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBarGraph.h, Source/UI/UIBartermarketWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/UIMacroBlackListCheckWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroReport.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/UIPreviewEquipWnd.h, Source/UI/UIRefiningWnd.h, Source/UI/UIScrollWnd.h, Source/UI/UISlotBitmap.h, Source/UI/Window/FuncDrawWNDChar.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UIMonsterInfoWnd.h, Source/UI/Window/UINavigationHelpWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UIRodexContentsWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITransMenuWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Utility/Lexicon/LexiconSerializer.h.
384 lines
14 KiB
C++
384 lines
14 KiB
C++
#include "Render/Text/FontCache.h"
|
|
#include "UI/Window/UIEnums.h"
|
|
#include "Client/Mode/ModeMessage.h"
|
|
#include "Render/Text/TextContext.h"
|
|
#include "UI/UIIngredientInfoWnd.h"
|
|
#include "UI/UILapineScrollBar.h"
|
|
|
|
#include "Client/Mode/CMode.h"
|
|
#include "Client/Mode/ModeDragState.h"
|
|
#include "Client/Mode/ModeMgr.h"
|
|
#include "Client/Session.h"
|
|
#include "Contents/Items/ItemDescription.h"
|
|
#include "Contents/MessageTable.h"
|
|
#include "Network/Connection/Connection.h"
|
|
#include "Network/Packets/PacketId.h"
|
|
#include "Network/Packets/PacketLengths.h"
|
|
#include "Resource/Bitmap/BitmapResource.h"
|
|
#include "Resource/ResourceMgr.h"
|
|
#include "Resource/TextureNames.h"
|
|
#include "UI/Buttons/UIBitmapButton.h"
|
|
#include "UI/Shop/ItemDrawing.h"
|
|
#include "Utility/Text/FormatString.h"
|
|
|
|
#include "Resource/MSGSTRINGID.h"
|
|
#include <algorithm>
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <windows.h>
|
|
#include <timeapi.h>
|
|
|
|
// OFFSET: 0x005FF800
|
|
// FUNCTION: fn_04148
|
|
void UILapineScrollBarNoop() {}
|
|
|
|
// OFFSET: 0x005FF810
|
|
// FUNCTION: fn_04149
|
|
void UIIngredientInfoWnd::DragAndDrop(int argument1, int argument2, std::intptr_t argument3) {
|
|
this->parent->DragAndDrop(argument1, argument2, argument3);
|
|
}
|
|
|
|
// OFFSET: 0x005FF910
|
|
// FUNCTION: fn_04152
|
|
void UIIngredientInfoWnd::Move(int x, int y) {
|
|
UIWindow::Move(x, y);
|
|
}
|
|
|
|
// OFFSET: 0x00600270
|
|
// FUNCTION: fn_04158
|
|
void UILapineScrollBar::Paint() {
|
|
const auto load = [](const char* name) {
|
|
return static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(name)));
|
|
};
|
|
this->ClearSurface(0xFFFF00FF);
|
|
if (this->maximum == 0) {
|
|
return;
|
|
}
|
|
|
|
if (this->vertical == 1) {
|
|
CBitmapRes* top = load("유저인터페이스\\lapine\\scrollbar_bg_top.bmp");
|
|
CBitmapRes* bottom = load("유저인터페이스\\lapine\\scrollbar_bg_btm.bmp");
|
|
CBitmapRes* middle = load("유저인터페이스\\lapine\\scrollbar_bg_mid.bmp");
|
|
this->DrawBitmap(0, 0, top, true);
|
|
|
|
const int interior = this->geometry.height - bottom->image.height - top->image.height;
|
|
const int count = interior / middle->image.height + (interior % middle->image.height != 0);
|
|
for (int index = 0; index < count; ++index) {
|
|
this->DrawBitmap(0, middle->image.height * index + top->image.height, middle, true);
|
|
}
|
|
this->DrawBitmap(0, this->geometry.height - bottom->image.height, bottom, true);
|
|
|
|
const int travel = this->geometry.height - bottom->image.height - top->image.height;
|
|
const int thumbLength = this->visible * travel / this->total;
|
|
const int thumbOffset = this->position * travel / this->total;
|
|
|
|
if (this->state == 0) {
|
|
CBitmapRes* capTop = load("유저인터페이스\\lapine\\scrollbar_thumb_out_top.bmp");
|
|
CBitmapRes* capBottom = load("유저인터페이스\\lapine\\scrollbar_thumb_out_btm.bmp");
|
|
CBitmapRes* fill = load("유저인터페이스\\lapine\\scrollbar_thumb_out_mid.bmp");
|
|
const int span = thumbLength - capBottom->image.height - capTop->image.height;
|
|
const int pieces = span / fill->image.height + (span % fill->image.height != 0);
|
|
for (int index = 0; index < pieces; ++index) {
|
|
this->DrawBitmap(0, fill->image.height * index + thumbOffset + capTop->image.height + top->image.height, fill, true);
|
|
}
|
|
this->DrawBitmap(0, top->image.height + thumbOffset, capTop, true);
|
|
this->DrawBitmap(0, thumbOffset - capBottom->image.height + thumbLength + top->image.height, capBottom, true);
|
|
} else if (this->state == 3) {
|
|
CBitmapRes* capTop = load("유저인터페이스\\lapine\\scrollbar_thumb_over_top.bmp");
|
|
CBitmapRes* capBottom = load("유저인터페이스\\lapine\\scrollbar_thumb_over_btm.bmp");
|
|
CBitmapRes* fill = load("유저인터페이스\\lapine\\scrollbar_thumb_over_mid.bmp");
|
|
const int span = thumbLength - capBottom->image.height - capTop->image.height;
|
|
const int pieces = span / fill->image.height + (span % fill->image.height != 0);
|
|
for (int index = 0; index < pieces; ++index) {
|
|
this->DrawBitmap(0, fill->image.height * index + thumbOffset + capTop->image.height + top->image.height, fill, true);
|
|
}
|
|
this->DrawBitmap(0, top->image.height + thumbOffset, capTop, true);
|
|
this->DrawBitmap(0, thumbOffset - capBottom->image.height + thumbLength + top->image.height, capBottom, true);
|
|
} else if (this->state == 6) {
|
|
CBitmapRes* capTop = load("유저인터페이스\\lapine\\scrollbar_thumb_press_top.bmp");
|
|
CBitmapRes* capBottom = load("유저인터페이스\\lapine\\scrollbar_thumb_press_btm.bmp");
|
|
CBitmapRes* fill = load("유저인터페이스\\lapine\\scrollbar_thumb_press_mid.bmp");
|
|
const int span = thumbLength - capBottom->image.height - capTop->image.height;
|
|
const int pieces = span / fill->image.height + (span % fill->image.height != 0);
|
|
for (int index = 0; index < pieces; ++index) {
|
|
this->DrawBitmap(0, fill->image.height * index + thumbOffset + capTop->image.height + top->image.height, fill, true);
|
|
}
|
|
this->DrawBitmap(0, top->image.height + thumbOffset, capTop, true);
|
|
this->DrawBitmap(0, thumbOffset - capBottom->image.height + thumbLength + top->image.height, capBottom, true);
|
|
}
|
|
}
|
|
|
|
this->minimumThumb = 0;
|
|
this->parent->Invalidate();
|
|
}
|
|
|
|
// OFFSET: 0x00600260
|
|
// FUNCTION: fn_04157
|
|
void UILapineBox_IngredientListWnd::Paint() {
|
|
this->ClearSurface(0xFFF7F7);
|
|
}
|
|
|
|
// OFFSET: 0x005FF130
|
|
// FUNCTION: fn_45447
|
|
UILapineBox_IngredientListWnd::UILapineBox_IngredientListWnd(int width, int height)
|
|
: UIScrollWnd(width, height, 0), minRefine(0), maxRefine(20) {
|
|
this->Resize(width, height);
|
|
this->OnCreate(width, height);
|
|
}
|
|
|
|
// OFFSET: 0x005FF820
|
|
// FUNCTION: fn_04150
|
|
void UILapineBoxWnd::DragAndDrop(int, int, std::intptr_t value) {
|
|
CMode* mode = g_modeMgr.GetGameMode();
|
|
const ModeDragState* drag = reinterpret_cast<const ModeDragState*>(value);
|
|
if (this->items.size() < static_cast<unsigned>(this->maxItems) && drag->source == 27) {
|
|
const int result = this->ingredientList->SendMsg(this, UM_DECITEM, drag->id, 0, 0, 0);
|
|
if (result >= 0) {
|
|
this->AddIngredient(drag->id, drag->quantity);
|
|
}
|
|
}
|
|
mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0);
|
|
}
|
|
|
|
// OFFSET: 0x005FF8B0
|
|
// FUNCTION: fn_04151
|
|
void UILapineBox_IngredientListWnd::DragAndDrop(int, int, std::intptr_t value) {
|
|
CMode* mode = g_modeMgr.GetGameMode();
|
|
const ModeDragState* drag = reinterpret_cast<const ModeDragState*>(value);
|
|
if (drag->source == 26) {
|
|
if (this->AddIngredient(drag->id) == 1) {
|
|
this->parent->SendMsg(this, UM_DECITEM, drag->id, 0, 0, 0);
|
|
}
|
|
}
|
|
mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0);
|
|
}
|
|
|
|
// OFFSET: 0x005FF920
|
|
// FUNCTION: fn_04153
|
|
void UILapineBoxWnd::OnCreate(int, int) {
|
|
this->AddBaseButton();
|
|
this->AddCloseButton("", 0);
|
|
|
|
UILapineBox_IngredientListWnd* list = new UILapineBox_IngredientListWnd(150, 204);
|
|
this->ingredientList = list;
|
|
list->Move(241, 17);
|
|
this->AddChild(list);
|
|
|
|
UIBitmapButton* cancel = new UIBitmapButton();
|
|
this->cancelButton = cancel;
|
|
cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_out.bmp", 0, 0);
|
|
cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_over.bmp", 1, 0);
|
|
cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_press.bmp", 2, 0);
|
|
cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_dis.bmp", 3, 0);
|
|
cancel->SetSize(cancel->BitmapWidth(), cancel->BitmapHeight());
|
|
cancel->Move(280, 226);
|
|
cancel->SetId(201);
|
|
this->AddChild(cancel);
|
|
|
|
UIBitmapButton* make = new UIBitmapButton();
|
|
this->makeButton = make;
|
|
make->SetBitmap("유저인터페이스\\lapine\\btn_make_out.bmp", 0, 0);
|
|
make->SetBitmap("유저인터페이스\\lapine\\btn_make_over.bmp", 1, 0);
|
|
make->SetBitmap("유저인터페이스\\lapine\\btn_make_press.bmp", 2, 0);
|
|
make->SetBitmap("유저인터페이스\\lapine\\btn_make_dis.bmp", 3, 0);
|
|
make->SetSize(make->BitmapWidth(), make->BitmapHeight());
|
|
make->Move(340, 226);
|
|
make->SetId(503);
|
|
this->AddChild(make);
|
|
|
|
UIBitmapButton* move = new UIBitmapButton();
|
|
this->moveButton = move;
|
|
move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_out.bmp", 0, 0);
|
|
move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_over.bmp", 1, 0);
|
|
move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_press.bmp", 2, 0);
|
|
move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_dis.bmp", 3, 0);
|
|
move->SetSize(move->BitmapWidth(), move->BitmapHeight());
|
|
move->Move(213, 110);
|
|
move->SetId(505);
|
|
this->AddChild(move);
|
|
}
|
|
|
|
// OFFSET: 0x005FFCD0
|
|
// FUNCTION: fn_04154
|
|
void UILapineBox_IngredientListWnd::OnCreate(int width, int height) {
|
|
this->scrollBarWidth = 9;
|
|
if (this->scrollBar != nullptr) {
|
|
this->RemoveChild(this->scrollBar, 0);
|
|
if (this->scrollBar != nullptr) {
|
|
delete this->scrollBar;
|
|
}
|
|
this->scrollBar = nullptr;
|
|
}
|
|
|
|
UILapineScrollBar* bar = new UILapineScrollBar();
|
|
this->scrollBar = bar;
|
|
bar->Configure(width - this->scrollBarWidth, 0, 1, height - this->scrollBarHeight);
|
|
this->AddChild(this->scrollBar);
|
|
}
|
|
|
|
// OFFSET: 0x005FFDC0
|
|
// FUNCTION: fn_04155
|
|
void UIIngredientInfoWnd::Paint() {
|
|
this->ClearSurface(0xFFF7F7);
|
|
if (this->selected == 1) {
|
|
CBitmapRes* selected = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\list_selected_item.bmp")));
|
|
this->DrawBitmap(32, 0, selected, false);
|
|
}
|
|
|
|
std::string name;
|
|
name = this->FitDisplayText(100, this->item.displayName.c_str(), 0, 12, 0).c_str();
|
|
|
|
std::uint32_t color = 0;
|
|
if (this->insufficient == 0) {
|
|
DrawItemWithQuantity(*this, ResourceMgr::Instance(), 4, 3, this->item, 0, 0);
|
|
} else {
|
|
DrawItemWithQuantityAuxiliary(*this, 2, 4, 3, this->item, this->item.identified, 0);
|
|
color = 0x969696;
|
|
}
|
|
|
|
this->DrawShadowedText(36, 9, name.c_str(), 0, color, 0xE0E0E0, 0, 12, 0);
|
|
}
|
|
|
|
// OFFSET: 0x005FFF90
|
|
// FUNCTION: fn_04156
|
|
void UILapineBoxWnd::Paint() {
|
|
CBitmapRes* background = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\bg_lapine.bmp")));
|
|
this->DrawBitmap(0, 0, background, true);
|
|
|
|
if (this->title.size() != 0) {
|
|
this->DrawTitleBar(false, this->title.c_str(), 0);
|
|
}
|
|
|
|
this->DrawCenteredText(33, 47, LookupMessage(MSI_LAPINE_FAIL_NOT_ENOUGH_REFINING_LEVEL), 160, 0, 11, 0xCD7A51, 0);
|
|
this->DrawCenteredText(33, 63, this->description.c_str(), 160, 0, 11, 0x844A42, 0);
|
|
|
|
const std::string count = FormatOwnedString("%d", static_cast<int>(this->items.size()));
|
|
this->DrawCenteredText(98, 76, count.c_str(), 14, 0, 11, 0xFFFFFF, 0);
|
|
const std::string maximum = FormatOwnedString("%d", this->maxItems);
|
|
this->DrawCenteredText(115, 76, maximum.c_str(), 14, 0, 11, 0xFFFFFF, 0);
|
|
|
|
for (unsigned index = 0; index < this->items.size(); ++index) {
|
|
int position[2];
|
|
this->MaterialPosition(position, index);
|
|
const int x = position[0];
|
|
const int y = position[1];
|
|
CBitmapRes* slot = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\shadow_item_off.bmp")));
|
|
this->DrawBitmap(x - 4, y + 11, slot, true);
|
|
DrawItemWithQuantity(*this, ResourceMgr::Instance(), x, y, this->items[index], 0, 0);
|
|
}
|
|
|
|
if (timeGetTime() < this->noticeTick + this->noticeDuration) {
|
|
CBitmapRes* icon = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\icon_notify.bmp")));
|
|
this->DrawBitmap(6, 229, icon, true);
|
|
this->DrawTextAt(25, 230, this->notice.c_str(), 0, 0, 12, 0xFF0000, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00601D20
|
|
// FUNCTION: fn_04177
|
|
int UILapineBoxWnd::AddIngredient(std::uint32_t id, int quantity) {
|
|
if (this->items.size() < 10) {
|
|
if (std::find_if(this->items.begin(), this->items.end(), [id](ITEM_INFO entry) { return id == entry.identity[1]; }) != this->items.end()) {
|
|
return 0;
|
|
}
|
|
ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, id);
|
|
item.quantity = quantity;
|
|
{
|
|
std::vector<char*> breaks;
|
|
char name[260];
|
|
std::memset(name, 0, sizeof(name));
|
|
char* highlight = nullptr;
|
|
std::size_t remaining = sizeof(name);
|
|
char* cursor = name;
|
|
int highlightColor;
|
|
this->BuildItemName(&item, &highlightColor, &breaks, &cursor, &remaining, &highlight, 1, 0);
|
|
if (item.identified == 1 && item.optionCount != 0) {
|
|
sprintf_s(name, sizeof(name), LookupMessage(MSI_FAILED_MAIL_LIMIT_CNT), name, item.optionCount);
|
|
}
|
|
item.SetName(name);
|
|
}
|
|
this->items.push_back(item);
|
|
if (static_cast<int>(this->items.size()) == this->maxItems) {
|
|
this->moveButton->SetDisabled(1);
|
|
this->moveButton->Invalidate();
|
|
}
|
|
this->Invalidate();
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// OFFSET: 0x00602030
|
|
// FUNCTION: fn_04178
|
|
unsigned char UILapineBox_IngredientListWnd::AddIngredient(std::uint32_t id) {
|
|
ITEM_INFO owned = LookupClientItemByIdentity(g_session.m_inventoryItems, id);
|
|
if (owned.identity[1] == 0) {
|
|
return 0;
|
|
}
|
|
|
|
const int itemId = std::atoi(owned.itemId.c_str());
|
|
if (g_session.IsPetEgg(itemId) == 1 && owned.damaged == 1) {
|
|
return 0;
|
|
}
|
|
|
|
if (g_session.HasItem61B8(owned.identity[1]) == 1) {
|
|
return 0;
|
|
}
|
|
|
|
auto it = std::find_if(this->materials.begin(), this->materials.end(), [owned](ITEM_INFO mat) {
|
|
return std::atoi(owned.itemId.c_str()) == std::atoi(mat.itemId.c_str());
|
|
});
|
|
|
|
if (it == this->materials.end()) {
|
|
return 0;
|
|
}
|
|
|
|
for (UIIngredientInfoWnd* itemWnd : this->items) {
|
|
if (itemWnd->item.identity[1] == id) {
|
|
itemWnd->item.quantity += it->quantity;
|
|
itemWnd->insufficient = 0;
|
|
itemWnd->Show(1);
|
|
itemWnd->Invalidate();
|
|
this->Invalidate();
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
UILapineBoxWnd* owner = static_cast<UILapineBoxWnd*>(this->parent);
|
|
UIIngredientInfoWnd* info = new UIIngredientInfoWnd();
|
|
info->SetSize(136, 30);
|
|
info->SetIngredientItem(id);
|
|
info->quantity = it->quantity;
|
|
this->AddScrollChild(info);
|
|
|
|
if (owned.quantity < it->quantity) {
|
|
info->insufficient = 1;
|
|
}
|
|
|
|
if (this->minRefine > owned.refiningLevel || this->maxRefine < owned.refiningLevel) {
|
|
info->insufficient = 1;
|
|
}
|
|
|
|
info->Invalidate();
|
|
this->items.push_back(info);
|
|
this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0);
|
|
return 1;
|
|
}
|
|
|
|
|
|
// OFFSET: 0x005FF210
|
|
// FUNCTION: fn_04141
|
|
UILapineScrollBar::UILapineScrollBar() : UIScrollBar() {
|
|
this->arrowLength = 0;
|
|
}
|
|
|
|
// OFFSET: 0x005FF370
|
|
// FUNCTION: fn_04143
|
|
UIIngredientInfoWnd::~UIIngredientInfoWnd() = default;
|
|
|
|
UILapineBoxWnd::~UILapineBoxWnd() {
|
|
this->items.clear();
|
|
short packetType = ID_CZ_RANDOM_COMBINE_ITEM_UI_CLOSE;
|
|
CRagConnection& connection = GetRagConnection();
|
|
connection.Send(reinterpret_cast<const PacketLengths&>(GetRagConnection()).FixedLength(packetType), &packetType);
|
|
}
|