mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 21:51:06 +03:00
Compare commits
12 Commits
e42aa95eb7
...
1ad0d797ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ad0d797ba | ||
|
|
d210df2f43 | ||
|
|
66df4c55da | ||
|
|
91da4e9680 | ||
|
|
fabd5888a9 | ||
|
|
1fd5c5c944 | ||
|
|
4f26eeb05c | ||
|
|
14d14dacb0 | ||
|
|
c6ddfc0d87 | ||
|
|
99a95e9db4 | ||
|
|
7ec9a35b4b | ||
|
|
43895197af |
@ -862,6 +862,13 @@ void CLayoutFrame::SetProtectFlag(uint32_t flag) {
|
|||||||
this->m_flags &= ~0x800;
|
this->m_flags &= ~0x800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLayoutFrame::SetSize(float width, float height) {
|
||||||
|
this->m_flags &= ~0x8;
|
||||||
|
this->m_width = width;
|
||||||
|
this->m_height = height;
|
||||||
|
this->Resize(0);
|
||||||
|
}
|
||||||
|
|
||||||
void CLayoutFrame::SetWidth(float width) {
|
void CLayoutFrame::SetWidth(float width) {
|
||||||
this->m_flags &= ~0x8;
|
this->m_flags &= ~0x8;
|
||||||
this->m_width = width;
|
this->m_width = width;
|
||||||
|
|||||||
@ -49,6 +49,7 @@ class CLayoutFrame {
|
|||||||
virtual bool SetLayoutScale(float scale, bool force);
|
virtual bool SetLayoutScale(float scale, bool force);
|
||||||
virtual void SetWidth(float width);
|
virtual void SetWidth(float width);
|
||||||
virtual void SetHeight(float height);
|
virtual void SetHeight(float height);
|
||||||
|
virtual void SetSize(float width, float height);
|
||||||
virtual float GetWidth();
|
virtual float GetWidth();
|
||||||
virtual float GetHeight();
|
virtual float GetHeight();
|
||||||
virtual void GetSize(float& width, float& height, int32_t a4);
|
virtual void GetSize(float& width, float& height, int32_t a4);
|
||||||
|
|||||||
@ -219,7 +219,28 @@ int32_t CScriptRegion_SetHeight(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CScriptRegion_SetSize(lua_State* L) {
|
int32_t CScriptRegion_SetSize(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CScriptRegion::GetObjectType();
|
||||||
|
auto region = static_cast<CScriptRegion*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (!region->ProtectedFunctionsAllowed()) {
|
||||||
|
// TODO disallowed logic
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lua_isnumber(L, 2) || !lua_isnumber(L, 3)) {
|
||||||
|
luaL_error(L, "Usage: %s:SetSize(width, height)", region->GetDisplayName());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto ndcWidth = static_cast<float>(lua_tonumber(L, 2)) / (CoordinateGetAspectCompensation() * 1024.0f);
|
||||||
|
auto ddcWidth = NDCToDDCWidth(ndcWidth);
|
||||||
|
|
||||||
|
auto ndcHeight = static_cast<float>(lua_tonumber(L, 3)) / (CoordinateGetAspectCompensation() * 1024.0f);
|
||||||
|
auto ddcHeight = NDCToDDCWidth(ndcHeight);
|
||||||
|
|
||||||
|
region->SetSize(ddcWidth, ddcHeight);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CScriptRegion_GetSize(lua_State* L) {
|
int32_t CScriptRegion_GetSize(lua_State* L) {
|
||||||
|
|||||||
@ -83,7 +83,9 @@ int32_t Script_IsActionInRange(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetBonusBarOffset(lua_State* L) {
|
int32_t Script_GetBonusBarOffset(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
lua_pushnumber(L, CGActionBar::GetBonusBarOffset());
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetMultiCastBarOffset(lua_State* L) {
|
int32_t Script_GetMultiCastBarOffset(lua_State* L) {
|
||||||
|
|||||||
319
src/ui/game/BattlenetUI.cpp
Normal file
319
src/ui/game/BattlenetUI.cpp
Normal file
@ -0,0 +1,319 @@
|
|||||||
|
#include "ui/game/BattlenetUI.hpp"
|
||||||
|
#include "client/ClientServices.hpp"
|
||||||
|
#include "net/Login.hpp"
|
||||||
|
#include "ui/FrameScript.hpp"
|
||||||
|
#include "util/Lua.hpp"
|
||||||
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
|
namespace BattlenetUI {
|
||||||
|
|
||||||
|
int32_t Script_BNGetInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumFriends(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetFriendInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetFriendInfoByID(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumFriendToons(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetFriendToonInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetToonInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNRemoveFriend(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetFriendNote(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetSelectedFriend(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetSelectedFriend(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumFriendInvites(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetFriendInviteInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSendFriendInvite(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSendFriendInviteByID(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNAcceptFriendInvite(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNDeclineFriendInvite(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNReportFriendInvite(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetAFK(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetDND(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetCustomMessage(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetCustomMessageTable(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetFocus(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSendWhisper(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNCreateConversation(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNInviteToConversation(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNLeaveConversation(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSendConversationMessage(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumConversationMembers(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetConversationMemberInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetConversationInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNListConversation(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumBlocked(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetBlockedInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNIsBlocked(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetBlocked(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetSelectedBlock(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetSelectedBlock(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumBlockedToons(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetBlockedToonInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNIsToonBlocked(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetToonBlocked(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetSelectedToonBlock(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetSelectedToonBlock(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNReportPlayer(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNConnected(lua_State* L) {
|
||||||
|
// TODO real implementation
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNFeaturesEnabledAndConnected(lua_State* L) {
|
||||||
|
// TODO real implementation
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsBNLogin(lua_State* L) {
|
||||||
|
if (ClientServices::LoginConnection() && ClientServices::LoginConnection()->GetLoginServerType() == 1) {
|
||||||
|
lua_pushboolean(L, true);
|
||||||
|
} else {
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNFeaturesEnabled(lua_State* L) {
|
||||||
|
// TODO real implementation
|
||||||
|
lua_pushboolean(L, false);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNRequestFOFInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetNumFOF(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetFOFInfo(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNSetMatureLanguageFilter(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetMatureLanguageFilter(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNIsSelf(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNIsFriend(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_BNGetMaxPlayersInConversation(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static FrameScript_Method s_ScriptFunctions[] = {
|
||||||
|
{ "BNGetInfo", &Script_BNGetInfo },
|
||||||
|
{ "BNGetNumFriends", &Script_BNGetNumFriends },
|
||||||
|
{ "BNGetFriendInfo", &Script_BNGetFriendInfo },
|
||||||
|
{ "BNGetFriendInfoByID", &Script_BNGetFriendInfoByID },
|
||||||
|
{ "BNGetNumFriendToons", &Script_BNGetNumFriendToons },
|
||||||
|
{ "BNGetFriendToonInfo", &Script_BNGetFriendToonInfo },
|
||||||
|
{ "BNGetToonInfo", &Script_BNGetToonInfo },
|
||||||
|
{ "BNRemoveFriend", &Script_BNRemoveFriend },
|
||||||
|
{ "BNSetFriendNote", &Script_BNSetFriendNote },
|
||||||
|
{ "BNSetSelectedFriend", &Script_BNSetSelectedFriend },
|
||||||
|
{ "BNGetSelectedFriend", &Script_BNGetSelectedFriend },
|
||||||
|
{ "BNGetNumFriendInvites", &Script_BNGetNumFriendInvites },
|
||||||
|
{ "BNGetFriendInviteInfo", &Script_BNGetFriendInviteInfo },
|
||||||
|
{ "BNSendFriendInvite", &Script_BNSendFriendInvite },
|
||||||
|
{ "BNSendFriendInviteByID", &Script_BNSendFriendInviteByID },
|
||||||
|
{ "BNAcceptFriendInvite", &Script_BNAcceptFriendInvite },
|
||||||
|
{ "BNDeclineFriendInvite", &Script_BNDeclineFriendInvite },
|
||||||
|
{ "BNReportFriendInvite", &Script_BNReportFriendInvite },
|
||||||
|
{ "BNSetAFK", &Script_BNSetAFK },
|
||||||
|
{ "BNSetDND", &Script_BNSetDND },
|
||||||
|
{ "BNSetCustomMessage", &Script_BNSetCustomMessage },
|
||||||
|
{ "BNGetCustomMessageTable", &Script_BNGetCustomMessageTable },
|
||||||
|
{ "BNSetFocus", &Script_BNSetFocus },
|
||||||
|
{ "BNSendWhisper", &Script_BNSendWhisper },
|
||||||
|
{ "BNCreateConversation", &Script_BNCreateConversation },
|
||||||
|
{ "BNInviteToConversation", &Script_BNInviteToConversation },
|
||||||
|
{ "BNLeaveConversation", &Script_BNLeaveConversation },
|
||||||
|
{ "BNSendConversationMessage", &Script_BNSendConversationMessage },
|
||||||
|
{ "BNGetNumConversationMembers", &Script_BNGetNumConversationMembers },
|
||||||
|
{ "BNGetConversationMemberInfo", &Script_BNGetConversationMemberInfo },
|
||||||
|
{ "BNGetConversationInfo", &Script_BNGetConversationInfo },
|
||||||
|
{ "BNListConversation", &Script_BNListConversation },
|
||||||
|
{ "BNGetNumBlocked", &Script_BNGetNumBlocked },
|
||||||
|
{ "BNGetBlockedInfo", &Script_BNGetBlockedInfo },
|
||||||
|
{ "BNIsBlocked", &Script_BNIsBlocked },
|
||||||
|
{ "BNSetBlocked", &Script_BNSetBlocked },
|
||||||
|
{ "BNSetSelectedBlock", &Script_BNSetSelectedBlock },
|
||||||
|
{ "BNGetSelectedBlock", &Script_BNGetSelectedBlock },
|
||||||
|
{ "BNGetNumBlockedToons", &Script_BNGetNumBlockedToons },
|
||||||
|
{ "BNGetBlockedToonInfo", &Script_BNGetBlockedToonInfo },
|
||||||
|
{ "BNIsToonBlocked", &Script_BNIsToonBlocked },
|
||||||
|
{ "BNSetToonBlocked", &Script_BNSetToonBlocked },
|
||||||
|
{ "BNSetSelectedToonBlock", &Script_BNSetSelectedToonBlock },
|
||||||
|
{ "BNGetSelectedToonBlock", &Script_BNGetSelectedToonBlock },
|
||||||
|
{ "BNReportPlayer", &Script_BNReportPlayer },
|
||||||
|
{ "BNConnected", &Script_BNConnected },
|
||||||
|
{ "BNFeaturesEnabledAndConnected", &Script_BNFeaturesEnabledAndConnected },
|
||||||
|
{ "IsBNLogin", &Script_IsBNLogin },
|
||||||
|
{ "BNFeaturesEnabled", &Script_BNFeaturesEnabled },
|
||||||
|
{ "BNRequestFOFInfo", &Script_BNRequestFOFInfo },
|
||||||
|
{ "BNGetNumFOF", &Script_BNGetNumFOF },
|
||||||
|
{ "BNGetFOFInfo", &Script_BNGetFOFInfo },
|
||||||
|
{ "BNSetMatureLanguageFilter", &Script_BNSetMatureLanguageFilter },
|
||||||
|
{ "BNGetMatureLanguageFilter", &Script_BNGetMatureLanguageFilter },
|
||||||
|
{ "BNIsSelf", &Script_BNIsSelf },
|
||||||
|
{ "BNIsFriend", &Script_BNIsFriend },
|
||||||
|
{ "BNGetMaxPlayersInConversation", &Script_BNGetMaxPlayersInConversation },
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BattlenetUI_RegisterScriptFunctions() {
|
||||||
|
for (auto& func : BattlenetUI::s_ScriptFunctions) {
|
||||||
|
FrameScript_RegisterFunction(func.name, func.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/ui/game/BattlenetUI.hpp
Normal file
6
src/ui/game/BattlenetUI.hpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef UI_GAME_BATTLENET_UI_HPP
|
||||||
|
#define UI_GAME_BATTLENET_UI_HPP
|
||||||
|
|
||||||
|
void BattlenetUI_RegisterScriptFunctions();
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -1,4 +1,9 @@
|
|||||||
#include "ui/game/CGActionBar.hpp"
|
#include "ui/game/CGActionBar.hpp"
|
||||||
|
|
||||||
|
uint32_t CGActionBar::s_bonusBarOffset;
|
||||||
uint32_t CGActionBar::s_currentPage;
|
uint32_t CGActionBar::s_currentPage;
|
||||||
uint32_t CGActionBar::s_tempPageActiveFlags;
|
uint32_t CGActionBar::s_tempPageActiveFlags;
|
||||||
|
|
||||||
|
uint32_t CGActionBar::GetBonusBarOffset() {
|
||||||
|
return CGActionBar::s_bonusBarOffset;
|
||||||
|
}
|
||||||
|
|||||||
@ -5,9 +5,16 @@
|
|||||||
|
|
||||||
class CGActionBar {
|
class CGActionBar {
|
||||||
public:
|
public:
|
||||||
// Static variables
|
// Public static variables
|
||||||
static uint32_t s_currentPage;
|
static uint32_t s_currentPage;
|
||||||
static uint32_t s_tempPageActiveFlags;
|
static uint32_t s_tempPageActiveFlags;
|
||||||
|
|
||||||
|
// Public static functions
|
||||||
|
static uint32_t GetBonusBarOffset();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Private static variables
|
||||||
|
static uint32_t s_bonusBarOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
#include "ui/game/CGGameUI.hpp"
|
#include "ui/game/CGGameUI.hpp"
|
||||||
#include "client/Client.hpp"
|
#include "client/Client.hpp"
|
||||||
|
#include "console/CVar.hpp"
|
||||||
#include "object/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"
|
||||||
#include "ui/game/ActionBarScript.hpp"
|
#include "ui/game/ActionBarScript.hpp"
|
||||||
#include "ui/game/BattlefieldInfoScript.hpp"
|
#include "ui/game/BattlefieldInfoScript.hpp"
|
||||||
|
#include "ui/game/BattlenetUI.hpp"
|
||||||
#include "ui/game/CGCharacterModelBase.hpp"
|
#include "ui/game/CGCharacterModelBase.hpp"
|
||||||
#include "ui/game/CGCooldown.hpp"
|
#include "ui/game/CGCooldown.hpp"
|
||||||
#include "ui/game/CGDressUpModelFrame.hpp"
|
#include "ui/game/CGDressUpModelFrame.hpp"
|
||||||
@ -70,8 +72,7 @@ void LoadScriptFunctions() {
|
|||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
GMTicketInfoRegisterScriptFunctions();
|
GMTicketInfoRegisterScriptFunctions();
|
||||||
|
BattlenetUI_RegisterScriptFunctions();
|
||||||
// TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGGameUI::EnterWorld() {
|
void CGGameUI::EnterWorld() {
|
||||||
@ -121,6 +122,7 @@ void CGGameUI::Initialize() {
|
|||||||
|
|
||||||
LoadScriptFunctions();
|
LoadScriptFunctions();
|
||||||
ScriptEventsRegisterEvents();
|
ScriptEventsRegisterEvents();
|
||||||
|
CGGameUI::RegisterGameCVars();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
@ -232,3 +234,47 @@ void CGGameUI::RegisterFrameFactories() {
|
|||||||
FrameXML_RegisterFactory("TabardModel", &CGTabardModelFrame::Create, false);
|
FrameXML_RegisterFactory("TabardModel", &CGTabardModelFrame::Create, false);
|
||||||
FrameXML_RegisterFactory("QuestPOIFrame", &CGQuestPOIFrame::Create, false);
|
FrameXML_RegisterFactory("QuestPOIFrame", &CGQuestPOIFrame::Create, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGGameUI::RegisterGameCVars() {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
CVar::Register("enableCombatText", "Whether to show floating combat text", 0x10, "1", nullptr, GAME);
|
||||||
|
CVar::Register("combatTextFloatMode", "The combat text float mode", 0x10, "1", nullptr, GAME);
|
||||||
|
CVar::Register("fctCombatState", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctDodgeParryMiss", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctDamageReduction", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctRepChanges", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctReactives", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctFriendlyHealers", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctComboPoints", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctLowManaHealth", nullptr, 0x10, "1", nullptr, GAME);
|
||||||
|
CVar::Register("fctEnergyGains", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctPeriodicEnergyGains", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctHonorGains", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctAuras", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctAllSpellMechanics", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctSpellMechanics", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("fctSpellMechanicsOther", nullptr, 0x10, "0", nullptr, GAME);
|
||||||
|
|
||||||
|
CVar::Register("xpBarText", "Whether the XP bar shows the numeric experience value", 0x10, "0", nullptr, GAME);
|
||||||
|
|
||||||
|
CVar::Register("playerStatusText", "Whether the player portrait shows numeric health/mana values", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("petStatusText", "Whether the pet portrait shows numeric health/mana values", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("partyStatusText", "Whether the party portraits shows numeric health/mana values", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("targetStatusText", "Whether the target portrait shows numeric health/mana values", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("statusTextPercentage", "Whether numeric health/mana values are shown as raw values or percentages", 0x10, "0", nullptr, GAME);
|
||||||
|
|
||||||
|
CVar::Register("showPartyBackground", "Show a background behind party members", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("partyBackgroundOpacity", "The opacity of the party background", 0x10, "0.5", nullptr, GAME);
|
||||||
|
CVar::Register("hidePartyInRaid", "Whether to hide the party UI while in a raid", 0x10, "0", nullptr, GAME);
|
||||||
|
CVar::Register("showPartyPets", "Whether to show pets in the party UI", 0x20, "1", nullptr, GAME);
|
||||||
|
CVar::Register("showRaidRange", "Show range indicator in raid UI", 0x20, "0", nullptr, GAME);
|
||||||
|
|
||||||
|
CVar::Register("showArenaEnemyFrames", "Show arena enemy frames while in an Arena", 0x20, "1", nullptr, GAME);
|
||||||
|
CVar::Register("showArenaEnemyCastbar", "Show the spell enemies are casting on the Arena Enemy frames", 0x20, "1", nullptr, GAME);
|
||||||
|
CVar::Register("showArenaEnemyPets", "Show the enemy team's pets on the ArenaEnemy frames", 0x20, "1", nullptr, GAME);
|
||||||
|
|
||||||
|
CVar::Register("fullSizeFocusFrame", "Increases the size of the focus frame to that of the target frame", 0x20, "0", nullptr, GAME);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class CGGameUI {
|
|||||||
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();
|
||||||
|
static void RegisterGameCVars();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static WOWGUID s_currentObjectTrack;
|
static WOWGUID s_currentObjectTrack;
|
||||||
|
|||||||
15
src/ui/game/CGPartyInfo.cpp
Normal file
15
src/ui/game/CGPartyInfo.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "ui/game/CGPartyInfo.hpp"
|
||||||
|
|
||||||
|
WOWGUID CGPartyInfo::m_members[4];
|
||||||
|
|
||||||
|
uint32_t CGPartyInfo::NumMembers() {
|
||||||
|
uint32_t count = 0;
|
||||||
|
|
||||||
|
for (auto& member : CGPartyInfo::m_members) {
|
||||||
|
if (member != 0) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
16
src/ui/game/CGPartyInfo.hpp
Normal file
16
src/ui/game/CGPartyInfo.hpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef UI_GAME_C_G_PARTY_INFO_HPP
|
||||||
|
#define UI_GAME_C_G_PARTY_INFO_HPP
|
||||||
|
|
||||||
|
#include "util/GUID.hpp"
|
||||||
|
|
||||||
|
class CGPartyInfo {
|
||||||
|
public:
|
||||||
|
// Public static functions
|
||||||
|
static uint32_t NumMembers();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Private static variables
|
||||||
|
static WOWGUID m_members[];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -4,6 +4,7 @@
|
|||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/ScriptFunctionsShared.hpp"
|
#include "ui/ScriptFunctionsShared.hpp"
|
||||||
#include "ui/game/CGGameUI.hpp"
|
#include "ui/game/CGGameUI.hpp"
|
||||||
|
#include "ui/game/Types.hpp"
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
#include "ui/simple/CSimpleTop.hpp"
|
||||||
#include "util/StringTo.hpp"
|
#include "util/StringTo.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
@ -131,7 +132,41 @@ int32_t Script_GetCVarInfo(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_SetCVar(lua_State* L) {
|
int32_t Script_SetCVar(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (!lua_isstring(L, 1)) {
|
||||||
|
luaL_error(L, "Usage: SetCVar(\"cvar\", value [, \"scriptCvar\")");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto varName = lua_tostring(L, 1);
|
||||||
|
auto var = CVar::LookupRegistered(varName);
|
||||||
|
|
||||||
|
if (!var || (var->m_flags & 0x40)) {
|
||||||
|
luaL_error(L, "Couldn't find CVar named '%s'", varName);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var->m_flags & 0x4 || var->m_flags & 0x100) {
|
||||||
|
luaL_error(L, "\"%s\" is read-only", varName);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(var->m_flags & 0x8)/* TODO || CSimpleTop::GetInstance()->dword124C */) {
|
||||||
|
auto value = lua_tostring(L, 2);
|
||||||
|
if (!value) {
|
||||||
|
value = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
var->Set(value, true, false, false, true);
|
||||||
|
|
||||||
|
if (lua_isstring(L, 3)) {
|
||||||
|
auto scriptVarName = lua_tostring(L, 3);
|
||||||
|
FrameScript_SignalEvent(SCRIPT_CVAR_UPDATE, "%s%s", scriptVarName, value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// TODO CGGameUI::ShowBlockedActionFeedback(nullptr, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetCVar(lua_State* L) {
|
int32_t Script_GetCVar(lua_State* L) {
|
||||||
|
|||||||
@ -1187,7 +1187,7 @@ void ScriptEventsInitialize() {
|
|||||||
g_scriptEvents[295] = "TRAINER_UPDATE";
|
g_scriptEvents[295] = "TRAINER_UPDATE";
|
||||||
g_scriptEvents[296] = "TRAINER_DESCRIPTION_UPDATE";
|
g_scriptEvents[296] = "TRAINER_DESCRIPTION_UPDATE";
|
||||||
g_scriptEvents[297] = "TRAINER_CLOSED";
|
g_scriptEvents[297] = "TRAINER_CLOSED";
|
||||||
g_scriptEvents[298] = "CVAR_UPDATE";
|
g_scriptEvents[SCRIPT_CVAR_UPDATE] = "CVAR_UPDATE";
|
||||||
g_scriptEvents[299] = "TRADE_SKILL_SHOW";
|
g_scriptEvents[299] = "TRADE_SKILL_SHOW";
|
||||||
g_scriptEvents[300] = "TRADE_SKILL_UPDATE";
|
g_scriptEvents[300] = "TRADE_SKILL_UPDATE";
|
||||||
g_scriptEvents[301] = "TRADE_SKILL_CLOSE";
|
g_scriptEvents[301] = "TRADE_SKILL_CLOSE";
|
||||||
|
|||||||
@ -9,6 +9,8 @@ enum SCRIPTEVENT {
|
|||||||
SCRIPT_PLAYER_LOGOUT = 254,
|
SCRIPT_PLAYER_LOGOUT = 254,
|
||||||
SCRIPT_PLAYER_ENTERING_WORLD = 255,
|
SCRIPT_PLAYER_ENTERING_WORLD = 255,
|
||||||
// TODO
|
// TODO
|
||||||
|
SCRIPT_CVAR_UPDATE = 298,
|
||||||
|
// TODO
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user