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.
135 lines
3.6 KiB
C++
135 lines
3.6 KiB
C++
#include "Contents/Items/ItemInfo.h"
|
|
#include "Contents/Items/ItemLink.h"
|
|
#include "Contents/Items/ItemNaming.h"
|
|
#include "Contents/Tables/TipBoxTitles.h"
|
|
#include "UI/Lists/UIChatHisBox.h"
|
|
#include "UI/Text/TextFitting.h"
|
|
|
|
#include <mbstring.h>
|
|
|
|
// OFFSET: 0x008816E0
|
|
// FUNCTION: fn_11299
|
|
bool UIChatHisBox::Name(const std::string& encoded, std::string& output) {
|
|
if (encoded.substr(0, 6) == "00000T") {
|
|
const int id = ItemLinkMessageId(encoded);
|
|
|
|
if (g_itemTagOwner->maxTipId >= id) {
|
|
std::string abbreviated;
|
|
output = g_itemTagOwner->Title(id, &abbreviated, 17);
|
|
|
|
if (!abbreviated.empty()) {
|
|
output = abbreviated;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
std::vector<std::int32_t> fields;
|
|
DecodeItemLinkFields(encoded, fields);
|
|
ITEM_INFO item;
|
|
|
|
if (ItemFromLinkFields(fields, item)) {
|
|
output = item.DisplayName(0);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
// OFFSET: 0x0087FD70
|
|
// FUNCTION: fn_11275
|
|
bool UIChatHisBox::Next(std::string& remaining, std::string& encoded, unsigned& position, const char* original) {
|
|
auto close = remaining.find(g_itemLinkTagEnd);
|
|
|
|
if (close == std::string::npos) {
|
|
return false;
|
|
}
|
|
|
|
do {
|
|
remaining = remaining.substr(0, close);
|
|
auto begin = remaining.find(g_itemLinkTagBegin);
|
|
|
|
if (close != std::string::npos && begin == std::string::npos) {
|
|
position += static_cast<unsigned>(g_itemLinkTagEnd.size());
|
|
remaining = original;
|
|
remaining = remaining.substr(position);
|
|
return true;
|
|
}
|
|
|
|
close = remaining.find(g_itemLinkTagEnd);
|
|
|
|
if (begin != std::string::npos) {
|
|
do {
|
|
position += static_cast<unsigned>(begin);
|
|
remaining = remaining.substr(begin + g_itemLinkTagBegin.size());
|
|
begin = remaining.find(g_itemLinkTagBegin);
|
|
close = remaining.find(g_itemLinkTagEnd);
|
|
|
|
if (begin != std::string::npos) {
|
|
position += static_cast<unsigned>(g_itemLinkTagBegin.size());
|
|
}
|
|
} while (begin != std::string::npos);
|
|
|
|
encoded = remaining;
|
|
remaining = original;
|
|
std::string name = "";
|
|
|
|
if (this->Name(encoded, name)) {
|
|
remaining = remaining.substr(position + encoded.size() + g_itemLinkTagBegin.size() + g_itemLinkTagEnd.size());
|
|
} else {
|
|
position += static_cast<unsigned>(encoded.size() + g_itemLinkTagBegin.size() + g_itemLinkTagEnd.size());
|
|
remaining = remaining.substr(position);
|
|
return true;
|
|
}
|
|
}
|
|
} while (close != std::string::npos);
|
|
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x00879390
|
|
// FUNCTION: fn_11216
|
|
std::string UIChatHisBox::Convert(const std::string& text) {
|
|
if (!_mbsstr(reinterpret_cast<const unsigned char*>(text.c_str()), reinterpret_cast<const unsigned char*>(g_itemLinkTagBegin.c_str()))) {
|
|
return text;
|
|
}
|
|
|
|
std::string remaining = text;
|
|
std::string result = "";
|
|
unsigned position = 0;
|
|
unsigned previous = 0;
|
|
|
|
for (;;) {
|
|
std::string encoded = "";
|
|
|
|
if (!this->Next(remaining, encoded, position, text.c_str())) {
|
|
break;
|
|
}
|
|
|
|
result += text.substr(previous, position - previous);
|
|
std::string name = "";
|
|
|
|
if (this->Name(encoded, name)) {
|
|
name = this->BracketName(name);
|
|
result += name;
|
|
position += static_cast<unsigned>(encoded.size() + g_itemLinkTagBegin.size() + g_itemLinkTagEnd.size());
|
|
}
|
|
|
|
previous = position;
|
|
}
|
|
|
|
result += remaining;
|
|
return result;
|
|
}
|
|
|
|
// OFFSET: 0x00884460
|
|
// FUNCTION: fn_11307
|
|
const std::string UIChatHisBox::BracketName(const std::string& name) {
|
|
std::string result;
|
|
result += '<';
|
|
result += FitText(*this->geometry.surface, name, this->geometry.width / 2);
|
|
result += '>';
|
|
return result;
|
|
}
|