mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-25 13:26:05 +03:00
feat(gameui): add skeleton of CGTooltip class
This commit is contained in:
parent
e8130aabe8
commit
b291f47306
@ -5,6 +5,7 @@
|
||||
|
||||
#include "client/Client.hpp"
|
||||
#include "gameui/CGWorldFrame.hpp"
|
||||
#include "gameui/CGTooltip.hpp"
|
||||
#include "gameui/GameScriptFunctions.hpp"
|
||||
#include "gx/Coordinate.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
@ -179,7 +180,7 @@ void CGGameUI::Initialize() {
|
||||
|
||||
void CGGameUI::RegisterFrameFactories() {
|
||||
FrameXML_RegisterFactory("WorldFrame", CGWorldFrame::Create, 1);
|
||||
//FrameXML_RegisterFactory("GameTooltip", (int)CGTooltip::Create, 0);
|
||||
FrameXML_RegisterFactory("GameTooltip", CGTooltip::Create, 0);
|
||||
//FrameXML_RegisterFactory("Cooldown", (int)sub_51A380, 0);
|
||||
//FrameXML_RegisterFactory("Minimap", (int)CGMinimapFrame::Create, 0);
|
||||
//FrameXML_RegisterFactory("PlayerModel", (int)CGCharacterModelBase::Create, 0);
|
||||
|
||||
11
src/gameui/CGTooltip.cpp
Normal file
11
src/gameui/CGTooltip.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "gameui/CGTooltip.hpp"
|
||||
|
||||
CGTooltip::CGTooltip(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||
}
|
||||
|
||||
CSimpleFrame* CGTooltip::Create(CSimpleFrame* parent) {
|
||||
// TODO: Data = CDataAllocator__GetData(0, ".?AVCGTooltip@@", -2);
|
||||
|
||||
auto m = SMemAlloc(sizeof(CGTooltip), __FILE__, __LINE__, 0);
|
||||
return m ? (new (m) CGTooltip(parent)) : nullptr;
|
||||
}
|
||||
14
src/gameui/CGTooltip.hpp
Normal file
14
src/gameui/CGTooltip.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef GAME_UI_CGTOOLTIP_HPP
|
||||
#define GAME_UI_CGTOOLTIP_HPP
|
||||
|
||||
#include "ui/CSimpleFrame.hpp"
|
||||
#include "ui/CSimpleTop.hpp"
|
||||
|
||||
class CGTooltip : public CSimpleFrame {
|
||||
public:
|
||||
CGTooltip(CSimpleFrame* parent);
|
||||
|
||||
static CSimpleFrame* Create(CSimpleFrame* parent);
|
||||
};
|
||||
|
||||
#endif // GAME_UI_CGTOOLTIP_HPP
|
||||
@ -1604,67 +1604,67 @@ void LoadScriptFunctions() {
|
||||
GameScript::s_ScriptFunctions_Game[i].method);
|
||||
}
|
||||
|
||||
void UIBindingsRegisterScriptFunctions();
|
||||
void UIMacrosRegisterScriptFunctions();
|
||||
void InputControlRegisterScriptFunctions();
|
||||
void CameraRegisterScriptFunctions();
|
||||
void SoundRegisterScriptFunctions();
|
||||
void SpellRegisterScriptFunctions();
|
||||
void ScriptEventsRegisterFunctions();
|
||||
void MinimapRegisterScriptFunctions();
|
||||
void UnitCombatLogRegisterScriptFunctions();
|
||||
void ActionBarRegisterScriptFunctions();
|
||||
void PartyInfoRegisterScriptFunctions();
|
||||
void ChatRegisterScriptFunctions();
|
||||
void AutoCompleteRegisterScriptFunctions();
|
||||
void SpellBookRegisterScriptFunctions();
|
||||
void CharacterInfoRegisterScriptFunctions();
|
||||
void LootInfoRegisterScriptFunctions();
|
||||
void ItemTextRegisterScriptFunctions();
|
||||
void GossipInfoRegisterScriptFunctions();
|
||||
void QuestInfoRegisterScriptFunctions();
|
||||
void QuestLogRegisterScriptFunctions();
|
||||
void CGTaxiMapRegisterScriptFunctions();
|
||||
void ClassTrainerRegisterScriptFunctions();
|
||||
void TradeSkillRegisterScriptFunctions();
|
||||
void MerchantRegisterScriptFunctions();
|
||||
void TradeInfoRegisterScriptFunctions();
|
||||
void ContainerRegisterScriptFunctions();
|
||||
void BankRegisterScriptFunctions();
|
||||
void FriendListRegisterScriptFunctions();
|
||||
void PetInfoRegisterScriptFunctions();
|
||||
void WorldMapRegisterScriptFunctions();
|
||||
void ReputationInfoRegisterScriptFunctions();
|
||||
void TabardCreationRegisterScriptFunctions();
|
||||
void GuildRegistrarRegisterScriptFunctions();
|
||||
void DuelInfoRegisterScriptFunctions();
|
||||
void TutorialRegisterScriptFunctions();
|
||||
void PetitionInfoRegisterScriptFunctions();
|
||||
void SkillInfoRegisterScriptFunctions();
|
||||
void GuildInfoRegisterScriptFunctions();
|
||||
void MailInfoRegisterScriptFunctions();
|
||||
void BattlefieldInfoRegisterScriptFunctions();
|
||||
void TalentInfoRegisterScriptFunctions();
|
||||
void AuctionHouseRegisterScriptFunctions();
|
||||
void StableInfoRegisterScriptFunctions();
|
||||
void RaidInfoRegisterScriptFunctions();
|
||||
void WorldStateInfoRegisterScriptFunctions();
|
||||
void MinigameInfoRegisterScriptFunctions();
|
||||
void KnowledgeBaseRegisterScriptFunctions();
|
||||
void ItemSocketInfoRegisterScriptFunctions();
|
||||
void PetitionVendorRegisterScriptFunctions();
|
||||
void ArenaTeamInfoRegisterScriptFunctions();
|
||||
void LookingForGroupRegisterScriptFunctions();
|
||||
void VoiceRegisterScriptFunctions();
|
||||
void CalendarRegisterScriptFunctions();
|
||||
void CGCommentatorRegisterScriptFunctions();
|
||||
void CGBarberShopRegisterScriptFunctions();
|
||||
void CGDanceStudioRegisterScriptFunctions();
|
||||
void GuildBankRegisterScriptFunctions();
|
||||
void GlyphInfoRegisterScriptFunctions();
|
||||
void AchievementInfoRegisterScriptFunctions();
|
||||
void CurrencyTypesRegisterScriptFunctions();
|
||||
void EquipmentManagerRegisterScriptFunctions();
|
||||
void GMTicketInfoRegisterScriptFunctions();
|
||||
void BattlenetUIRegisterScriptFunctions();
|
||||
UIBindingsRegisterScriptFunctions();
|
||||
UIMacrosRegisterScriptFunctions();
|
||||
InputControlRegisterScriptFunctions();
|
||||
CameraRegisterScriptFunctions();
|
||||
SoundRegisterScriptFunctions();
|
||||
SpellRegisterScriptFunctions();
|
||||
ScriptEventsRegisterFunctions();
|
||||
MinimapRegisterScriptFunctions();
|
||||
UnitCombatLogRegisterScriptFunctions();
|
||||
ActionBarRegisterScriptFunctions();
|
||||
PartyInfoRegisterScriptFunctions();
|
||||
ChatRegisterScriptFunctions();
|
||||
AutoCompleteRegisterScriptFunctions();
|
||||
SpellBookRegisterScriptFunctions();
|
||||
CharacterInfoRegisterScriptFunctions();
|
||||
LootInfoRegisterScriptFunctions();
|
||||
ItemTextRegisterScriptFunctions();
|
||||
GossipInfoRegisterScriptFunctions();
|
||||
QuestInfoRegisterScriptFunctions();
|
||||
QuestLogRegisterScriptFunctions();
|
||||
CGTaxiMapRegisterScriptFunctions();
|
||||
ClassTrainerRegisterScriptFunctions();
|
||||
TradeSkillRegisterScriptFunctions();
|
||||
MerchantRegisterScriptFunctions();
|
||||
TradeInfoRegisterScriptFunctions();
|
||||
ContainerRegisterScriptFunctions();
|
||||
BankRegisterScriptFunctions();
|
||||
FriendListRegisterScriptFunctions();
|
||||
PetInfoRegisterScriptFunctions();
|
||||
WorldMapRegisterScriptFunctions();
|
||||
ReputationInfoRegisterScriptFunctions();
|
||||
TabardCreationRegisterScriptFunctions();
|
||||
GuildRegistrarRegisterScriptFunctions();
|
||||
DuelInfoRegisterScriptFunctions();
|
||||
TutorialRegisterScriptFunctions();
|
||||
PetitionInfoRegisterScriptFunctions();
|
||||
SkillInfoRegisterScriptFunctions();
|
||||
GuildInfoRegisterScriptFunctions();
|
||||
MailInfoRegisterScriptFunctions();
|
||||
BattlefieldInfoRegisterScriptFunctions();
|
||||
TalentInfoRegisterScriptFunctions();
|
||||
AuctionHouseRegisterScriptFunctions();
|
||||
StableInfoRegisterScriptFunctions();
|
||||
RaidInfoRegisterScriptFunctions();
|
||||
WorldStateInfoRegisterScriptFunctions();
|
||||
MinigameInfoRegisterScriptFunctions();
|
||||
KnowledgeBaseRegisterScriptFunctions();
|
||||
ItemSocketInfoRegisterScriptFunctions();
|
||||
PetitionVendorRegisterScriptFunctions();
|
||||
ArenaTeamInfoRegisterScriptFunctions();
|
||||
LookingForGroupRegisterScriptFunctions();
|
||||
VoiceRegisterScriptFunctions();
|
||||
CalendarRegisterScriptFunctions();
|
||||
CGCommentatorRegisterScriptFunctions();
|
||||
CGBarberShopRegisterScriptFunctions();
|
||||
CGDanceStudioRegisterScriptFunctions();
|
||||
GuildBankRegisterScriptFunctions();
|
||||
GlyphInfoRegisterScriptFunctions();
|
||||
AchievementInfoRegisterScriptFunctions();
|
||||
CurrencyTypesRegisterScriptFunctions();
|
||||
EquipmentManagerRegisterScriptFunctions();
|
||||
GMTicketInfoRegisterScriptFunctions();
|
||||
BattlenetUIRegisterScriptFunctions();
|
||||
}
|
||||
|
||||
@ -13,7 +13,8 @@ struct lua_State;
|
||||
#define NUM_SCRIPT_FUNCTIONS_CAMERA 22
|
||||
#define NUM_SCRIPT_FUNCTIONS_SOUND 23
|
||||
#define NUM_SCRIPT_FUNCTIONS_SPELL 11
|
||||
#define NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS 169
|
||||
#define NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS 7
|
||||
#define NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS_UNIT 169
|
||||
#define NUM_SCRIPT_FUNCTIONS_MINIMAP 4
|
||||
#define NUM_SCRIPT_FUNCTIONS_UNIT_COMBAT_LOG 11
|
||||
#define NUM_SCRIPT_FUNCTIONS_ACTION_BAR 28
|
||||
@ -80,6 +81,7 @@ namespace GameScript {
|
||||
extern FrameScript_Method s_ScriptFunctions_Sound[NUM_SCRIPT_FUNCTIONS_SOUND];
|
||||
extern FrameScript_Method s_ScriptFunctions_Spell[NUM_SCRIPT_FUNCTIONS_SPELL];
|
||||
extern FrameScript_Method s_ScriptFunctions_ScriptEvents[NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS];
|
||||
extern FrameScript_Method s_ScriptFunctions_ScriptEventsUnit[NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS_UNIT];
|
||||
extern FrameScript_Method s_ScriptFunctions_Minimap[NUM_SCRIPT_FUNCTIONS_MINIMAP];
|
||||
extern FrameScript_Method s_ScriptFunctions_UnitCombatLog[NUM_SCRIPT_FUNCTIONS_UNIT_COMBAT_LOG];
|
||||
extern FrameScript_Method s_ScriptFunctions_ActionBar[NUM_SCRIPT_FUNCTIONS_ACTION_BAR];
|
||||
|
||||
@ -2,6 +2,39 @@
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include <common/Time.hpp>
|
||||
|
||||
static int32_t Script_GetTime(lua_State* L) {
|
||||
lua_pushnumber(L, static_cast<double>(OsGetAsyncTimeMs()) * 0.001);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_GetGameTime(lua_State* L) {
|
||||
// TODO
|
||||
lua_pushnumber(L, 1.0);
|
||||
lua_pushnumber(L, 1.0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int32_t Script_ConsoleExec(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_ReadFile(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_DeleteFile(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_AppendToFile(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_UnitExists(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
@ -16,7 +49,10 @@ static int32_t Script_UnitIsUnit(lua_State* L) {
|
||||
}
|
||||
|
||||
static int32_t Script_UnitIsPlayer(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
__debugbreak();
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_UnitIsInMyGuild(lua_State* L) {
|
||||
@ -208,7 +244,9 @@ static int32_t Script_UnitSex(lua_State* L) {
|
||||
}
|
||||
|
||||
static int32_t Script_UnitLevel(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 1.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_GetMoney(lua_State* L) {
|
||||
@ -686,9 +724,25 @@ void ScriptEventsRegisterFunctions() {
|
||||
GameScript::s_ScriptFunctions_ScriptEvents[i].name,
|
||||
GameScript::s_ScriptFunctions_ScriptEvents[i].method);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS_UNIT; ++i) {
|
||||
FrameScript_RegisterFunction(
|
||||
GameScript::s_ScriptFunctions_ScriptEventsUnit[i].name,
|
||||
GameScript::s_ScriptFunctions_ScriptEventsUnit[i].method);
|
||||
}
|
||||
}
|
||||
|
||||
FrameScript_Method GameScript::s_ScriptFunctions_ScriptEvents[NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS] = {
|
||||
{ "GetTime", &Script_GetTime },
|
||||
{ "GetGameTime", &Script_GetGameTime },
|
||||
{ "ConsoleExec", &Script_ConsoleExec },
|
||||
{ "ReadFile", &Script_ReadFile },
|
||||
{ "DeleteFile", &Script_DeleteFile },
|
||||
{ "AppendToFile", &Script_AppendToFile },
|
||||
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel },
|
||||
};
|
||||
|
||||
FrameScript_Method GameScript::s_ScriptFunctions_ScriptEventsUnit[NUM_SCRIPT_FUNCTIONS_SCRIPT_EVENTS_UNIT] = {
|
||||
{ "UnitExists", &Script_UnitExists },
|
||||
{ "UnitIsVisible", &Script_UnitIsVisible },
|
||||
{ "UnitIsUnit", &Script_UnitIsUnit },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user