rodecomp/Source/UI/Party/UIMiniPartyWnd.cpp
ragnarok-clanker dc3d5ce1a5 Maintenance: Resubmission of 14942 (gate: three existing in-class helpers whose lines changed lacked an annotation; marked // INLINED
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.
2026-11-08 16:44:36 +00:00

586 lines
20 KiB
C++

#include "UI/Party/UIMiniPartyWnd.h"
#include "Client/Mode/ModeMessage.h"
#include "UI/Window/UIEnums.h"
#include "UI/Window/WindowId.h"
#include "UI/Window/UIEnums.h"
#include "Client/Input/Mouse.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/MapInfoMgr.h"
#include "Contents/Actors/Pc.h"
#include "Contents/World/World.h"
#include "File/ShortcutFilename.h"
#include "Render/Renderer.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "UI/Buttons/UITextButton.h"
#include "Client/Session.h"
#include "Contents/MessageTable.h"
#include "Contents/Messenger/ClientMessenger.h"
#include "Resource/ResourceMgr.h"
#include "Resource/TextureNames.h"
#include "UI/Gauges/UIPcGage.h"
#include "UI/MiniPartyGrid.h"
#include "UI/Layout/SnapMgr.h"
#include "UI/Window/MiniPartyWndAreaMgr.h"
#include "UI/Window/UIWindowMgr.h"
#include "Client/Mode/CMode.h"
#include "Resource/MSGSTRINGID.h"
#include <windows.h>
#include <timeapi.h>
#include <cstdio>
#include <cstring>
#include <list>
#include <string>
// OFFSET: 0x007426F0
// FUNCTION: fn_07737
UIMiniPartyWnd::UIMiniPartyWnd()
: UIFrameWnd(1), m_cell(-1), m_infoWnd(nullptr), m_background(nullptr), m_sizeMode(0) {
this->m_imageName = "유저인터페이스\\renewalparty\\img_partymini_bg.tga";
this->geometry.id = 301;
}
// OFFSET: 0x00742AA0
// FUNCTION: fn_07739
void UIMiniPartyWnd::Move(int x, int y) {
this->geometry.x = x;
this->geometry.y = y;
}
// OFFSET: 0x00742AC0
// FUNCTION: fn_07740
void UIMiniPartyWnd::OnCreate(int, int) {
UIMiniPartyInfoWnd* info = new UIMiniPartyInfoWnd();
this->m_infoWnd = info;
info->m_owner = this;
info->SetSize(174, 52);
info->Move(0, 0);
this->AddChild(info);
this->m_widths.resize(3);
this->m_widths[0] = 174;
this->m_widths[1] = 101;
this->m_widths[2] = 64;
}
// OFFSET: 0x00742BE0
// FUNCTION: fn_07741
void UIMiniPartyWnd::Paint() {
this->m_primitives.clear();
const int count = this->m_member.offline != 1 ? 3 : 1;
for (int index = 0; index < count; ++index) {
this->DrawNamed(g_renderer->primitives, 0, 0, this->m_imageName, 0xFFFFFFFF, 0, 0);
}
}
// OFFSET: 0x00742D80
// FUNCTION: fn_07742
void UIMiniPartyWnd::OnLBtnDown(int x, int y) {
if (g_windowMgr.lastWindowId != this->geometry.id) {
g_windowMgr.BringToFront(this->geometry.id);
g_windowMgr.lastWindowId = this->geometry.id;
}
g_windowMgr.SetCapture(this);
int screenX = x;
int screenY = y;
this->ToScreen(screenX, screenY);
this->m_dragX = screenX;
this->m_dragY = screenY;
this->m_originX = this->geometry.x;
this->m_originY = this->geometry.y;
this->geometry.alphaStart = timeGetTime();
g_snapMgr.CaptureOrigins(this);
}
// OFFSET: 0x00740B80
// FUNCTION: fn_07731
void UIMiniPartyInfoWnd::OnLBtnDown(int x, int y) {
if (!g_session.m_lockMouse) {
this->m_owner->OnLBtnDown(x, y);
}
if (this->m_owner->GetMember().valid && this->m_owner->GetMember().offline == 0) {
CGameMode* mode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (mode) {
mode->TargetActorByAid(this->m_owner->GetMember().accountId);
}
}
}
// OFFSET: 0x00740D10
// FUNCTION: fn_07732
void UIMiniPartyInfoWnd::OnLBtnUp(int x, int y) {
if (g_session.m_lockMouse != true && this == g_windowMgr.Capture()) {
this->m_owner->OnLBtnUp(x, y);
}
}
// OFFSET: 0x00740D40
// FUNCTION: fn_07733
void UIMiniPartyInfoWnd::OnMouseHover(int, int) {
CMode* mode = g_modeMgr.GetGameMode();
if (!mode) {
return;
}
if (this->m_owner->GetMember().valid == 0) {
return;
}
char text[256];
std::memset(text, 0, sizeof(text));
std::string fitted;
const std::string mapName = g_session.GetMapDisplayName(this->m_owner->GetMember().map.c_str());
if (this->m_owner->m_sizeMode == 1) {
std::sprintf(text, "%s", this->m_owner->GetMember().name.c_str());
fitted = this->FitDisplayText(static_cast<int>(static_cast<float>(this->geometry.width) * 0.532f), text, 0, 12, 1);
} else {
std::sprintf(text, "Lv.%d %s(%s)", this->m_owner->GetMember().level, this->m_owner->GetMember().name.c_str(), mapName.c_str());
fitted = this->FitDisplayText(static_cast<int>(static_cast<float>(this->geometry.width) * 0.6f), text, 0, 12, 1);
}
if (fitted.find(text) == std::string::npos) {
int x = this->geometry.x + 15;
int y = this->geometry.y - 12;
this->ToScreen(x, y);
mode->ShowTooltip(text, x, y, 0xFFFFFFFF, 0, 1);
}
}
// OFFSET: 0x00741280
// FUNCTION: fn_07734
void UIMiniPartyInfoWnd::OnRBtnUp(int, int) {
if (!g_session.m_lockMouse) {
this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0);
}
}
// OFFSET: 0x007412A0
// FUNCTION: fn_07735
int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
switch (message) {
case UM_REFRESHITEM: {
if (this->m_owner->GetMember().valid && !this->m_owner->GetMember().valid) {
return 0;
}
CGameMode* mode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (this->m_owner->GetMember().offline) {
this->m_gauge->Move(-100, -100);
return 0;
}
int current = 0;
int maximum = 0;
const bool self = this->m_owner->GetMember().accountId == g_session.m_aid;
CWorld* world = mode->scene;
CRenderObject* actor;
if (self) {
actor = world->player;
current = g_session.hp;
maximum = g_session.maxHp;
} else {
actor = world->GetGameActorByAID(this->m_owner->GetMember().accountId);
if (actor) {
UIPcGage* gauge = reinterpret_cast<UIPcGage*&>(static_cast<CPc*>(actor)->gaugeWindow);
if (gauge) {
current = gauge->current;
maximum = gauge->maximum;
} else {
current = 0;
maximum = 0;
}
}
}
if (!actor) {
this->m_gauge->Move(-100, -100);
return 0;
}
this->m_gauge->Move(52, 32);
this->m_gauge->SetValues(current, maximum);
return 0;
}
case UM_MAKEMENU:
this->m_entries.clear();
if (g_windowMgr.menuWnd) {
g_windowMgr.CloseWindow(WID_MENUWND);
}
if (this->m_owner->GetMember().valid) {
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_USA_PERSONALINFO_DEATH)).c_str(), 58));
if (this->m_owner->GetMember().name == g_session.DecodePlayerName()) {
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_LEAVE_PARTY)).c_str(), 9));
} else {
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_OPEN_1ON1_WINDOW)).c_str(), 7));
if (g_session.partyLeader) {
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_EXPEL)).c_str(), 0));
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_YIELD_PARTYMASTER)).c_str(), 43));
}
}
this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(MSI_ACHIEVEMENT_NEXT_GRADE)).c_str(), 61));
}
if (this->m_entries.size()) {
UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND);
menu->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0);
for (unsigned index = 0; index < this->m_entries.size(); ++index) {
menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast<std::intptr_t>(this->m_entries[index].text.c_str()), 0, 0, 0);
}
menu->SendMsg(nullptr, UM_SET_CALLER_WID, 301, this->m_owner->m_cell, 0, 0);
menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0);
int x = g_mouse.x + 1;
int y = g_mouse.y + 1;
if (x < 1) {
x = 1;
}
if (x > g_renderer->viewport.width - menu->geometry.width) {
x = g_renderer->viewport.width - menu->geometry.width;
}
if (y < 1) {
y = 1;
}
if (y > g_renderer->viewport.height - menu->geometry.height) {
y = g_renderer->viewport.height - menu->geometry.height;
}
menu->Move(x, y);
return 0;
}
return 0;
case UM_MENU_SELECTED:
if (!this->m_owner->GetMember().valid) {
return 0;
}
if (this->m_entries.empty()) {
g_windowMgr.Confirm(LookupMessage(MSI_MENUICON_TIPBOX), 0, false, false, 0, "Message", 280, 120, 0);
return 0;
}
switch (this->m_entries[argument1].value) {
case MENUID_SEND_MSG:
this->SendMsg(nullptr, UM_COMMAND, ID_SENDMSG, 0, 0, 0);
return 0;
case MENUID_TALKONLYTWO:
this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0);
return 0;
case MENUID_QUERYINFO:
this->SendMsg(nullptr, UM_COMMAND, ID_FRIEND_INFO, 0, 0, 0);
return 0;
case MENUID_EXPEL:
case 19:
this->SendMsg(nullptr, UM_COMMAND, ID_DELETE_FRIEND, 0, 0, 0);
return 0;
case MENUID_LEAVE:
this->SendMsg(nullptr, UM_COMMAND, ID_LEAVE, 0, 0, 0);
return 0;
case MENUID_MAKE_WHISPER_WINDOW:
this->SendMsg(nullptr, 71, 0, 0, 0, 0);
return 0;
case MENUID_INVITE_IN_PARTY:
if (this->m_owner->m_cell != -1 && this->m_owner->GetMember().valid) {
g_modeMgr.gameMode->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast<int>(this->m_owner->GetMember().name.c_str()), 0, 0, 0);
return 0;
}
break;
case 43:
if (this->m_owner->m_cell != -1) {
if (this->m_owner->GetMember().valid && this->m_owner->GetMember().offline == 0) {
if (g_windowMgr.Confirm(LookupMessage(MSI_DO_YOU_REALLY_WANT_YIELD_PARTYMASTER), 2, false, false, 0, "Message", 280, 120, 0) == 187) {
g_modeMgr.gameMode->SendMsg(MM_GROUP_CHANGE_MASTER, this->m_owner->GetMember().accountId, 0, 0, 0);
return 0;
}
} else {
g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0);
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(LookupMessage(MSI_CANNOT_YIELD_PARTYMASTER)), 255, 3, 0, 0);
return 0;
}
}
break;
case 58:
if (this->m_owner->GetMember().valid) {
g_modeMgr.gameMode->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast<int>(this->m_owner->GetMember().name.c_str()), 0, 0, 0);
return 0;
}
break;
case 61:
if (this->m_owner->GetMember().valid) {
g_windowMgr.CloseMiniPartyWindow(this->m_owner->GetMember().accountId);
return 0;
}
break;
}
return 0;
case UM_COMMAND:
switch (argument1) {
case ID_SENDMSG:
if (!g_session.m_lockMouse) {
this->m_owner->GetMember();
return 0;
}
break;
case ID_TALK:
if (!g_session.m_lockMouse) {
if (this->m_owner->GetMember().valid && !(this->m_owner->GetMember().name == g_session.DecodePlayerName())) {
const char* group;
if (g_windowMgr.IsFriend(this->m_owner->GetMember().name.c_str())) {
group = LookupMessage(MSI_FRIEND);
} else {
group = g_session.IsGuildMemberCharacter(this->m_owner->GetMember().characterId) ? "GuildMember" : nullptr;
}
g_windowMgr.SendNotice(
14, reinterpret_cast<std::intptr_t>(this->m_owner->GetMember().name.c_str()), reinterpret_cast<std::intptr_t>(group),
reinterpret_cast<std::intptr_t>(ShortcutFilename(this->m_owner->GetMember().characterId).c_str()), 0, 0
);
return 0;
}
}
break;
case ID_FRIEND_INFO:
if (!g_session.m_lockMouse && this->m_owner->GetMember().valid) {
g_windowMgr.Confirm(LookupMessage(MSI_NOTSUPPORTEDYET), 0, true, false, 0, "Message", 280, 120, 0);
return 0;
}
break;
case ID_PARTY_SETTING:
if (!g_session.m_lockMouse) {
if (g_windowMgr.partyInvitationToWnd) {
g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND);
}
if (!g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT) && g_session.PartyCount()) {
g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_PARTYCOUNT);
}
g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND);
UIWindow* window = reinterpret_cast<UIWindow*>(g_windowMgr.partySettingWnd);
if (window) {
int x = 0;
int y = 0;
this->ToScreen(x, y);
window->Move(x + 2 + this->geometry.width, y);
return 0;
}
}
break;
case ID_DELETE_FRIEND:
if (!g_session.m_lockMouse && this->m_owner->GetMember().valid) {
if (!(this->m_owner->GetMember().name == g_session.DecodePlayerName())) {
if (g_windowMgr.Confirm(LookupMessage(MSI_DO_YOU_REALLY_WANT_EXPEL), 2, false, false, 0, "Message", 280, 120, 0) == 187) {
g_modeMgr.gameMode->SendMsg(MM_REQ_EXPEL_GROUP_MEMBER, reinterpret_cast<int>(this->m_owner->GetMember().name.c_str()), 0, 0, 0);
return 0;
}
}
}
break;
case ID_LEAVE:
if (!g_session.m_lockMouse) {
if (this->m_owner->GetMember().valid && this->m_owner->GetMember().name == g_session.DecodePlayerName()) {
if (g_windowMgr.Confirm(LookupMessage(MSI_DO_YOU_REALLY_WANT_LEAVE), 2, false, false, 0, "Message", 280, 120, 0) == 187) {
g_modeMgr.gameMode->SendMsg(MM_REQ_LEAVE_GROUP, 0, 0, 0, 0);
return 0;
}
}
}
break;
case 34: {
CWorld* world = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene;
CRenderObject* actor;
if (static_cast<std::uint32_t>(argument2) == g_session.m_aid) {
actor = world->player;
} else {
actor = world->GetGameActorByAID(argument2);
}
if (actor) {
this->m_gauge->Move(52, 32);
this->m_gauge->SetValues(argument3, argument4);
this->Invalidate();
return 0;
}
this->m_gauge->Move(-100, -100);
this->Invalidate();
break;
}
}
return 0;
}
return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
// OFFSET: 0x00742E10
// FUNCTION: fn_07743
void UIMiniPartyWnd::OnLBtnUp(int x, int y) {
const int cell = reinterpret_cast<MiniPartyGrid*>(CMiniPartyWndAreaMgr::Instance())->FindCell(this->geometry.x, this->geometry.y);
if (cell != -1) {
UIMiniPartyWnd* other = static_cast<UIMiniPartyWnd*>(g_windowMgr.FindSnapExcludedWindow(cell));
if (other) {
other->m_cell = this->m_cell;
g_session.SetRecord0734Value(other->GetMember().accountId, this->m_cell);
this->m_cell = cell;
g_session.SetRecord0734Value(this->m_member.accountId, cell);
} else {
CMiniPartyWndAreaMgr* area = CMiniPartyWndAreaMgr::Instance();
if (cell >= 0 && cell < area->rows * area->columns) {
this->m_cell = cell;
g_session.SetRecord0734Value(this->m_member.accountId, cell);
} else {
g_windowMgr.Confirm(LookupMessage(MSI_HOTKEY_SETTING), 0, true, false, 0, "Message", 280, 120, 0);
}
}
}
UIFrameWnd::OnLBtnUp(x, y);
g_windowMgr.ArrangeMiniPartyWindows();
}
// OFFSET: 0x00743130
// FUNCTION: fn_07744
int UIMiniPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
switch (message) {
case UM_REFRESHITEM: {
const MessengerMember* member = reinterpret_cast<const MessengerMember*>(argument1);
if (member && member->valid) {
this->m_member = *member;
if (this->m_infoWnd) {
this->m_infoWnd->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0);
}
}
return 0;
}
case UM_COMMAND:
if (argument1 == 34 && this->m_member.accountId == static_cast<std::uint32_t>(argument2) && this->m_member.offline == 0 && this->m_infoWnd) {
this->m_infoWnd->SendMsg(sender, message, 34, argument2, argument3, argument4);
this->InvalidateChildren();
}
return 0;
case UM_RESIZE: {
if (argument1 != 7) {
return 0;
}
const int previous = this->m_sizeMode;
if (argument2 <= this->m_widths[2]) {
this->m_sizeMode = 2;
} else if (argument2 <= this->m_widths[1]) {
this->m_sizeMode = 1;
} else if (argument2 <= this->m_widths[0]) {
this->m_sizeMode = 0;
} else {
return 0;
}
if (previous == this->m_sizeMode) {
return 0;
}
const int count = g_session.PartyCount();
std::list<SessionRecord0734> records;
for (int index = 0; index < count; ++index) {
const MessengerMember member = g_session.PartyAt(index);
if (!member.valid) {
continue;
}
UIMiniPartyWnd* window = static_cast<UIMiniPartyWnd*>(g_windowMgr.FindItemWindow(member.accountId));
if (!window) {
continue;
}
window->m_sizeMode = this->m_sizeMode;
switch (window->m_sizeMode) {
case 0:
window->Resize(window->m_widths[0], window->geometry.height);
if (window->m_infoWnd) {
window->m_infoWnd->Resize(window->geometry.width, window->geometry.height);
}
window->m_imageName = "유저인터페이스\\renewalparty\\img_partymini_bg.tga";
window->m_background->Move(window->m_widths[window->m_sizeMode] - 35, 25);
break;
case 1:
window->Resize(window->m_widths[1], window->geometry.height);
if (window->m_infoWnd) {
window->m_infoWnd->Resize(window->geometry.width, window->geometry.height);
}
window->m_imageName = "유저인터페이스\\renewalparty\\img_partymini_bg_mini.tga";
window->m_background->Move(window->m_widths[window->m_sizeMode] - 23, 25);
break;
case 2:
window->Resize(window->m_widths[2], window->geometry.height);
if (window->m_infoWnd) {
window->m_infoWnd->Resize(window->geometry.width, window->geometry.height);
}
window->m_imageName = "유저인터페이스\\renewalparty\\img_partymini_bg_maxmini.tga";
window->m_background->Move(window->m_widths[window->m_sizeMode] - 35, 25);
break;
}
window->Invalidate();
window->Invalidate();
}
return 0;
}
case UM_MENU_SELECTED:
this->m_infoWnd->SendMsg(sender, message, argument1, argument2, argument3, argument4);
return 0;
case UM_MAKEMENU:
if (this->m_infoWnd) {
this->m_infoWnd->SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
return 0;
}
return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
// OFFSET: 0x00740300
// FUNCTION: fn_07730
void UIMiniPartyInfoWnd::Paint() {
this->ClearSurface(0xFFFF00FF);
std::string directory = "유저인터페이스\\renewalparty\\";
if (this->m_owner->GetMember().valid == 0) {
return;
}
char path[256];
const int job = this->m_owner->GetMember().job;
int dead = 0;
if (this->m_owner->GetMember().dead == 1) {
dead = 1;
} else if (g_session.m_aid == this->m_owner->GetMember().accountId) {
dead = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->isPlayerDead == 1;
}
const int leader = this->m_owner->GetMember().leader;
std::sprintf(path, dead ? "%sicon_jobs_%d_die.bmp" : "%sicon_jobs_%d.bmp", directory.c_str(), job);
CRes* icon = ResourceMgr::Instance().Load(Resolve(path));
if (this->m_owner->GetMember().offline == 1) {
this->DrawAuxiliary(1, 7, leader == 0 ? 8 : 6, icon ? &static_cast<CBitmapRes*>(icon)->image : nullptr, true, false);
} else {
this->DrawBitmap(7, leader == 0 ? 8 : 6, static_cast<CBitmapRes*>(icon), true);
}
if (this->m_owner->GetMember().leader == 0) {
std::sprintf(path, "%sico_partyCrown.bmp", directory.c_str());
CRes* crown = ResourceMgr::Instance().Load(Resolve(path));
if (this->m_owner->GetMember().offline == 1) {
this->DrawAuxiliary(1, 9, 0, crown ? &static_cast<CBitmapRes*>(crown)->image : nullptr, true, false);
} else {
this->DrawBitmap(9, 0, static_cast<CBitmapRes*>(crown), true);
}
}
if (this->m_owner->m_sizeMode == 0) {
this->m_gauge->Move(35, 23);
} else {
this->m_gauge->Move(-1000, -1000);
}
if (this->m_owner->m_sizeMode == 2) {
return;
}
char text[256];
std::memset(text, 0, sizeof(text));
std::string mapName = g_session.GetMapDisplayName(this->m_owner->GetMember().map.c_str());
std::string fitted = text;
if (this->m_owner->m_sizeMode == 1) {
std::sprintf(text, "%s", this->m_owner->GetMember().name.c_str());
fitted = this->FitDisplayText(static_cast<int>(static_cast<float>(this->geometry.width) * 0.532f), text, 0, 12, 1);
} else {
std::sprintf(text, "Lv.%d %s(%s)", this->m_owner->GetMember().level, this->m_owner->GetMember().name.c_str(), mapName.c_str());
fitted = this->FitDisplayText(static_cast<int>(static_cast<float>(this->geometry.width) * 0.6f), text, 0, 12, 1);
}
this->DrawTextAt(35, 9, fitted.c_str(), 0, 0, 12, this->m_owner->GetMember().offline == 1 ? 0xAAAAAA : 0xFFFFFF, 1, 0
);
}