📦 NEW: wb housing databar#228
Conversation
Toxicom
left a comment
There was a problem hiding this comment.
Looks good, small housekeeping notes. I can do them myself later too, let me know.
| function DB:OnEvent(event, ...) | ||
| if event == "PLAYER_ENTERING_WORLD" then | ||
| -- I don't like this but its a workaround for fresh logins where the housing data isn't available yet. Might be a better solution. | ||
| C_Timer.After(3, function() |
There was a problem hiding this comment.
use E:Delay(), same syntax and same functionality, just a preference
| -- If smart mode changes, force update | ||
| function DB:OnEvent(event, ...) | ||
| if event == "PLAYER_ENTERING_WORLD" then | ||
| -- I don't like this but its a workaround for fresh logins where the housing data isn't available yet. Might be a better solution. |
There was a problem hiding this comment.
Have you looked at /etrace to see if there's an event that fires when housing data is ready?
|
|
||
| if self:UpdateSmartMode() then event = "ELVUI_FORCE_UPDATE" end | ||
|
|
||
| if event == "HOUSE_LEVEL_FAVOR_UPDATED" and TXUI.IsRetail then |
There was a problem hiding this comment.
Event is registered only for Retail, so additional and TXUI.IsRetail is unnecessary imo
|
|
||
| function DB:OnClick() | ||
| if self.mode == DB.const.mode.housing and TXUI.IsRetail then | ||
| if not _G.HousingDashboardFrame or not _G.HousingDashboardFrame:IsShown() then _G.HousingFramesUtil.ToggleHousingDashboard() end |
There was a problem hiding this comment.
We don't need to check for IsShown(). The function toggles the dashboard eitherway, should allow the user to both open and close the dashboard via click.
| end | ||
|
|
||
| function DB:OnClick() | ||
| if self.mode == DB.const.mode.housing and TXUI.IsRetail then |
| DT.tooltip:Show() | ||
| end | ||
|
|
||
| function DB:UpdateHousingTooltip() |
There was a problem hiding this comment.
I don't see the OnClick event reflected in the housing tooltip
| and self.const.mode.exp | ||
| or self.const.mode.rep | ||
| local mode | ||
| if self.db.mode == "housing" and TXUI.IsRetail then |
There was a problem hiding this comment.
| if self.db.mode == "housing" and TXUI.IsRetail then | |
| if self.db.mode == "housing" then |
| if self.db.infoEnabled then | ||
| self.infoText:SetText(E:Round((self.mode == DB.const.mode.exp) and self.data.expPercentage or self.data.repPercentage) .. "%") | ||
| self.infoText:SetText( | ||
| E:Round((self.mode == DB.const.mode.exp) and self.data.expPercentage or (self.mode == DB.const.mode.housing) and self.data.housingPercentage or self.data.repPercentage) |
There was a problem hiding this comment.
Line is getting difficult to read, can we move the logic outside the E:Round() function for better readability?
| "UPDATE_EXHAUSTION", | ||
| "UPDATE_FACTION", | ||
| "COMBAT_TEXT_UPDATE", | ||
| "CVAR_UPDATE", |
There was a problem hiding this comment.
Since CVAR_UPDATE is currently used exclusively for housing, let's move it to retail's table
Closes #227
Summary of Changes
Description