mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 13:41:06 +03:00
Compare commits
3 Commits
1fd5c5c944
...
66df4c55da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66df4c55da | ||
|
|
91da4e9680 | ||
|
|
fabd5888a9 |
@ -862,6 +862,13 @@ void CLayoutFrame::SetProtectFlag(uint32_t flag) {
|
||||
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) {
|
||||
this->m_flags &= ~0x8;
|
||||
this->m_width = width;
|
||||
|
||||
@ -49,6 +49,7 @@ class CLayoutFrame {
|
||||
virtual bool SetLayoutScale(float scale, bool force);
|
||||
virtual void SetWidth(float width);
|
||||
virtual void SetHeight(float height);
|
||||
virtual void SetSize(float width, float height);
|
||||
virtual float GetWidth();
|
||||
virtual float GetHeight();
|
||||
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) {
|
||||
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) {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "client/Client.hpp"
|
||||
#include "console/CVar.hpp"
|
||||
#include "object/Client.hpp"
|
||||
#include "ui/CScriptObject.hpp"
|
||||
#include "ui/FrameXML.hpp"
|
||||
@ -121,6 +122,7 @@ void CGGameUI::Initialize() {
|
||||
|
||||
LoadScriptFunctions();
|
||||
ScriptEventsRegisterEvents();
|
||||
CGGameUI::RegisterGameCVars();
|
||||
|
||||
// TODO
|
||||
|
||||
@ -232,3 +234,47 @@ void CGGameUI::RegisterFrameFactories() {
|
||||
FrameXML_RegisterFactory("TabardModel", &CGTabardModelFrame::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 IsRaidMemberOrPet(const WOWGUID& guid);
|
||||
static void RegisterFrameFactories();
|
||||
static void RegisterGameCVars();
|
||||
|
||||
private:
|
||||
static WOWGUID s_currentObjectTrack;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user