mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-19 06:01:07 +03:00
Compare commits
10 Commits
950f2765e3
...
ca39b1abac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca39b1abac | ||
|
|
4bf88801ed | ||
|
|
c133d37705 | ||
|
|
8c850c0bd5 | ||
|
|
7dcc33bcb4 | ||
|
|
5b88141acb | ||
|
|
61303b51a2 | ||
|
|
c7179026fc | ||
|
|
e5aab736b7 | ||
|
|
1d364ec689 |
@ -18,6 +18,7 @@ WowClientDB<FactionTemplateRec> g_factionTemplateDB;
|
|||||||
WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||||
WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
||||||
WowClientDB<MapRec> g_mapDB;
|
WowClientDB<MapRec> g_mapDB;
|
||||||
|
WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
|
||||||
WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
||||||
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)) {
|
|||||||
loadFn(&g_itemDisplayInfoDB, __FILE__, __LINE__);
|
loadFn(&g_itemDisplayInfoDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_itemVisualsDB, __FILE__, __LINE__);
|
loadFn(&g_itemVisualsDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_mapDB, __FILE__, __LINE__);
|
loadFn(&g_mapDB, __FILE__, __LINE__);
|
||||||
|
loadFn(&g_paperDollItemFrameDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_soundEntriesDB, __FILE__, __LINE__);
|
loadFn(&g_soundEntriesDB, __FILE__, __LINE__);
|
||||||
loadFn(&g_soundEntriesAdvancedDB, __FILE__, __LINE__);
|
loadFn(&g_soundEntriesAdvancedDB, __FILE__, __LINE__);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include "db/rec/ItemDisplayInfoRec.hpp"
|
#include "db/rec/ItemDisplayInfoRec.hpp"
|
||||||
#include "db/rec/ItemVisualsRec.hpp"
|
#include "db/rec/ItemVisualsRec.hpp"
|
||||||
#include "db/rec/MapRec.hpp"
|
#include "db/rec/MapRec.hpp"
|
||||||
|
#include "db/rec/PaperDollItemFrameRec.hpp"
|
||||||
#include "db/rec/SoundEntriesRec.hpp"
|
#include "db/rec/SoundEntriesRec.hpp"
|
||||||
#include "db/rec/SoundEntriesAdvancedRec.hpp"
|
#include "db/rec/SoundEntriesAdvancedRec.hpp"
|
||||||
|
|
||||||
@ -39,6 +40,7 @@ extern WowClientDB<FactionTemplateRec> g_factionTemplateDB;
|
|||||||
extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
|
||||||
extern WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
extern WowClientDB<ItemVisualsRec> g_itemVisualsDB;
|
||||||
extern WowClientDB<MapRec> g_mapDB;
|
extern WowClientDB<MapRec> g_mapDB;
|
||||||
|
extern WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
|
||||||
extern WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
extern WowClientDB<SoundEntriesRec> g_soundEntriesDB;
|
||||||
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
|
||||||
|
|
||||||
|
|||||||
51
src/db/rec/PaperDollItemFrameRec.cpp
Normal file
51
src/db/rec/PaperDollItemFrameRec.cpp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// DO NOT EDIT: generated by whoa-autocode
|
||||||
|
#include "db/rec/PaperDollItemFrameRec.hpp"
|
||||||
|
#include "util/Locale.hpp"
|
||||||
|
#include "util/SFile.hpp"
|
||||||
|
|
||||||
|
const char* PaperDollItemFrameRec::GetFilename() {
|
||||||
|
return "DBFilesClient\\PaperDollItemFrame.dbc";
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t PaperDollItemFrameRec::GetNumColumns() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t PaperDollItemFrameRec::GetRowSize() {
|
||||||
|
return 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PaperDollItemFrameRec::NeedIDAssigned() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t PaperDollItemFrameRec::GetID() {
|
||||||
|
return this->m_generatedID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PaperDollItemFrameRec::SetID(int32_t id) {
|
||||||
|
this->m_generatedID = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PaperDollItemFrameRec::Read(SFile* f, const char* stringBuffer) {
|
||||||
|
uint32_t itemButtonNameOfs;
|
||||||
|
uint32_t slotIconOfs;
|
||||||
|
|
||||||
|
if (
|
||||||
|
!SFile::Read(f, &itemButtonNameOfs, sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &slotIconOfs, sizeof(uint32_t), nullptr, nullptr, nullptr)
|
||||||
|
|| !SFile::Read(f, &this->m_slotNumber, sizeof(this->m_slotNumber), nullptr, nullptr, nullptr)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stringBuffer) {
|
||||||
|
this->m_itemButtonName = &stringBuffer[itemButtonNameOfs];
|
||||||
|
this->m_slotIcon = &stringBuffer[slotIconOfs];
|
||||||
|
} else {
|
||||||
|
this->m_itemButtonName = "";
|
||||||
|
this->m_slotIcon = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
25
src/db/rec/PaperDollItemFrameRec.hpp
Normal file
25
src/db/rec/PaperDollItemFrameRec.hpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// DO NOT EDIT: generated by whoa-autocode
|
||||||
|
#ifndef DB_REC_PAPER_DOLL_ITEM_FRAME_REC_HPP
|
||||||
|
#define DB_REC_PAPER_DOLL_ITEM_FRAME_REC_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class SFile;
|
||||||
|
|
||||||
|
class PaperDollItemFrameRec {
|
||||||
|
public:
|
||||||
|
const char* m_itemButtonName;
|
||||||
|
const char* m_slotIcon;
|
||||||
|
int32_t m_slotNumber;
|
||||||
|
int32_t m_generatedID;
|
||||||
|
|
||||||
|
static const char* GetFilename();
|
||||||
|
static uint32_t GetNumColumns();
|
||||||
|
static uint32_t GetRowSize();
|
||||||
|
static bool NeedIDAssigned();
|
||||||
|
int32_t GetID();
|
||||||
|
void SetID(int32_t id);
|
||||||
|
bool Read(SFile* f, const char* stringBuffer);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -17,7 +17,13 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
int32_t Script_IsShiftKeyDown(lua_State* L) {
|
int32_t Script_IsShiftKeyDown(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (EventIsKeyDown(KEY_LSHIFT) || EventIsKeyDown(KEY_RSHIFT)) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetBuildInfo(lua_State* L) {
|
int32_t Script_GetBuildInfo(lua_State* L) {
|
||||||
|
|||||||
@ -78,6 +78,11 @@ enum OUT_OF_RANGE_TYPE {
|
|||||||
OUT_OF_RANGE_2 = 2,
|
OUT_OF_RANGE_2 = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PLAYER_TYPE {
|
||||||
|
PLAYER_NORMAL = 0,
|
||||||
|
PLAYER_BOT = 1,
|
||||||
|
};
|
||||||
|
|
||||||
enum SHEATHE_TYPE {
|
enum SHEATHE_TYPE {
|
||||||
SHEATHE_0 = 0,
|
SHEATHE_0 = 0,
|
||||||
SHEATHE_1 = 1,
|
SHEATHE_1 = 1,
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#include "object/client/CGPlayer_C.hpp"
|
#include "object/client/CGPlayer_C.hpp"
|
||||||
#include "db/Db.hpp"
|
#include "db/Db.hpp"
|
||||||
#include "object/client/ObjMgr.hpp"
|
|
||||||
#include "object/Types.hpp"
|
#include "object/Types.hpp"
|
||||||
|
#include "object/client/ObjMgr.hpp"
|
||||||
|
#include "ui/FrameScript.hpp"
|
||||||
|
#include "ui/Game.hpp"
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
|
||||||
CGPlayer_C::CGPlayer_C(uint32_t time, CClientObjCreate& objCreate) : CGUnit_C(time, objCreate) {
|
CGPlayer_C::CGPlayer_C(uint32_t time, CClientObjCreate& objCreate) : CGUnit_C(time, objCreate) {
|
||||||
@ -34,6 +36,34 @@ void CGPlayer_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4)
|
|||||||
this->CGUnit_C::PostInit(time, init, a4);
|
this->CGUnit_C::PostInit(time, init, a4);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
if (this->GetGUID() == ClntObjMgrGetActivePlayer()) {
|
||||||
|
this->PostInitActivePlayer();
|
||||||
|
} else {
|
||||||
|
this->UpdatePartyMemberState();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPlayer_C::PostInitActivePlayer() {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
if (ClntObjMgrGetPlayerType() == PLAYER_NORMAL) {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
FrameScript_SignalEvent(SCRIPT_ACTIONBAR_SLOT_CHANGED, "%d", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
if (ClntObjMgrGetPlayerType() == PLAYER_NORMAL) {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
CGGameUI::EnterWorld();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGPlayer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGPlayer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
@ -43,6 +73,10 @@ void CGPlayer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
|||||||
this->m_playerSaved = &saved[CGPlayer::GetBaseOffsetSaved()];
|
this->m_playerSaved = &saved[CGPlayer::GetBaseOffsetSaved()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGPlayer_C::UpdatePartyMemberState() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex) {
|
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex) {
|
||||||
STORM_ASSERT(sex < UNITSEX_LAST);
|
STORM_ASSERT(sex < UNITSEX_LAST);
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,9 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
|||||||
uint32_t GetActiveNextLevelXP() const;
|
uint32_t GetActiveNextLevelXP() const;
|
||||||
uint32_t GetActiveXP() const;
|
uint32_t GetActiveXP() const;
|
||||||
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
|
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
|
||||||
|
void PostInitActivePlayer();
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
void UpdatePartyMemberState();
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex);
|
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex);
|
||||||
|
|||||||
@ -18,8 +18,12 @@ class ClntObjMgr {
|
|||||||
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects;
|
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects;
|
||||||
// TODO
|
// TODO
|
||||||
WOWGUID m_activePlayer = 0;
|
WOWGUID m_activePlayer = 0;
|
||||||
|
PLAYER_TYPE m_type;
|
||||||
uint32_t m_mapID = 0;
|
uint32_t m_mapID = 0;
|
||||||
ClientConnection* m_net = nullptr;
|
ClientConnection* m_net = nullptr;
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
ClntObjMgr(PLAYER_TYPE type) : m_type(type) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -229,3 +229,20 @@ int32_t FillInPartialObjectData(CGObject_C* object, WOWGUID guid, CDataStore* ms
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t SkipPartialObjectUpdate(CDataStore* msg) {
|
||||||
|
uint8_t changeMaskCount;
|
||||||
|
uint32_t changeMasks[MAX_CHANGE_MASKS];
|
||||||
|
if (!ExtractDirtyMasks(msg, &changeMaskCount, changeMasks)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int32_t block = 0; block < changeMaskCount * 32; block++) {
|
||||||
|
if (IsMaskBitSet(changeMasks, block)) {
|
||||||
|
uint32_t blockValue;
|
||||||
|
msg->Get(blockValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -11,4 +11,6 @@ int32_t CallMirrorHandlers(CDataStore* msg, bool a2, WOWGUID guid);
|
|||||||
|
|
||||||
int32_t FillInPartialObjectData(CGObject_C* object, WOWGUID guid, CDataStore* msg, bool forFullUpdate, bool zeroZeroBits);
|
int32_t FillInPartialObjectData(CGObject_C* object, WOWGUID guid, CDataStore* msg, bool forFullUpdate, bool zeroZeroBits);
|
||||||
|
|
||||||
|
int32_t SkipPartialObjectUpdate(CDataStore* msg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -141,6 +141,10 @@ uint32_t ClntObjMgrGetMapID() {
|
|||||||
return s_curMgr->m_mapID;
|
return s_curMgr->m_mapID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PLAYER_TYPE ClntObjMgrGetPlayerType() {
|
||||||
|
return s_curMgr->m_type;
|
||||||
|
}
|
||||||
|
|
||||||
void ClntObjMgrInitializeShared() {
|
void ClntObjMgrInitializeShared() {
|
||||||
if (!s_heapsAllocated) {
|
if (!s_heapsAllocated) {
|
||||||
for (int32_t i = ID_ITEM; i < NUM_CLIENT_OBJECT_TYPES; i++) {
|
for (int32_t i = ID_ITEM; i < NUM_CLIENT_OBJECT_TYPES; i++) {
|
||||||
@ -158,7 +162,7 @@ void ClntObjMgrInitializeShared() {
|
|||||||
void ClntObjMgrInitializeStd(uint32_t mapID) {
|
void ClntObjMgrInitializeStd(uint32_t mapID) {
|
||||||
// TODO last instance time
|
// TODO last instance time
|
||||||
|
|
||||||
auto mgr = STORM_NEW(ClntObjMgr);
|
auto mgr = STORM_NEW(ClntObjMgr)(PLAYER_NORMAL);
|
||||||
|
|
||||||
g_clientConnection->SetObjMgr(mgr);
|
g_clientConnection->SetObjMgr(mgr);
|
||||||
mgr->m_net = g_clientConnection;
|
mgr->m_net = g_clientConnection;
|
||||||
|
|||||||
@ -16,6 +16,8 @@ ClntObjMgr* ClntObjMgrGetCurrent();
|
|||||||
|
|
||||||
uint32_t ClntObjMgrGetMapID();
|
uint32_t ClntObjMgrGetMapID();
|
||||||
|
|
||||||
|
PLAYER_TYPE ClntObjMgrGetPlayerType();
|
||||||
|
|
||||||
void ClntObjMgrInitializeShared();
|
void ClntObjMgrInitializeShared();
|
||||||
|
|
||||||
void ClntObjMgrInitializeStd(uint32_t mapID);
|
void ClntObjMgrInitializeStd(uint32_t mapID);
|
||||||
|
|||||||
@ -164,8 +164,3 @@ void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t SkipPartialObjectUpdate(CDataStore* msg) {
|
|
||||||
// TODO
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -20,6 +20,4 @@ void HandleObjectOutOfRangePass2(CGObject_C* object);
|
|||||||
|
|
||||||
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate);
|
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate);
|
||||||
|
|
||||||
int32_t SkipPartialObjectUpdate(CDataStore* msg);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -4,5 +4,6 @@
|
|||||||
#include "ui/game/CGGameUI.hpp"
|
#include "ui/game/CGGameUI.hpp"
|
||||||
#include "ui/game/CGPetInfo.hpp"
|
#include "ui/game/CGPetInfo.hpp"
|
||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
|
#include "ui/game/Types.hpp"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#include "ui/game/CGGameUI.hpp"
|
#include "ui/game/CGGameUI.hpp"
|
||||||
#include "client/Client.hpp"
|
#include "client/Client.hpp"
|
||||||
|
#include "object/Client.hpp"
|
||||||
#include "ui/CScriptObject.hpp"
|
#include "ui/CScriptObject.hpp"
|
||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/Key.hpp"
|
#include "ui/Key.hpp"
|
||||||
@ -17,6 +18,7 @@
|
|||||||
#include "ui/game/GMTicketInfoScript.hpp"
|
#include "ui/game/GMTicketInfoScript.hpp"
|
||||||
#include "ui/game/GameScript.hpp"
|
#include "ui/game/GameScript.hpp"
|
||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
|
#include "ui/game/Types.hpp"
|
||||||
#include "ui/game/UIBindingsScript.hpp"
|
#include "ui/game/UIBindingsScript.hpp"
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
#include "ui/simple/CSimpleTop.hpp"
|
||||||
#include "util/CStatus.hpp"
|
#include "util/CStatus.hpp"
|
||||||
@ -24,7 +26,9 @@
|
|||||||
|
|
||||||
WOWGUID CGGameUI::s_currentObjectTrack;
|
WOWGUID CGGameUI::s_currentObjectTrack;
|
||||||
CScriptObject* CGGameUI::s_gameTooltip;
|
CScriptObject* CGGameUI::s_gameTooltip;
|
||||||
|
bool CGGameUI::s_inWorld;
|
||||||
WOWGUID CGGameUI::s_lockedTarget;
|
WOWGUID CGGameUI::s_lockedTarget;
|
||||||
|
bool CGGameUI::s_loggingIn;
|
||||||
CSimpleTop* CGGameUI::s_simpleTop;
|
CSimpleTop* CGGameUI::s_simpleTop;
|
||||||
|
|
||||||
void LoadScriptFunctions() {
|
void LoadScriptFunctions() {
|
||||||
@ -64,6 +68,28 @@ void LoadScriptFunctions() {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGGameUI::EnterWorld() {
|
||||||
|
if (CGGameUI::s_inWorld) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGGameUI::s_inWorld = true;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
if (CGGameUI::s_loggingIn) {
|
||||||
|
CGGameUI::s_loggingIn = false;
|
||||||
|
|
||||||
|
FrameScript_SignalEvent(SCRIPT_PLAYER_LOGIN, nullptr);
|
||||||
|
|
||||||
|
// TODO CGLCD::Login();
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameScript_SignalEvent(SCRIPT_PLAYER_ENTERING_WORLD, nullptr);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
WOWGUID& CGGameUI::GetCurrentObjectTrack() {
|
WOWGUID& CGGameUI::GetCurrentObjectTrack() {
|
||||||
return CGGameUI::s_currentObjectTrack;
|
return CGGameUI::s_currentObjectTrack;
|
||||||
}
|
}
|
||||||
@ -75,6 +101,10 @@ WOWGUID& CGGameUI::GetLockedTarget() {
|
|||||||
void CGGameUI::Initialize() {
|
void CGGameUI::Initialize() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
CGGameUI::s_loggingIn = true;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
CGGameUI::s_simpleTop = STORM_NEW(CSimpleTop);
|
CGGameUI::s_simpleTop = STORM_NEW(CSimpleTop);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@ -150,6 +180,12 @@ void CGGameUI::Initialize() {
|
|||||||
STORM_ASSERT(CGGameUI::s_gameTooltip);
|
STORM_ASSERT(CGGameUI::s_gameTooltip);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
if (ClntObjMgrGetActivePlayer()) {
|
||||||
|
CGGameUI::EnterWorld();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGGameUI::InitializeGame() {
|
void CGGameUI::InitializeGame() {
|
||||||
@ -160,6 +196,10 @@ void CGGameUI::InitializeGame() {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CGGameUI::IsLoggingIn() {
|
||||||
|
return CGGameUI::s_loggingIn;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t CGGameUI::IsRaidMember(const WOWGUID& guid) {
|
int32_t CGGameUI::IsRaidMember(const WOWGUID& guid) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
|||||||
@ -13,17 +13,21 @@ class CGGameUI {
|
|||||||
static CSimpleTop* s_simpleTop;
|
static CSimpleTop* s_simpleTop;
|
||||||
|
|
||||||
// Static functions
|
// Static functions
|
||||||
|
static void EnterWorld();
|
||||||
static WOWGUID& GetCurrentObjectTrack();
|
static WOWGUID& GetCurrentObjectTrack();
|
||||||
static WOWGUID& GetLockedTarget();
|
static WOWGUID& GetLockedTarget();
|
||||||
static void Initialize();
|
static void Initialize();
|
||||||
static void InitializeGame();
|
static void InitializeGame();
|
||||||
|
static bool IsLoggingIn();
|
||||||
static int32_t IsRaidMember(const WOWGUID& guid);
|
static int32_t IsRaidMember(const WOWGUID& guid);
|
||||||
static int32_t IsRaidMemberOrPet(const WOWGUID& guid);
|
static int32_t IsRaidMemberOrPet(const WOWGUID& guid);
|
||||||
static void RegisterFrameFactories();
|
static void RegisterFrameFactories();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static WOWGUID s_currentObjectTrack;
|
static WOWGUID s_currentObjectTrack;
|
||||||
|
static bool s_inWorld;
|
||||||
static WOWGUID s_lockedTarget;
|
static WOWGUID s_lockedTarget;
|
||||||
|
static bool s_loggingIn;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,11 +1,48 @@
|
|||||||
#include "ui/game/CharacterInfoScript.hpp"
|
#include "ui/game/CharacterInfoScript.hpp"
|
||||||
|
#include "db/Db.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
|
#include "util/Lua.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
int32_t Script_GetInventorySlotInfo(lua_State* L) {
|
int32_t Script_GetInventorySlotInfo(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (!lua_isstring(L, 1)) {
|
||||||
|
luaL_error(L, "Invalid inventory slot in GetInventorySlotInfo");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto slotName = lua_tostring(L, 1);
|
||||||
|
|
||||||
|
PaperDollItemFrameRec* slotRec = nullptr;
|
||||||
|
for (int32_t i = 0; i < g_paperDollItemFrameDB.GetNumRecords(); i++) {
|
||||||
|
auto paperDollItemFrameRec = g_paperDollItemFrameDB.GetRecordByIndex(i);
|
||||||
|
|
||||||
|
if (paperDollItemFrameRec && !SStrCmpI(slotName, paperDollItemFrameRec->m_itemButtonName)) {
|
||||||
|
slotRec = paperDollItemFrameRec;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!slotRec) {
|
||||||
|
luaL_error(L, "Invalid inventory slot in GetInventorySlotInfo");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// id
|
||||||
|
lua_pushnumber(L, slotRec->m_slotNumber);
|
||||||
|
|
||||||
|
// textureName
|
||||||
|
lua_pushstring(L, slotRec->m_slotIcon);
|
||||||
|
|
||||||
|
// checkRelic
|
||||||
|
if (slotRec->m_slotNumber == EQUIPPED_LAST) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetInventoryItemsForSlot(lua_State* L) {
|
int32_t Script_GetInventoryItemsForSlot(lua_State* L) {
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include "ui/ScriptFunctionsSystem.hpp"
|
#include "ui/ScriptFunctionsSystem.hpp"
|
||||||
#include "ui/game/CGGameUI.hpp"
|
#include "ui/game/CGGameUI.hpp"
|
||||||
#include "ui/game/ScriptUtil.hpp"
|
#include "ui/game/ScriptUtil.hpp"
|
||||||
|
#include "ui/game/Types.hpp"
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include "util/StringTo.hpp"
|
#include "util/StringTo.hpp"
|
||||||
@ -1056,7 +1057,7 @@ void ScriptEventsInitialize() {
|
|||||||
g_scriptEvents[173] = "ACTIONBAR_SHOWGRID";
|
g_scriptEvents[173] = "ACTIONBAR_SHOWGRID";
|
||||||
g_scriptEvents[174] = "ACTIONBAR_HIDEGRID";
|
g_scriptEvents[174] = "ACTIONBAR_HIDEGRID";
|
||||||
g_scriptEvents[175] = "ACTIONBAR_PAGE_CHANGED";
|
g_scriptEvents[175] = "ACTIONBAR_PAGE_CHANGED";
|
||||||
g_scriptEvents[176] = "ACTIONBAR_SLOT_CHANGED";
|
g_scriptEvents[SCRIPT_ACTIONBAR_SLOT_CHANGED] = "ACTIONBAR_SLOT_CHANGED";
|
||||||
g_scriptEvents[177] = "ACTIONBAR_UPDATE_STATE";
|
g_scriptEvents[177] = "ACTIONBAR_UPDATE_STATE";
|
||||||
g_scriptEvents[178] = "ACTIONBAR_UPDATE_USABLE";
|
g_scriptEvents[178] = "ACTIONBAR_UPDATE_USABLE";
|
||||||
g_scriptEvents[179] = "ACTIONBAR_UPDATE_COOLDOWN";
|
g_scriptEvents[179] = "ACTIONBAR_UPDATE_COOLDOWN";
|
||||||
@ -1133,9 +1134,9 @@ void ScriptEventsInitialize() {
|
|||||||
g_scriptEvents[250] = "LOOT_SLOT_CLEARED";
|
g_scriptEvents[250] = "LOOT_SLOT_CLEARED";
|
||||||
g_scriptEvents[251] = "LOOT_SLOT_CHANGED";
|
g_scriptEvents[251] = "LOOT_SLOT_CHANGED";
|
||||||
g_scriptEvents[252] = "LOOT_CLOSED";
|
g_scriptEvents[252] = "LOOT_CLOSED";
|
||||||
g_scriptEvents[253] = "PLAYER_LOGIN";
|
g_scriptEvents[SCRIPT_PLAYER_LOGIN] = "PLAYER_LOGIN";
|
||||||
g_scriptEvents[254] = "PLAYER_LOGOUT";
|
g_scriptEvents[SCRIPT_PLAYER_LOGOUT] = "PLAYER_LOGOUT";
|
||||||
g_scriptEvents[255] = "PLAYER_ENTERING_WORLD";
|
g_scriptEvents[SCRIPT_PLAYER_ENTERING_WORLD] = "PLAYER_ENTERING_WORLD";
|
||||||
g_scriptEvents[256] = "PLAYER_LEAVING_WORLD";
|
g_scriptEvents[256] = "PLAYER_LEAVING_WORLD";
|
||||||
g_scriptEvents[257] = "PLAYER_ALIVE";
|
g_scriptEvents[257] = "PLAYER_ALIVE";
|
||||||
g_scriptEvents[258] = "PLAYER_DEAD";
|
g_scriptEvents[258] = "PLAYER_DEAD";
|
||||||
|
|||||||
14
src/ui/game/Types.hpp
Normal file
14
src/ui/game/Types.hpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef UI_GAME_TYPES_HPP
|
||||||
|
#define UI_GAME_TYPES_HPP
|
||||||
|
|
||||||
|
enum SCRIPTEVENT {
|
||||||
|
// TODO
|
||||||
|
SCRIPT_ACTIONBAR_SLOT_CHANGED = 176,
|
||||||
|
// TODO
|
||||||
|
SCRIPT_PLAYER_LOGIN = 253,
|
||||||
|
SCRIPT_PLAYER_LOGOUT = 254,
|
||||||
|
SCRIPT_PLAYER_ENTERING_WORLD = 255,
|
||||||
|
// TODO
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user