Batch #1665 by ragnarok-clanker: 0 byte-identical, 70 confirmed by peer review. - fn_10904 UIEditCtrl::UpdateLinks: logic confirmed by peer review - fn_10905 EditViewport::Synchronize: logic confirmed by peer review - fn_10950 UIBalloonText::SetText: logic confirmed by peer review - fn_11216 ItemLinkDisplay::Convert: logic confirmed by peer review - fn_11326 UIListBox::Slot15: logic confirmed by peer review (already on main) - fn_11327 UIListBoxEx::Slot15: logic confirmed by peer review (already on main) - fn_11366 UIListBox::Paint: logic confirmed by peer review - fn_11367 UIListBoxEx::Paint: logic confirmed by peer review - fn_11392 UITextButton::Paint: logic confirmed by peer review - fn_11394 UITextViewer::Paint: logic confirmed by peer review - fn_11445 UITextButton::Slot31: logic confirmed by peer review (already on main) - fn_11471 UITextButton::Slot27: logic confirmed by peer review (already on main) - fn_11494 UITextButton::Slot33: logic confirmed by peer review (already on main) - fn_11562 UITextViewer::SendMsg: logic confirmed by peer review (already on main) - fn_11721 UICntWnd::DrawBorder: logic confirmed by peer review (already on main) - fn_11760 UIBank_NewWnd::Paint: logic confirmed by peer review (already on main) - fn_11761 UIChatRoomWnd::Paint: logic confirmed by peer review (already on main) - fn_11767 UIMerInfoWnd::Paint: logic confirmed by peer review (already on main) - fn_12680 ShortcutPainting::Paint: logic confirmed by peer review - fn_13829 WrapPlainText: logic confirmed by peer review - fn_13833 WrapRichText: logic confirmed by peer review - fn_16941 UIWindow::DrawAmount: logic confirmed by peer review - fn_16971 UIWindow::TextHeight: logic confirmed by peer review - fn_16972 UIWindow::VerticalTextHeight: logic confirmed by peer review - fn_16973 UIWindow::TextSize: logic confirmed by peer review - fn_16974 UIWindow::VerticalTextSize: logic confirmed by peer review - fn_16975 UIWindow::TextWidth: logic confirmed by peer review - fn_16993 WrapPixelText: logic confirmed by peer review - fn_17007 FitText: logic confirmed by peer review - fn_17009 UIWindow::DrawTextAt: logic confirmed by peer review - fn_17013 DrawOutlinedColoredText: logic confirmed by peer review - fn_17014 DrawStyledColoredText: logic confirmed by peer review - fn_17015 DrawColoredText: logic confirmed by peer review - fn_17016 DrawOutlinedText: logic confirmed by peer review - fn_17136 BrowserFactory::Create: logic confirmed by peer review - fn_18376 LookupMessage: logic confirmed by peer review - fn_01934 TextContext::TextContext: logic confirmed by peer review - fn_01957 TextContext::Marker: logic confirmed by peer review - fn_01961 TextContext::Measure: logic confirmed by peer review - fn_01966 TextContext::SetFont: logic confirmed by peer review - fn_01970 TextContext::DrawPair: logic confirmed by peer review - fn_01971 TextContext::Draw: logic confirmed by peer review - fn_01983 TextContext::MeasurePart: logic confirmed by peer review - fn_01984 TextContext::DrawPart: logic confirmed by peer review - fn_21788 ReceivePartyJoinResult: logic confirmed by peer review - fn_24191 EmotionHotkeys::LoadDefaults: logic confirmed by peer review - fn_03664 CAdventurerAgencyMgr::CompletePartyInfo: logic confirmed by peer review - fn_03666 CAdventurerAgencyMgr::CompleteRegistration: logic confirmed by peer review - fn_03668 CAdventurerAgencyMgr::CompleteStopRecruiting: logic confirmed by peer review - fn_03976 CEmblemDataMgr::CompleteUpload: logic confirmed by peer review - fn_04239 CMCStoreInfoBackup::CompleteSave: logic confirmed by peer review - fn_04262 CPlayerNameDictionary::Lookup: logic confirmed by peer review - fn_06581 ItemNaming::DisplayName: logic confirmed by peer review (already on main) - fn_06583 ItemNamingContext::Element: logic confirmed by peer review (already on main) - fn_06584 ItemNamingContext::Star: logic confirmed by peer review (already on main) - fn_06585 ItemNaming::Creator: logic confirmed by peer review (already on main) - fn_06586 ItemNamingContext::Apprentice: logic confirmed by peer review (already on main) - fn_06587 ItemNaming::Suffixes: logic confirmed by peer review (already on main) - fn_06588 ItemNaming::Prefixes: logic confirmed by peer review (already on main) - fn_09299 UIApplyForPartyWnd::Slot15: logic confirmed by peer review - fn_09300 UIRegisterPartyWnd::Slot15: logic confirmed by peer review - fn_09301 UIRequestJoinPartyWnd::Slot15: logic confirmed by peer review - fn_09303 UIApplyForPartyWnd::Paint: logic confirmed by peer review - fn_09304 UIPartyInfoWnd::Paint: logic confirmed by peer review - fn_10748 UIEditCtrl::RemoveInvalidLink: logic confirmed by peer review - fn_10758 UIEditCtrl::DrawSelectionAt: logic confirmed by peer review (already on main) - fn_10759 UIEditCtrl::DrawSelection: logic confirmed by peer review (already on main) - fn_10794 UIBasicButton::Paint: logic confirmed by peer review - fn_10799 UIBmpTextButton::Paint: logic confirmed by peer review - fn_10823 UITransBalloonText::Paint: logic confirmed by peer review Reviewed-by: ragnarok-clanker
131 lines
4.2 KiB
C++
131 lines
4.2 KiB
C++
#include "Render/DeviceContext/DeviceContext.h"
|
|
#include "Resource/Bitmap/BitmapResource.h"
|
|
#include "Resource/ResourceMgr.h"
|
|
#include "UI/Text/TextFitting.h"
|
|
#include "UI/Party/UIPartyInfoWnd.h"
|
|
|
|
#include <cstdio>
|
|
|
|
// OFFSET: 0x007BAE20
|
|
// FUNCTION: fn_09277
|
|
UIPartyInfoWnd::UIPartyInfoWnd(UIWindowContext& windows, UIButtonContext& buttons, PartyRowContext& row)
|
|
: UIBitmapButton(windows, buttons), tanker(0), dealer(0), healer(0), assist(0), m_row(&row) {
|
|
this->m_drawLabel = 0;
|
|
}
|
|
|
|
// OFFSET: 0x007BB740
|
|
UIPartyInfoWnd::~UIPartyInfoWnd() = default;
|
|
|
|
// OFFSET: 0x007BBF00
|
|
// FUNCTION: fn_09294
|
|
const char* UIPartyInfoWnd::TypeName(int value, ButtonServices& services) {
|
|
if (value == 0) {
|
|
return services.MessageText(3377);
|
|
}
|
|
|
|
return value >= 1 && value <= 6 ? services.MessageText(3359 + value) : "";
|
|
}
|
|
|
|
// OFFSET: 0x007C1E20
|
|
// FUNCTION: fn_09320
|
|
void UIPartyInfoWnd::SetInfo(const CAdvenPartyInfo& value) {
|
|
this->m_disabled = 0;
|
|
this->m_drawLabel = 1;
|
|
this->memo = value.memo;
|
|
char text[10] = {};
|
|
_snprintf_s(text, sizeof(text), _TRUNCATE, "%d~%d", value.minimumLevel, value.maximumLevel);
|
|
this->levels = text;
|
|
this->tanker = value.tanker;
|
|
this->healer = value.healer;
|
|
this->dealer = value.dealer;
|
|
this->assist = value.assist;
|
|
this->type = value.type;
|
|
this->name = value.characterName;
|
|
this->info = value;
|
|
}
|
|
|
|
// INLINED
|
|
void UIPartyInfoWnd::Reset() {
|
|
this->m_drawLabel = 0;
|
|
this->memo.clear();
|
|
this->levels.clear();
|
|
this->tanker = 1;
|
|
this->dealer = 1;
|
|
this->assist = 1;
|
|
this->type = 0;
|
|
this->name.clear();
|
|
this->m_disabled = 1;
|
|
this->Invalidate();
|
|
}
|
|
|
|
// OFFSET: 0x007BF8C0
|
|
// FUNCTION: fn_09304
|
|
void UIPartyInfoWnd::Paint() {
|
|
this->geometry.surface->Fill(nullptr, 0xFFFF00FFu);
|
|
|
|
if (this->m_drawLabel == 0) {
|
|
return;
|
|
}
|
|
|
|
auto& controls = *this->m_buttonContext;
|
|
CBitmapRes* background = nullptr;
|
|
|
|
if (this->geometry.unknown_0030 <= 2) {
|
|
background = static_cast<CBitmapRes*>(controls.resources.Load(this->m_names[this->geometry.unknown_0030].c_str()));
|
|
}
|
|
|
|
if (this->m_disabled != 0 && !this->m_names[3].empty()) {
|
|
background = static_cast<CBitmapRes*>(controls.resources.Load(this->m_names[3].c_str()));
|
|
}
|
|
|
|
if (background) {
|
|
this->DrawBitmap(0, 0, &background->image, false);
|
|
}
|
|
|
|
const auto text = [&](int x, const char* value, int bytes = 0) { this->DrawTextAt(controls.fonts, controls.locale, x, 5, value, bytes, 0, 12, 0, 0, 0); };
|
|
text(11, this->levels.c_str());
|
|
text(64, TypeName(this->type, controls.services));
|
|
constexpr char prefix[] = "유저인터페이스\\UIadventurerAgency\\";
|
|
const char* jobs[] = {"def", "heal", "atk", "buf"};
|
|
const bool flags[] = {this->info.tanker, this->info.healer, this->info.dealer, this->info.assist};
|
|
|
|
for (int index = 0; index < 4; ++index) {
|
|
const std::string path = std::string(prefix) + "btn_job_" + jobs[index] + (flags[index] ? "_on.bmp" : "_off.bmp");
|
|
auto* resource = static_cast<CBitmapRes*>(controls.resources.Load(path.c_str()));
|
|
this->DrawBitmap(109 + index * 18, 3, resource ? &resource->image : nullptr, false);
|
|
}
|
|
|
|
const std::string fitted = FitText(*this->geometry.surface, this->name, 119);
|
|
text(192, fitted.c_str(), static_cast<int>(fitted.size()));
|
|
text(315, this->memo.c_str(), static_cast<int>(this->memo.size()));
|
|
|
|
if (this->m_invalidateParent != 0 && this->parent) {
|
|
this->parent->Invalidate();
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x007BFCA0
|
|
// FUNCTION: fn_09308
|
|
void UIPartyInfoWnd::Slot31(int x, int y) {
|
|
if (this->m_disabled == 0) {
|
|
this->UIButton::Slot31(x, y);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x007BFE90
|
|
// FUNCTION: fn_09310
|
|
void UIPartyInfoWnd::Slot33(int, int) {
|
|
if (this->m_disabled != 0 || this->info.accountId == this->m_row->accountId || this->info.characterId == this->m_row->characterId) {
|
|
return;
|
|
}
|
|
|
|
const std::string name = this->info.characterName;
|
|
const char* relationship = this->m_row->services.IsFriend(name) ? this->m_buttonContext->services.MessageText(102) : nullptr;
|
|
|
|
if (this->m_row->services.IsGuildMember(this->info.accountId)) {
|
|
relationship = "GuildMember";
|
|
}
|
|
|
|
const std::string code = this->m_row->services.CharacterCode(this->info.characterId);
|
|
this->m_row->services.ShowCharacter(name.c_str(), relationship, code.c_str());
|
|
}
|