Batch #16351 by ragnarok-clanker: no function's compiled code changes; checked with 784 compiled unit(s), including every includer of Source/Archive/GPak.h, Source/Client/Browser/BrowserCommandTarget.h, Source/Client/Browser/BrowserDocumentUI.h, Source/Client/Browser/BrowserInPlace.h, Source/Client/Browser/WebBrowser.h, Source/Client/Input/Language.h, Source/Client/Input/LanguageTC.h, Source/Client/Input/Mouse.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StovePCSDK.h, Source/Contents/AchievementMgr.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GndRiser.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/MousePointer.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/CashEmotionMgr.h, Source/Contents/ClanInfo.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/ArrowEffect.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/DummyEffectLauncher.h, Source/Contents/Effects/EZ2STREffectEx.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/EffectTypes.h, Source/Contents/Effects/ElectricEffect.h, Source/Contents/Effects/EmitterEffect.h, Source/Contents/Effects/FortuneKissEffect.h, Source/Contents/Effects/MagicFloorEffect.h, Source/Contents/Effects/MandraAttackEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RichManKim.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StarEffect.h, Source/Contents/Effects/WhirlwindEffect.h, Source/Contents/EnchantMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundSpatial.h, Source/Contents/GuildInfo.h, Source/Contents/Hotkeys/InterfaceHotkey.h, Source/Contents/Items/ItemInfo.h, Source/Contents/Items/RuneSystem.h, Source/Contents/MapSkyMgr.h, Source/Contents/Models/ModelActor.h, Source/Contents/Movies/BinkMovie.h, Source/Contents/NavigationManager.h, Source/Contents/Party/PartyBookingMgr.h, Source/Contents/PetEvolutionMgr.h, Source/Contents/RenewQuestMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/Schedule/Schedule.h, Source/Contents/Schedule/ShutDownSchedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Sound/SoundMgr.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/Store/MCStoreInfoBackupAsyncWork.h, Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/WorldView/WorldViewData.h, Source/Network/Connection/Connection.h, Source/Render/DX7/DeviceOwnerDX7.h, Source/Render/DX7/DirectDrawEnumeration.h, Source/Render/DX9/DeviceOwnerDX9.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/RendererDX7.h, Source/Render/Text/EmbedFont.h, Source/Render/Text/TextContext.h, Source/Render/Textures/Texture.h, Source/Resource/BinkRuntime.h, Source/Resource/GifResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Models/ModelMesh.h, Source/Resource/ResourceMgr.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Security/NProtectGameGuardMgr.h, Source/Security/ReassemblyPacketMgr.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIBmpTextButton2.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Dialogs/UILoadingWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UIRestartWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemRepairWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Lists/TableBox.h, Source/UI/Lists/UIListBox.h, Source/UI/Lists/UIListBoxEx.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITreeView.h, Source/UI/Lists/UIVScrollBar.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/Navigation/UIPrivateAirplaneWnd.h, Source/UI/Party/UIAdvenPartyBoardWnd.h, Source/UI/Party/UIRequestJoinPartyWnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/TextMarkup.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewer.h, Source/UI/Text/UITransBalloonText.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/Window/UIAccountLimitedToolWnd.h, Source/UI/Window/UIBalloonOpenBtn.h, Source/UI/Window/UIBasicInfoWnd.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMerInfoWnd.h, Source/UI/Window/UIMessageBox.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIReplayRECControlWnd.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyListWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/WindowId.h, Source/Utility/Async/NAsyncWork.h, Source/Utility/Async/NRecycleObjectPoolMgr.h, Source/Utility/JsonCppLoader.h, Source/Utility/Lexicon/LexiconSerializer.h, Source/Utility/NFileLog.h, Source/Utility/Threading/NThread.h.
247 lines
12 KiB
C++
247 lines
12 KiB
C++
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIWINDOW_H
|
|
#define RAGNAROK_SOURCE_UI_WINDOW_UIWINDOW_H
|
|
|
|
#include "Render/Primitives/UIRPData.h"
|
|
#include "UI/Layout/WindowGeometry.h"
|
|
|
|
#include <cstddef>
|
|
#include <list>
|
|
#include <string>
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
|
|
class UIWindow;
|
|
class UIWindowMgr;
|
|
class CUIGameSettingsUI;
|
|
struct RenderQueues;
|
|
struct BitmapImage;
|
|
class FontCache;
|
|
struct tagRECT;
|
|
struct tagSIZE;
|
|
struct ActionFrame;
|
|
class CSprRes;
|
|
struct SpriteRleImage;
|
|
struct SpriteFrameCell;
|
|
class CBitmapRes;
|
|
class CActRes;
|
|
class TextureCache;
|
|
class UITextViewer;
|
|
struct ModeDragState;
|
|
struct ITEM_INFO;
|
|
class UIItemTagButton;
|
|
|
|
class UIWindow : public UIRPData {
|
|
friend class UIWindowMgr;
|
|
friend class CUIDropDownBox;
|
|
friend class CUIGameSettingsUI;
|
|
friend class CUIRenewQuestUI;
|
|
friend class UIItemTagOnChat;
|
|
friend class UIScrollWnd;
|
|
|
|
public:
|
|
explicit UIWindow(unsigned char cached);
|
|
~UIWindow() override;
|
|
virtual void Resize(int width, int height);
|
|
virtual bool IsFrameWnd();
|
|
virtual bool NeedsFrameRefresh();
|
|
virtual void Move(int x, int y);
|
|
virtual bool IsEditable();
|
|
virtual UIWindow* GetEditWindow();
|
|
virtual bool GetTransBoxInfo(void* output);
|
|
virtual bool IsTransmitMouseInput();
|
|
virtual bool CanHitTest();
|
|
virtual void DragAndDrop(int argument1, int argument2, std::intptr_t argument3);
|
|
virtual void StoreInfo();
|
|
virtual void StoreMoveOrigin();
|
|
virtual void MoveFromOrigin(int argument1, int argument2);
|
|
virtual void Show(int visible);
|
|
virtual void OnCreate(int width, int height);
|
|
virtual void OnInit();
|
|
virtual void Grow(int width, int height);
|
|
virtual void OnDestroy();
|
|
virtual void OnProcess();
|
|
virtual void Paint();
|
|
virtual void OnRun();
|
|
virtual void OnSize(int width, int height);
|
|
virtual void OnBeginEdit();
|
|
virtual void OnFinishEdit(int argument);
|
|
virtual void OnLBtnDown(int argument1, int argument2);
|
|
virtual void OnLBtnDblClk(int argument1, int argument2);
|
|
virtual void OnMouseMove(int argument1, int argument2);
|
|
virtual void OnMouseHover(int argument1, int argument2);
|
|
virtual void OnMouseCheck(int argument1, int argument2);
|
|
virtual void ResetCursor(int argument1, int argument2);
|
|
virtual void OnLBtnUp(int argument1, int argument2);
|
|
virtual void OnRBtnDown(int argument1, int argument2);
|
|
virtual void OnRBtnUp(int argument1, int argument2);
|
|
virtual void OnRBtnDblClk(int argument1, int argument2);
|
|
virtual void OnWheel(int argument);
|
|
virtual void RefreshSnap();
|
|
virtual int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4);
|
|
virtual void Invalidate();
|
|
virtual void OnInvalidate();
|
|
virtual std::uint32_t Color();
|
|
virtual bool Update(int redraw);
|
|
virtual bool GetCustomTransBoxInfo(void* output);
|
|
virtual void DrawTransBox();
|
|
virtual std::vector<unsigned char> GetReplayData();
|
|
virtual void SetId(int value);
|
|
virtual int GetWindowType();
|
|
virtual void OnMouseEnter();
|
|
virtual void OnMouseLeave();
|
|
virtual RenderPrimitive* DrawPrimitive();
|
|
virtual UIWindow* HitTest(int x, int y);
|
|
virtual void VisitChildren();
|
|
virtual void ApplySkin(bool argument);
|
|
|
|
void AddChild(UIWindow* child);
|
|
void AddChildFront(UIWindow* child);
|
|
void DeleteChildren();
|
|
void ClearChildren(bool destroy);
|
|
void RemoveChild(UIWindow* child, unsigned char destroy);
|
|
|
|
void InvalidateChildren();
|
|
bool Contains(const UIWindow* window) const;
|
|
bool IsDescendantOf(const UIWindow* ancestor) const;
|
|
void BroadcastMsg4();
|
|
void BroadcastMsg3();
|
|
void PropagateMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4);
|
|
__declspec(noinline) void ToScreen(int& x, int& y) const;
|
|
void PlaceBeside(UIWindow* anchor);
|
|
UIWindow* FindUid(std::uint32_t uid);
|
|
// INLINED
|
|
std::uint32_t Uid() const {
|
|
return this->m_uid;
|
|
}
|
|
UIWindow* Root();
|
|
UIWindow* NextFocusable(UIWindow* child);
|
|
UIWindow* PreviousFocusable(UIWindow* child);
|
|
void ResetStates();
|
|
void ClearSurface(std::uint32_t color);
|
|
void SetSize(int width, int height);
|
|
void DrawBitmap(int x, int y, const BitmapImage* image, bool transparent);
|
|
void DrawBitmap(int x, int y, CBitmapRes* bitmap, bool transparent);
|
|
void DrawAlignedText(int x, int y, std::string text, int width, int align, std::uint32_t color, int arg7, int arg8, int arg9, int arg10, unsigned char bold);
|
|
void FillRegion(int x, int y, int width, int height, std::uint32_t color);
|
|
int TextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic);
|
|
void WrapPixelText(const char* text, std::vector<std::string>& lines, int width);
|
|
int ColoredTextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold);
|
|
void DrawTextAt(int x, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold,
|
|
unsigned char italic
|
|
);
|
|
void DrawVerticalText(int x, int y, const char* text, unsigned bytes, int family, int height, std::uint32_t color, unsigned char bold);
|
|
void DrawCenteredText(int x, int y, const char* text, int width, int family, int height, std::uint32_t color, unsigned char bold);
|
|
void DrawRightOutlinedText(
|
|
int right, int y, const char* text, int bytes, std::uint32_t color, std::uint32_t outline, int family,
|
|
int height, unsigned char bold
|
|
);
|
|
void DrawCenteredOutlinedText(
|
|
int x, int y, const char* text, int width, int bytes, std::uint32_t color, std::uint32_t outline, int family, int height, unsigned char bold
|
|
);
|
|
void DrawVerticalOutlinedText(
|
|
int x, int y, const char* text, int bytes, std::uint32_t color, std::uint32_t outline, int family, int height, unsigned char bold
|
|
);
|
|
void DrawRightAlignedText(int right, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold);
|
|
void DrawShadowedText(
|
|
int x, int y, const char* text, int bytes, std::uint32_t color, std::uint32_t shadow, int family, int height, unsigned char bold
|
|
);
|
|
void DrawFormattedText(int x, int y, const std::string& text, int width, int align, int family, int height, std::uint32_t color, unsigned char bold);
|
|
void DrawEmboldenedText(int x, int y, const char* text, std::uint32_t color, std::uint32_t secondColor, int bytes, int family, int height);
|
|
int DrawWrappedFormattedText(
|
|
int x, int y, const std::string& text, int width, int lineSpacing, int align, int family, int height,
|
|
std::uint32_t color, unsigned char bold
|
|
);
|
|
void FlushPrimitives(RenderQueues& queues, bool depthAlpha, float depthStart, float depthEnd);
|
|
void FillSurface(std::uint32_t color, const tagRECT* rectangle);
|
|
void WrapLinkText(int* kind, std::vector<std::string>* lines, const std::string& text);
|
|
void WrapTextWithBreaks(const char* text, std::vector<std::string>* lines, std::vector<bool>* breaks, int width);
|
|
int DrawItemNameSegments(
|
|
int x, int y, int width, const std::vector<char*>& breaks, const char* text, const char* highlight, std::uint32_t highlightColor,
|
|
std::uint32_t color, int unused, int lineHeight
|
|
);
|
|
void DrawBitmapScaled(int x, int y, int width, int height, const BitmapImage* image, int option);
|
|
void DrawBitmapRegion(int x, int y, const BitmapImage* image, bool transparent, bool whole, int left, int top, int right, int bottom);
|
|
void DrawAuxiliaryScaled(int mode, int x, int y, int width, int height, BitmapImage* image, int option, bool rebuild);
|
|
void DrawAuxiliary(int mode, int x, int y, BitmapImage* image, bool transparent, bool rebuild);
|
|
void DrawAmount(int amount, std::string text, int x, int y);
|
|
int TextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic);
|
|
int VerticalTextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold);
|
|
tagSIZE TextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic);
|
|
tagSIZE VerticalTextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic
|
|
);
|
|
int FormattedTextWidth(std::string text, int family, int height, unsigned char bold);
|
|
std::string FitDisplayText(int width, const char* text, int family, int height, unsigned char bold);
|
|
std::string FitVerticalDisplayText(int height, const char* text, int family, int fontHeight, unsigned char bold);
|
|
std::list<int> WrapFormattedText(std::string text, std::list<std::string>* lines, int maxWidth, int family, int height, unsigned char bold);
|
|
UIItemTagButton* CreateItemTagButton(const std::string& title, const std::string& label, int tagId, UIWindow* parent, std::uint32_t color);
|
|
std::list<int> WrapText(std::string text, std::list<std::string>* lines, int maxWidth, int family, int height, unsigned char bold);
|
|
const char* TruncateText(const char* text, int maxBytes);
|
|
const char* ClipTextToWidth(const char* text, int maxWidth, int family, int height, unsigned char bold);
|
|
void RecordResponse(int response, std::intptr_t b, std::intptr_t c, std::intptr_t d);
|
|
int RecordEditTexts();
|
|
void RecordDrop(int x, int y, const ModeDragState& drag, int target);
|
|
int RecordData(std::uint16_t type, std::vector<unsigned char> data);
|
|
void RecordValues(int value, int argument1, int argument2, int argument3, int argument4);
|
|
void RecordWindowFlag(bool value);
|
|
void RecordText(int event, const char* text);
|
|
int RestoreEditTexts(const unsigned char* data);
|
|
void DrawActionSprite(
|
|
const CSprRes* sprite, const CActRes* action, int x, int y, int width, int height, int interval, bool scaled, const CBitmapRes* background
|
|
);
|
|
bool FitSprite(const ActionFrame* frame, const CSprRes* sprite, int width, int height, int* x, int* y, float* scale);
|
|
void AddSpriteCellOverlay(
|
|
int x, int y, int, int, const SpriteRleImage* image, const SpriteFrameCell* cell, float scale, float angle, std::uint32_t color,
|
|
const std::uint32_t* palette, float extentScale
|
|
);
|
|
void AddRotatedSpriteCellOverlay(int x, int y, int width, int height, const SpriteRleImage* image, const SpriteFrameCell* cell, const std::uint32_t* palette);
|
|
int DrawTitleBar(bool closeButton, const char* title, int width);
|
|
int DrawTitleBarAt(int x, int width, bool closeButton, const char* title);
|
|
void DrawPanelBackground(int y, int width, const char* bitmapName);
|
|
void DrawPanelBackgroundAt(int x, int y, int width, const char* bitmapName);
|
|
void DrawRobeSprite(int job, int sex, int robe, int x, int y, bool overlay, int animation, int frame);
|
|
int DrawButtonBar(int style, int width, int rows);
|
|
int DrawButtonBarAt(int style, int x, int width, int rows);
|
|
CBitmapRes* LoadStyledBitmap(int style, const char* format, const char* name);
|
|
|
|
// INLINED
|
|
bool HasTextBackground() const {
|
|
return this->hasTextBackground != 0;
|
|
}
|
|
// INLINED
|
|
std::uint32_t TextBackground() const {
|
|
return this->textBackgroundColor;
|
|
}
|
|
|
|
bool IsCached() const {
|
|
return this->m_cached != 0;
|
|
}
|
|
|
|
/* 0010 */ UIWindow* parent;
|
|
/* 0014 */ WindowGeometry geometry;
|
|
|
|
protected:
|
|
/* 0044 */ unsigned char hasTextBackground;
|
|
/* 0048 */ std::uint32_t textBackgroundColor;
|
|
/* 004C */ std::uint32_t renderLayer;
|
|
/* 0050 */ std::list<UIWindow*> m_children;
|
|
/* 0058 */ int m_dirty;
|
|
/* 005C */ std::vector<RenderPrimitive*> m_overlayPrimitives;
|
|
/* 0068 */ std::vector<RenderPrimitive*> padding_0068;
|
|
/* 0074 */ std::uint32_t m_uid;
|
|
/* 0078 */ unsigned char m_cached;
|
|
/* 0079 */ unsigned char m_clip;
|
|
|
|
private:
|
|
UIWindow* Parent() const;
|
|
UIWindow(const UIWindow&) = delete;
|
|
UIWindow& operator=(const UIWindow&) = delete;
|
|
};
|
|
|
|
extern std::uint32_t g_windowUid;
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(UIWindow) == 0x7C);
|
|
static_assert(offsetof(UIWindow, parent) == 0x10);
|
|
#endif
|
|
|
|
#endif
|