Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ stds.wow = {
"GossipFrame",
"SlashCmdList",
"StaticPopupDialogs",
"UnitPopupViewHousesButtonMixin",
"UIPanelWindows",
"WardrobeItemModelMixin",
"WardrobeItemsCollectionSlotButtonMixin",

Expand Down
Binary file modified Art/Housing/HouseListFrame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Initialization.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local VERSION_TEXT = "1.9.3";
local VERSION_DATE = 1782600000;
local VERSION_TEXT = "1.9.3 b";
local VERSION_DATE = 1782700000;


local addonName, addon = ...
Expand Down
1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ L["ModuleDescription BlizzFixActionBarArt"] = "Fixed an issue where Action Bar A
--HouseList
L["ModuleName Housing_HouseList"] = "House List";
L["ModuleDescription Housing_HouseList"] = "Improve the House List UI:\n\n- Indicate the house's faction with an image on the right.\n\n- Show both Visit House buttons if the player has two houses.";
L["View Houses In Combat Warning"] = "You cannot view houses while in combat.";


--Generic
Expand Down
1 change: 1 addition & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ L["ModuleDescription BlizzFixActionBarArt"] = "修复被你隐藏的动作条装
--HouseList
L["ModuleName Housing_HouseList"] = "房屋列表";
L["ModuleDescription Housing_HouseList"] = "改进房屋列表界面:\n\n- 用图片展示房屋所属的阵营。\n\n- 如果玩家有两栋房子,直接显示两个“访问住宅”按钮。";
L["View Houses In Combat Warning"] = "你无法在战斗中查看住宅。";


--Generic
Expand Down
16 changes: 14 additions & 2 deletions Modules/ControlCenter/Changelog/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ local changelogs = addon.ControlCenter.changelogs;
changelogs[10903] = {
{
type = "date",
versionText = "1.9.3",
timestamp = 1782600000,
versionText = "1.9.3 b",
timestamp = 1782700000,
},

{
Expand Down Expand Up @@ -59,6 +59,18 @@ changelogs[10903] = {
text = MISCELLANEOUS,
},

{
type = "p",
bullet = true,
text = "Plumber House List: Fixed an issue that prohibited you from clicking Copy Character Name if the View Houses button was also shown on the same context menu.",
},

{
type = "p",
bullet = true,
text = "Drawer Macro: Fixed an issue where the Summon Pet buttons didn't work if the text language was set to Spanish.",
},

{
type = "p",
bullet = true,
Expand Down
62 changes: 53 additions & 9 deletions Modules/Housing/HouseList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local _, addon = ...


local Def = {
FrameName = "PlumberHouseListFrame",

CardWidth = 480,
CardHeight = 120,
BackgroundWidth = 512,
Expand All @@ -19,17 +21,26 @@ local Module = {};


do -- HouseListEntry
local NeighborhoodMapXTexCoord = {
--[uiMapID] = {top, bottom},

[0] = {304/512, 456/512}, -- Fallback, No Image
[2351] = {0/512, 152/512}, -- Razorwind Shores
[2352] = {152/512, 304/512}, -- Founder's Point
};

local HouseListEntryMixin = {};

function HouseListEntryMixin:SetHouseInfo(houseInfo)
if houseInfo then
self.HouseNameText:SetText(houseInfo.houseName);
self.HouseOwnerText:SetText(houseInfo.ownerName);
if addon.Housing.IsAllianceNeighborhood(houseInfo.neighborhoodGUID) then
self.Background:SetTexCoord(0, 1, 152/512, 304/512);
else
self.Background:SetTexCoord(0, 1, 0, 152/512);
-- Raeminder: There might be more neighborhood map in the future
local uiMapID = C_Housing.GetUIMapIDForNeighborhood(houseInfo.neighborhoodGUID);
if not (uiMapID and NeighborhoodMapXTexCoord[uiMapID]) then
uiMapID = 0;
end
self.Background:SetTexCoord(0, 1, NeighborhoodMapXTexCoord[uiMapID][1], NeighborhoodMapXTexCoord[uiMapID][2]);
self.VisitHouseButton:Show();
self.VisitHouseButton:SetupAction(houseInfo.neighborhoodGUID, houseInfo.houseGUID, houseInfo.plotID);
else
Expand Down Expand Up @@ -144,6 +155,10 @@ do
end

function MainFrameMixin:InitWithContextData(name, guid, bnetID, isGuildMember)
if (not self:IsShown()) and InCombatLockdown() then
addon.API.DisplayErrorMessage(addon.L["View Houses In Combat Warning"]);
end

self.Title:SetText(string.format(VIEW_HOUSES_TITLE, name));
self:OnHouseListUpdated(nil);
self.LoadingSpinner:Show();
Expand All @@ -159,6 +174,15 @@ do
function MainFrameMixin:OnHide()
self:UnregisterEvent("VIEW_HOUSES_LIST_RECIEVED");
self.LoadingSpinner:Hide();
self:StopMovingOrSizing();
end

function MainFrameMixin:OnDragStart()
self:StartMoving();
end

function MainFrameMixin:OnDragStop()
self:StopMovingOrSizing();
end

function MainFrameMixin:OnEvent(event, ...)
Expand Down Expand Up @@ -203,7 +227,7 @@ do
end

self:SetHeight(headerHeight + numEntries * (Def.CardEffectiveHeight + Def.CardSpacing) + Def.CardSpacing + 7 + extraHeight);
self:UpdatePosition();
--self:UpdatePosition();
self:Raise();
end

Expand Down Expand Up @@ -233,14 +257,15 @@ do

function Module.InitMainFrame()
if not MainFrame then
local frameName = "PlumberHouseListFrame";
MainFrame = CreateFrame("Frame", frameName, UIParent, "PlumberHouseListFrameTemplate");
table.insert(UISpecialFrames, frameName);
MainFrame = CreateFrame("Frame", Def.FrameName, UIParent, "PlumberHouseListFrameTemplate");
table.insert(UISpecialFrames, Def.FrameName);
Mixin(MainFrame, MainFrameMixin);
MainFrame.cards = {};
MainFrame:SetScript("OnShow", MainFrame.OnShow);
MainFrame:SetScript("OnHide", MainFrame.OnHide);
MainFrame:SetScript("OnEvent", MainFrame.OnEvent);
MainFrame:SetScript("OnDragStart", MainFrame.OnDragStart);
MainFrame:SetScript("OnDragStop", MainFrame.OnDragStop);

if MainFrame:IsShown() then
MainFrame:OnShow();
Expand Down Expand Up @@ -273,10 +298,29 @@ do -- Module Control
Module.InitWithContextData(name, guid, bnetID, isGuildMember);
end

local function RegisterFrame()
-- Since overwriting UnitPopupViewHousesButtonMixin is unsafe
-- We use this less unsafe method by replacing HouseListFrame with ours

C_AddOns.LoadAddOn("Blizzard_HouseList");

UIPanelWindows[Def.FrameName] = {
area = "left",
pushable = 1,
};

Module.InitMainFrame();
if _G[Def.FrameName] then
_G.HouseListFrame = _G[Def.FrameName];
end
end

local function EnableModule(state)
if state then
Module.enabled = true;
UnitPopupViewHousesButtonMixin.OnClick = OverrideOnClick;
-- This taint the Menu and prohibits Copy Character Name if View Houses is on the same menu.
--UnitPopupViewHousesButtonMixin.OnClick = OverrideOnClick;
RegisterFrame();
elseif Module.enabled then
Module.enabled = false;
-- Once tainted, it's irreversible and we ask the user to /reload
Expand Down
2 changes: 1 addition & 1 deletion Modules/Housing/Housing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
</Frames>
</Frame>

<Frame name="PlumberHouseListFrameTemplate" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hyperlinksEnabled="true" hidden="true" virtual="true">
<Frame name="PlumberHouseListFrameTemplate" toplevel="true" parent="UIParent" movable="true" enableMouse="true" registerForDrag="LeftButton" hyperlinksEnabled="true" hidden="true" virtual="true">
<!-- Copy almost the entire code from Blizzard because ShowUIPanel combat restriction from modifying the original frame -->

<Size x="400" y="200"/>
Expand Down
6 changes: 0 additions & 6 deletions Modules/Housing/Housing_API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,6 @@ do --House Level / Info / Teleport
button.Cooldown:Hide();
end

function Housing.IsAllianceNeighborhood(neighborhoodGUID)
local uiMapID = C_Housing.GetUIMapIDForNeighborhood(neighborhoodGUID);
local mapIndex = uiMapID and NeighborhoodMapIndex[uiMapID];
return mapIndex == 1;
end

function Housing.RequestUpdateHouseInfo()
if not Housing.isUpdatingHouseInfo then
Housing.isUpdatingHouseInfo = true;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Macros.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ do --MacroInterpreter
name, usable = API.GetPetNameAndUsability(id, true);
id = name;
if name then
macroText = "/sp "..name;
macroText = "/summonpet "..name;
end
end
end
Expand Down