rodecomp/Source/UI/Buttons/UIButton.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

73 lines
1.8 KiB
C++

#ifndef RAGNAROK_SOURCE_UI_BUTTONS_UIBUTTON_H
#define RAGNAROK_SOURCE_UI_BUTTONS_UIBUTTON_H
#include "UI/Window/UIWindow.h"
#include <string>
class FrameFocus;
class ResourceMgr;
class LuaScript;
class FontCache;
struct TextLocale;
class ButtonServices {
public:
virtual void Tooltip(const char* text, int x, int y, int color, bool option, bool convert) = 0;
virtual const char* MessageText(int id) = 0;
virtual int Confirm(const char* text, int type, int option1, int option2, const char* caption, int width, int height) = 0;
virtual void Submit(UIWindow* window) = 0;
protected:
~ButtonServices() = default;
};
struct UIButtonContext {
FrameFocus& focus;
ResourceMgr& resources;
LuaScript& behavior;
FontCache& fonts;
const TextLocale& locale;
ButtonServices& services;
const int* policy;
const bool& restricted;
const int* activeModeType;
UIWindow* const& hoverParent;
};
class UIButton : public UIWindow {
friend class UIAdvenPartyBoardWnd;
public:
UIButton(UIWindowContext& windowContext, UIButtonContext& buttonContext);
~UIButton() override;
void Paint() override;
void Slot25(int x, int y) override;
void Slot26(int x, int y) override;
void Slot27(int x, int y) override;
void Slot28(int x, int y) override;
void Slot29(int x, int y) override;
void ResetCursor(int x, int y) override;
void Slot31(int x, int y) override;
virtual void Enable(unsigned char value);
void SetTooltip(const char* text);
void SetDisabled(unsigned char value) {
this->m_disabled = value;
}
std::string label;
protected:
/* 0094 */ std::string m_tooltip;
/* 00AC */ unsigned char m_disabled;
/* 00AD */ unsigned char m_drawLabel;
/* 00B0 */ int m_argument;
UIButtonContext* m_buttonContext;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(UIButton) == 188);
#endif
#endif