mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-19 14:11:06 +03:00
Compare commits
No commits in common. "c099226cd271db97e995237f6a08c2f5c157de0e" and "87ae3b512b19bd65cfb9f9835ad9be0019a15bdf" have entirely different histories.
c099226cd2
...
87ae3b512b
@ -16,5 +16,4 @@ target_include_directories(object
|
||||
target_link_libraries(object
|
||||
PRIVATE
|
||||
db
|
||||
ui
|
||||
)
|
||||
|
||||
@ -31,14 +31,6 @@ void CGObject_C::AddWorldObject() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int32_t CGObject_C::CanBeTargetted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
int32_t CGObject_C::CanHighlight() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void CGObject_C::Disable() {
|
||||
// TODO
|
||||
|
||||
|
||||
@ -33,8 +33,6 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
||||
void PostReenable();
|
||||
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
|
||||
// TODO
|
||||
virtual int32_t CanHighlight();
|
||||
virtual int32_t CanBeTargetted();
|
||||
|
||||
// Public member functions
|
||||
CGObject_C() = default;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#include "object/client/CGUnit_C.hpp"
|
||||
#include "object/client/ObjMgr.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "ui/Game.hpp"
|
||||
|
||||
WOWGUID CGUnit_C::s_activeMover;
|
||||
|
||||
@ -101,20 +99,6 @@ CGUnit_C::~CGUnit_C() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
int32_t CGUnit_C::CanHighlight() {
|
||||
if (this->m_unit->flags & 0x2000000) {
|
||||
if (this->m_unit->createdBy != ClntObjMgrGetActivePlayer() || this->GetGUID() != CGPetInfo::GetPet(0)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t CGUnit_C::CanBeTargetted() {
|
||||
return this->CanHighlight();
|
||||
}
|
||||
|
||||
void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
|
||||
// TODO
|
||||
|
||||
|
||||
@ -21,10 +21,6 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
||||
|
||||
// Virtual public member functions
|
||||
virtual ~CGUnit_C();
|
||||
// TODO
|
||||
virtual int32_t CanHighlight();
|
||||
virtual int32_t CanBeTargetted();
|
||||
// TODO
|
||||
|
||||
// Public member functions
|
||||
CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
|
||||
|
||||
@ -2,6 +2,5 @@
|
||||
#define UI_GAME_HPP
|
||||
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "ui/game/CGPetInfo.hpp"
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
#include "ui/game/CGPetInfo.hpp"
|
||||
|
||||
WOWGUID CGPetInfo::GetPet(uint32_t index) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
#ifndef UI_GAME_C_G_PET_INFO_HPP
|
||||
#define UI_GAME_C_G_PET_INFO_HPP
|
||||
|
||||
#include "util/GUID.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
class CGPetInfo {
|
||||
public:
|
||||
// Static functions
|
||||
static WOWGUID GetPet(uint32_t index);
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,31 +1,17 @@
|
||||
#include "ui/game/ScriptEvents.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "object/Client.hpp"
|
||||
#include "object/client/ObjMgr.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/ScriptFunctionsSystem.hpp"
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "ui/game/ScriptUtil.hpp"
|
||||
#include "util/GUID.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/StringTo.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
int32_t Script_UnitExists(lua_State* L) {
|
||||
auto token = lua_tostring(L, 1);
|
||||
WOWGUID guid = 0;
|
||||
Script_GetGUIDFromToken(token, guid, false);
|
||||
|
||||
auto object = ClntObjMgrObjectPtr(guid, TYPE_OBJECT, __FILE__, __LINE__);
|
||||
|
||||
if ((object && object->CanBeTargetted()) || CGGameUI::IsRaidMemberOrPet(guid)) {
|
||||
lua_pushnumber(L, 1.0);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
return 1;
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_UnitIsVisible(lua_State* L) {
|
||||
@ -709,29 +695,7 @@ int32_t Script_IsXPUserDisabled(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_FillLocalizedClassList(lua_State* L) {
|
||||
if (lua_type(L, 1) != LUA_TTABLE) {
|
||||
luaL_error(L, "Usage: FillLocalizedClassList(classTable[, isFemale])");
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto isFemale = StringToBOOL(L, 2, 0);
|
||||
auto sex = isFemale ? UNITSEX_FEMALE : UNITSEX_MALE;
|
||||
|
||||
lua_settop(L, 1);
|
||||
|
||||
for (int32_t i = 0; i < g_chrClassesDB.GetNumRecords(); ++i) {
|
||||
auto classRec = g_chrClassesDB.GetRecordByIndex(i);
|
||||
if (classRec) {
|
||||
auto displayName = CGUnit_C::GetDisplayClassNameFromRecord(classRec, sex, 0);
|
||||
|
||||
lua_pushstring(L, classRec->m_filename);
|
||||
lua_pushstring(L, displayName);
|
||||
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -372,18 +372,7 @@ int32_t CSimpleButton_GetTextWidth(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleButton_GetTextHeight(lua_State* L) {
|
||||
auto type = CSimpleButton::GetObjectType();
|
||||
auto button = static_cast<CSimpleButton*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
auto text = button->m_text;
|
||||
|
||||
float height = text ? text->GetHeight() : 0.0f;
|
||||
float ddcHeight = CoordinateGetAspectCompensation() * 1024.0f * height;
|
||||
float ndcHeight = DDCToNDCWidth(ddcHeight);
|
||||
|
||||
lua_pushnumber(L, ndcHeight);
|
||||
|
||||
return 1;
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t CSimpleButton_RegisterForClicks(lua_State* L) {
|
||||
|
||||
@ -162,17 +162,7 @@ int32_t CSimpleFontString_SetFont(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleFontString_GetText(lua_State* L) {
|
||||
auto type = CSimpleFontString::GetObjectType();
|
||||
auto string = static_cast<CSimpleFontString*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
auto text = string->GetText();
|
||||
if (!text || !*text) {
|
||||
text = nullptr;
|
||||
}
|
||||
|
||||
lua_pushstring(L, text);
|
||||
|
||||
return 1;
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t CSimpleFontString_GetFieldSize(lua_State* L) {
|
||||
|
||||
@ -522,18 +522,6 @@ void CSimpleFrame::PreLoadXML(XMLNode* node, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimpleFrame::GetAttribute(const char* name, int32_t& luaRef) {
|
||||
auto attr = this->m_attributes.Ptr(name);
|
||||
|
||||
if (!attr || attr->luaRef == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
luaRef = attr->luaRef;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t CSimpleFrame::GetBoundsRect(CRect& bounds) {
|
||||
if (this->IsResizePending()) {
|
||||
this->Resize(1);
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
#include "ui/CScriptRegion.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include "ui/simple/CSimpleRegion.hpp"
|
||||
#include <storm/Hash.hpp>
|
||||
#include <storm/List.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
@ -18,10 +17,6 @@ class CSimpleTitleRegion;
|
||||
class CSimpleTop;
|
||||
struct lua_State;
|
||||
|
||||
struct FRAMEATTR : TSHashObject<FRAMEATTR, HASHKEY_STRI> {
|
||||
int32_t luaRef;
|
||||
};
|
||||
|
||||
class CSimpleFrame : public CScriptRegion {
|
||||
public:
|
||||
// Static members
|
||||
@ -76,7 +71,6 @@ class CSimpleFrame : public CScriptRegion {
|
||||
ScriptIx m_onAttributeChange;
|
||||
ScriptIx m_onEnable;
|
||||
ScriptIx m_onDisable;
|
||||
TSHashTable<FRAMEATTR, HASHKEY_STRI> m_attributes;
|
||||
int32_t m_drawenabled[NUM_SIMPLEFRAME_DRAWLAYERS];
|
||||
CBackdropGenerator* m_backdrop = nullptr;
|
||||
STORM_EXPLICIT_LIST(CSimpleRegion, m_regionLink) m_regions;
|
||||
@ -132,7 +126,6 @@ class CSimpleFrame : public CScriptRegion {
|
||||
void DisableEvent(CSimpleEventType eventType);
|
||||
void EnableDrawLayer(uint32_t drawlayer);
|
||||
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
||||
bool GetAttribute(const char* name, int32_t& luaRef);
|
||||
int32_t GetHitRect(CRect& rect);
|
||||
void Hide();
|
||||
void LoadXML_Attributes(const XMLNode* node, CStatus* status);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user