Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BfA Fixes and Tweaks #99

Merged
merged 23 commits into from Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions README.md
Expand Up @@ -70,8 +70,6 @@ After a short while a configured and ready to go version of ImprovedBlizzardUI i

## Action Bars

* Interface from Battle for Azeroth Recreated and Improved.
* Customizable Scale.
* Out of Range Indicator.
* Customizable Texts.
* Casting Bar Repositioned and Scaled.
Expand All @@ -88,11 +86,6 @@ After a short while a configured and ready to go version of ImprovedBlizzardUI i
* Improved Fonts.
* Right Click Micro Menu.

## World Map

* Old World Instance / Raid Portals.
* Cursor World Co-Ordinates.

## Tooltips

* Anchored to Mouse.
Expand Down
25 changes: 1 addition & 24 deletions config.lua
Expand Up @@ -306,21 +306,6 @@ framesOptions:Initialize(function(self)
showPerformance:SetText(Loc['Display System Statistics']);
AddTooltip(showPerformance, Loc['Displays FPS and Latency above the Mini Map.']);

-- -- World Map Title
-- local worldMapTitle = self:CreateTitle();
-- worldMapTitle:SetPoint('TOPLEFT', showPerformance, 'BOTTOMLEFT', 0, -24);
-- worldMapTitle:SetText(Loc['World Map']);

-- local showMapDungeons = self:CreateCheckButton('showMapDungeons');
-- showMapDungeons:SetPoint('TOPLEFT', worldMapTitle, 'BOTTOMLEFT', 0, -8);
-- showMapDungeons:SetText(Loc['Show Instance Portals']);
-- AddTooltip(showMapDungeons, Loc['Displays the location of old world Raids and Dungeons.']);

-- local showCursorCoords = self:CreateCheckButton('showCursorCoords');
-- showCursorCoords:SetPoint('TOPLEFT', showMapDungeons, 'BOTTOMLEFT', 0, 0);
-- showCursorCoords:SetText(Loc['Show Cursor Co-ordinates']);
-- AddTooltip(showCursorCoords, Loc['Displays the world location of where you are highlighting.']);

-- Kill Feed Title
local killFeedTitle = self:CreateTitle();
killFeedTitle:SetPoint('TOPLEFT', showPerformance, 'BOTTOMLEFT', 0, -10);
Expand Down Expand Up @@ -374,14 +359,12 @@ framesOptions:Initialize(function(self)
end);

local barDefaults = {
showArt = true,
barTimer = true,
targetBarTimer = true,
focusBarTimer = true,
castingScale = 1.1,

outOfRange = true,
barsScale = 1.0,

showMainText = true,
showBottomLeftText = true,
Expand Down Expand Up @@ -462,14 +445,8 @@ barOptions:Initialize(function(self)
showLeftText:SetText(Loc['Show Right 2 Bar Text']);
AddTooltip(showLeftText, Loc['Disabling Hides Macro Name Text and Hotkey Text from the specified Action Bar']);

local barsScale = self:CreateSlider('barsScale');
barsScale:SetPoint('TOPLEFT', showLeftText, 'BOTTOMLEFT', 4, 0);
barsScale:SetRange(0.1, 2.0);
barsScale:SetStep(0.1);
AddTooltip(barsScale, Loc['Action Bar Scale']);

local buffsTitle = self:CreateTitle();
buffsTitle:SetPoint('TOPLEFT', barsScale, 'BOTTOMLEFT', 0, -24);
buffsTitle:SetPoint('TOPLEFT', showLeftText, 'BOTTOMLEFT', 0, -24);
buffsTitle:SetText(Loc['Buffs and Debuffs']);

local buffScale = self:CreateSlider('buffScale');
Expand Down
13 changes: 13 additions & 0 deletions core.lua
@@ -1,4 +1,5 @@
local _, Loc = ...;
local DEBUG = true;

Imp = CreateFrame('Frame', nil, UIParent);

Expand Down Expand Up @@ -75,6 +76,18 @@ function Imp.ApplyClassColours(statusBar, unit)
end
end

--[[
Just a debug printing function.

@ param Message to be outputted
@ return void
]]
function Imp.Debug(message)
if (DEBUG == true) then
print(message);
end
end

--[[
Gets the Unit's class colour in RGB

Expand Down
167 changes: 23 additions & 144 deletions modules/bars/actionbars.lua
Expand Up @@ -39,141 +39,27 @@ local function StyleButtons(actionBar, show)
end

--[[
Handles most of the actual adjustment.
Does the initial hiding of the Bag Bar.

@ return void
]]
local function AdjustActionBars(rightMultiBarShowing)
if (InCombatLockdown() == false) then
ActionBars.bagsVisible = true;
ToggleBagBar();

-- Basically force art to be the small type at all times
_, width, height = GetAtlasInfo("hud-MainMenuBar-small");
MainMenuBar:SetSize(width,height);
MainMenuBarArtFrame:SetSize(width,height);
MainMenuBarArtFrameBackground:SetSize(width, height);
MainMenuBarArtFrameBackground.BackgroundLarge:Hide();
MainMenuBarArtFrameBackground.BackgroundSmall:Show();
MainMenuBarArtFrame.PageNumber:ClearAllPoints();
MainMenuBarArtFrame.PageNumber:SetPoint("RIGHT", MainMenuBarArtFrameBackground, "RIGHT", -6, -3);

-- Move Right Bar and Make Horizontal
if (rightMultiBarShowing) then
Imp.ModifyFrame(MultiBarBottomRight, 'TOP', MainMenuBar, -142, 85, nil);
Imp.ModifyFrame(MultiBarBottomRightButton7, 'RIGHT', MultiBarBottomRightButton6, 43, 0, nil);
end

-- Vehicle Leave Button (Flight Paths etc)
Imp.ModifyBasicFrame(MainMenuBarVehicleLeaveButton, 'LEFT', MainMenuBar, -40, -10, nil);
MainMenuBarVehicleLeaveButton:SetFrameStrata('HIGH');

-- Adjust Stancebar and Pet Bar
if(MultiBarBottomLeft:IsShown()) then
Imp.ModifyFrame(StanceBarFrame, 'TOPLEFT', MainMenuBar, -4, 75, nil);
Imp.ModifyFrame(PetActionButton1, 'TOP', MainMenuBar, -124, 77, nil);

if (StanceBarFrame:IsShown()) then
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 118, nil);
else
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 78, nil);
end
end

if(MultiBarBottomRight:IsShown()) then
Imp.ModifyFrame(StanceBarFrame, 'TOPLEFT', MainMenuBar, -4, 118, nil);
Imp.ModifyFrame(PetActionButton1, 'TOP', MainMenuBar, -124, 121, nil);

if (StanceBarFrame:IsShown()) then
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 165, nil);
else
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 121, nil);
end
end

if(MultiBarBottomLeft:IsShown() ~= true and MultiBarBottomRight:IsShown() ~= true) then
Imp.ModifyFrame(StanceBarFrame, 'TOPLEFT', MainMenuBar, 0, 31, nil);
Imp.ModifyFrame(PetActionButton1, 'TOP', MainMenuBar, -124, 34, nil);

if (StanceBarFrame:IsShown()) then
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 85, nil);
else
Imp.ModifyFrame(PossessBarFrame, 'TOPLEFT', MainMenuBar, 0, 38, nil);
end
end

-- Style the Action Buttons
StyleButtons('ActionButton', BarsDB.showMainText);
StyleButtons('MultiBarBottomLeftButton', BarsDB.showBottomLeftText);
StyleButtons('MultiBarBottomRightButton', BarsDB.showBottomRightText);
StyleButtons('MultiBarLeftButton', BarsDB.showLeftText);
StyleButtons('MultiBarRightButton', BarsDB.showRightText);

-- Hide Textures
PossessBackground1:SetTexture(nil);
PossessBackground2:SetTexture(nil);
_G['StanceBarLeft']:SetTexture(nil);
_G['StanceBarMiddle']:SetTexture(nil);
_G['StanceBarRight']:SetTexture(nil);
_G['SlidingActionBarTexture'..0]:SetTexture(nil);
_G['SlidingActionBarTexture'..1]:SetTexture(nil);

if ( StanceBarFrame ) then
for i=1, NUM_STANCE_SLOTS do
_G["StanceButton"..i]:GetNormalTexture():SetTexture(nil);
_G["StanceButton"..i]:GetNormalTexture():SetTexture(nil);
end
end
end
local function HideBagBar()
ActionBars.bagsVisible = true;
ToggleBagBar();
end

--[[
When two status bars are shown (eg Rep + Exp) then hide the large texture and force the small

@params StatusTrackingBarManager $self TThe status bar manager
@params StatusBar $bar The actual bar itself
@params float $width The width of the status bar.

@ return void
]]
hooksecurefunc(StatusTrackingBarManager, "SetDoubleBarSize", function (self, bar, width)
local textureHeight = self:GetInitialBarHeight();
local statusBarHeight = textureHeight - 5;

self.SingleBarSmallUpper:SetSize(width, statusBarHeight);
self.SingleBarSmallUpper:SetPoint("CENTER", bar, 0, 4);
self.SingleBarSmallUpper:Show();
self.SingleBarLargeUpper:Hide();

self.SingleBarSmall:SetSize(width, statusBarHeight);
self.SingleBarSmall:SetPoint("CENTER", bar, 0, -5);
self.SingleBarSmall:Show();
self.SingleBarLarge:Hide();

bar.StatusBar:SetSize(width, statusBarHeight);
bar:SetSize(width, statusBarHeight);
end);

--[[
When one status bars are shown (eg Rep + Exp) then hide the large texture and force the small
Based on config shows or hides the Action Bar Button text.

@params StatusTrackingBarManager $self TThe status bar manager
@params StatusBar $bar The actual bar itself
@params float $width The width of the status bar.

@ return void
]]
hooksecurefunc(StatusTrackingBarManager, "SetSingleBarSize", function (self, bar, width)
local textureHeight = self:GetInitialBarHeight();

self.SingleBarSmall:SetSize(width, textureHeight);
self.SingleBarSmall:SetPoint("CENTER", bar, 0, 4);
self.SingleBarSmall:Show();
self.SingleBarLarge:Hide();

bar.StatusBar:SetSize(width, textureHeight);
bar:SetSize(width, textureHeight);
end);
local function ApplyButtonStyles()
StyleButtons('ActionButton', BarsDB.showMainText);
StyleButtons('MultiBarBottomLeftButton', BarsDB.showBottomLeftText);
StyleButtons('MultiBarBottomRightButton', BarsDB.showBottomRightText);
StyleButtons('MultiBarLeftButton', BarsDB.showLeftText);
StyleButtons('MultiBarRightButton', BarsDB.showRightText);
end

--[[
Handles the Out of Range action bar colouring
Expand Down Expand Up @@ -202,18 +88,6 @@ local function ActionButton_OnUpdate_Hook(self, elapsed)
end
hooksecurefunc('ActionButton_OnUpdate', ActionButton_OnUpdate_Hook);

--[[
Detect if Bottom Right Bar is showing

@params MainMenuBar $self The main menu bar itself
@params bool $rightMultiBarShowing Is the Bottom Right bar showing?

@ return void
]]
hooksecurefunc(MainMenuBar, "ChangeMenuBarSizeAndPosition", function (self, rightMultiBarShowing)
AdjustActionBars(rightMultiBarShowing);
end);

--[[
Handles the WoW API Events Registered Below

Expand All @@ -223,14 +97,19 @@ end);
@ return void
]]
local function HandleEvents (self, event, ...)
if(event == 'PLAYER_ENTERING_WORLD' or event == 'PLAYER_LOGIN' or event == 'PLAYER_TALENT_UPDATE' or event == 'ACTIVE_TALENT_GROUP_CHANGED') then
AdjustActionBars(MultiBarBottomRight:IsShown());
end
if (event == 'PLAYER_ENTERING_WORLD') then
local initialLogin, reloadingUI = ...;

HideBagBar();
ApplyButtonStyles();
end
end

-- Register the Modules Events
ActionBars:SetScript('OnEvent', HandleEvents);
ActionBars:RegisterEvent('PLAYER_LOGIN');
ActionBars:RegisterEvent('PLAYER_ENTERING_WORLD');
ActionBars:RegisterEvent('PLAYER_TALENT_UPDATE');
ActionBars:RegisterEvent('ACTIVE_TALENT_GROUP_CHANGED');

hooksecurefunc(MainMenuBar, "ChangeMenuBarSizeAndPosition", function (self, rightMultiBarShowing)
HideBagBar();
ApplyButtonStyles();
end);
4 changes: 2 additions & 2 deletions modules/bars/castbar.lua
Expand Up @@ -91,7 +91,7 @@ end);
@ return void
]]
local function HandleEvents (self, event, ...)
if (event == 'ADDON_LOADED') then -- Add Config
if (event == 'PLAYER_LOGIN') then -- Add Config

-- Player Cast Bar
if (BarsDB.barTimer) then
Expand Down Expand Up @@ -132,4 +132,4 @@ end

-- Register the Modules Events
CastingFrame:SetScript('OnEvent', HandleEvents);
CastingFrame:RegisterEvent('ADDON_LOADED');
CastingFrame:RegisterEvent('PLAYER_LOGIN');
6 changes: 5 additions & 1 deletion modules/maps/minimap.lua
Expand Up @@ -34,7 +34,11 @@ local function CoordsFrame_Tick(self, elapsed)
if(x ~= 0 and y ~= 0) then
CoordsFrame.text:SetFormattedText('(%d:%d)', x * 100, y * 100);
end
end
end
else
if(Minimap:IsVisible()) then
CoordsFrame.text:SetText('');
end
end
end
CoordsFrame.elapsed = 0; -- Reset the timer
Expand Down
16 changes: 7 additions & 9 deletions modules/misc/tooltips.lua
Expand Up @@ -410,17 +410,15 @@ local function HandleEvents (self, event, ...)

if (event == 'ADDON_LOADED' and ... == 'Blizzard_PVPUI') then
fontSize = PrimaryDB.tooltipFontSize;
StylePvPRewardTooltip(PVPRewardTooltip);
--StylePvPRewardTooltip(PVPRewardTooltip);

PVPRewardTooltip:HookScript('OnShow', function ()
StylePvPRewardTooltip(PVPRewardTooltip);
end);
-- PVPRewardTooltip:HookScript('OnShow', function ()
-- StylePvPRewardTooltip(PVPRewardTooltip);
-- end);

ConquestTooltip:HookScript('OnShow', function ()
StylePvPConquestTooltip(ConquestTooltip);
end);


-- ConquestTooltip:HookScript('OnShow', function ()
-- StylePvPConquestTooltip(ConquestTooltip);
-- end);
end
end

Expand Down