Permalink
Browse files

Few files moves around, started on dps/healing meter, other stuff

  • Loading branch information...
1 parent a6ac83c commit 7337c43a12fafffc96e4a4f8dd5867a538870b1c 1Snail committed Oct 13, 2012
View
@@ -9,6 +9,19 @@ This is where I will document the changes made for SnailUI in each release.
------------------------------------------------------------------------------
+Version 0.4.2
+- Code has been compressed a bit to save space and increase speed
+- Extremely lightweight dps/healing meter added
+- Cooldown text has been added to all action buttons (Similar to OmniCC)
+- An option to color all frames based on threat level instead of just the raid
+ frames has been added under the interface options
+- Action buttons will now change based on if the unit is in range of the spell
+- Action buttons will now change based on if the spell can be cast on the unit
+- Fixed a bug where unicode names were not being displayed correctly
+- Several blizzard buttons have been moved to the top of the screen
+
+------------------------------------------------------------------------------
+
Version 0.4.1
- Action buttons should now have hover effects when mousing over them
- Fixed several minor bugs
View
@@ -4,12 +4,12 @@
Configuration =
{
InactiveAlpha = 0.1,
- Texture = "Interface\\AddOns\\SnailUI\\SnailUI.tga",
+ Texture = "Interface\\AddOns\\SnailUI\\Media\\SnailUI.tga",
Theme = "Default",
Font =
{
- Name = "Interface\\AddOns\\SnailUI\\SnailUI.ttf",
+ Name = "Interface\\AddOns\\SnailUI\\Media\\SnailUI.ttf",
Outline = "MONOCHROME, OUTLINE",
Size = 8,
},
@@ -19,6 +19,10 @@ Configuration =
}
}
+if Configuration.EnableThreatColorsOnAllFrames then
+ EnableThreatColorsOnAllFrames = Configuration.EnableThreatColorsOnAllFrames
+end
+
if not Theme then
Theme = Configuration.Theme
end
@@ -2,48 +2,7 @@
-- Written by Snail
function HandleActionBars()
- if GetConfiguration().ActionBars then
- local OriginalActionButton_Update = ActionButton_Update
-
- ActionButton_Update = function(Self)
- OriginalActionButton_Update(Self)
-
- if Self.BackgroundBottom and not Self.Hovering then
- if _G[Self:GetName() .. "Icon"]:GetTexture() then
- Self.BackgroundBottom:Show()
- Self.BackgroundLeft:Show()
- Self.BackgroundRight:Show()
- Self.BackgroundTop:Show()
-
- Self.BorderBottom:Show()
- Self.BorderLeft:Show()
- Self.BorderRight:Show()
- Self.BorderTop:Show()
- else
- Self.BackgroundBottom:Hide()
- Self.BackgroundLeft:Hide()
- Self.BackgroundRight:Hide()
- Self.BackgroundTop:Hide()
-
- Self.BorderBottom:Hide()
- Self.BorderLeft:Hide()
- Self.BorderRight:Hide()
- Self.BorderTop:Hide()
- end
- end
- end
-
- ActionButton_UpdateUsable = function(Self)
- local IsUsable, NotEnoughMana = IsUsableAction(Self.action);
-
- if IsUsable then
- _G[Self:GetName() .. "Icon"]:SetVertexColor(1.0, 1.0, 1.0);
- elseif NotEnoughMana then
- _G[Self:GetName() .. "Icon"]:SetVertexColor(0.5, 0.5, 1.0);
- else
- _G[Self:GetName() .. "Icon"]:SetVertexColor(0.4, 0.4, 0.4);
- end
- end
+ if GetConfiguration().ActionBars then
local Bars = {}
local Buttons = {}
@@ -104,6 +63,84 @@ function HandleActionBars()
if #Bars > 0 then
local Class = select(2, UnitClass("Player"))
+ local OriginalActionButton_Update = ActionButton_Update
+
+ ActionButton_Update = function(Self)
+ OriginalActionButton_Update(Self)
+
+ if Self.BackgroundBottom and not Self.Hovering then
+ if _G[Self:GetName() .. "Icon"]:GetTexture() then
+ Self.BackgroundBottom:Show()
+ Self.BackgroundLeft:Show()
+ Self.BackgroundRight:Show()
+ Self.BackgroundTop:Show()
+
+ Self.BorderBottom:Show()
+ Self.BorderLeft:Show()
+ Self.BorderRight:Show()
+ Self.BorderTop:Show()
+ else
+ Self.BackgroundBottom:Hide()
+ Self.BackgroundLeft:Hide()
+ Self.BackgroundRight:Hide()
+ Self.BackgroundTop:Hide()
+
+ Self.BorderBottom:Hide()
+ Self.BorderLeft:Hide()
+ Self.BorderRight:Hide()
+ Self.BorderTop:Hide()
+ end
+ end
+ end
+
+ ActionButton_UpdateUsable = function(Self)
+ local IsUsable, NotEnoughMana = IsUsableAction(Self.action)
+
+ if IsUsable then
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(1, 1, 1)
+ elseif NotEnoughMana then
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(0.5, 0.5, 0.5)
+ else
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(0.4, 0.4, 0.4)
+ end
+
+ if ActionHasRange(Self.action) then
+ local Type, SpellID = GetActionInfo(Self.action)
+
+ if Type == "macro" then
+ _, _, SpellID = GetMacroSpell(SpellID)
+ end
+
+ if UnitIsConnected("Target") then
+ if IsActionInRange(Self.action) == 0 then
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(1, 0.2, 0.2)
+ elseif not UnitCanAttack("Player", "Target") and IsHarmfulSpell(GetSpellInfo(SpellID)) then
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(1, 0.2, 0.2)
+ end
+ else
+ if IsHarmfulSpell(GetSpellInfo(SpellID)) then
+ _G[Self:GetName() .. "Icon"]:SetVertexColor(0.4, 0.4, 0.4)
+ end
+ end
+ end
+ end
+
+ local OriginalActionButton_OnUpdate = ActionButton_OnUpdate
+
+ ActionButton_OnUpdate = function(Self, ElapsedTime)
+ OriginalActionButton_OnUpdate(Self, ElapsedTime)
+
+ if not Self.Time then
+ Self.Time = 0
+ end
+
+ if (Self.Time + ElapsedTime) >= 0.1 then
+ ActionButton_UpdateUsable(Self)
+ Self.Time = 0
+ else
+ Self.Time = Self.Time + ElapsedTime
+ end
+ end
for I = 1, #Bars do
_G[Bars[I].ActionBar]:ClearAllPoints()
@@ -18,7 +18,7 @@ function HandleBackgroundColors(Self)
Self.Background:SetTexture(Self.ClassColor.r, Self.ClassColor.g, Self.ClassColor.b)
- if UnitThreatSituation(Self.unit) and (Self.Frame == "Raid") and GetConfiguration()[Self.Frame].ColorByThreatLevel then
+ if UnitThreatSituation(Self.unit) and ((Self.Frame == "Raid") or EnableThreatColorsOnAllFrames) then
if UnitThreatSituation(Self.unit) > 0 then
Self.threatColor =
{
@@ -8,7 +8,7 @@ function HandleBattlegroundAutoRelease(Self)
local InInstance, InstanceType = IsInInstance()
if InInstance then
- if InstanceType == "PVP" then
+ if InstanceType == "pvp" then
RepopMe()
end
end
@@ -15,6 +15,14 @@ function HandleBlizzardFrames()
ExtraActionBarFrame:OriginalSetPoint("TOP", 0, -100)
end
+ GhostFrame:ClearAllPoints()
+ GhostFrame:SetPoint("TOP", 0, -100)
+ GhostFrame.OriginalSetPoint = ExtraActionBarFrame.SetPoint
+ GhostFrame.SetPoint = function()
+ GhostFrame:ClearAllPoints()
+ GhostFrame:OriginalSetPoint("TOP", 0, -100)
+ end
+
WatchFrame:Hide()
WorldStateAlwaysUpFrame:Hide()
@@ -46,8 +46,40 @@ function HandleInterfaceOptions(Version)
GeneralSubcategory.Label3:SetPoint("TOPLEFT", 16, -60)
GeneralSubcategory.Label3:SetText("Theme")
+ GeneralSubcategory.Label4 = GeneralSubcategory:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
+ GeneralSubcategory.Label4:SetJustifyH("LEFT")
+ GeneralSubcategory.Label4:SetPoint("TOPLEFT", 16, -115)
+ GeneralSubcategory.Label4:SetText("Miscellaneous")
+
GeneralSubcategory.ThemeDropdownMenu = CreateFrame("Frame", "ThemeDropdownMenu", GeneralSubcategory, "UIDropDownMenuTemplate")
GeneralSubcategory.ThemeDropdownMenu:SetPoint("TOPLEFT", 0, -73)
+
+ GeneralSubcategory.ThreatColorsCheckBox = CreateFrame("CheckButton", nil, GeneralSubcategory, "InterfaceOptionsCheckButtonTemplate")
+ GeneralSubcategory.ThreatColorsCheckBox:SetPoint("TOPLEFT", 16, -128)
+ GeneralSubcategory.ThreatColorsCheckBox:SetScript("OnClick",
+ function(Self)
+ if EnableThreatColorsOnAllFrames then
+ EnableThreatColorsOnAllFrames = nil
+ Self:SetChecked(false)
+ else
+ EnableThreatColorsOnAllFrames = true
+ Self:SetChecked(true)
+ end
+ end
+ )
+
+ if EnableThreatColorsOnAllFrames then
+ GeneralSubcategory.ThreatColorsCheckBox:SetChecked(true)
+ end
+
+ GeneralSubcategory.ThreatColorsText = GeneralSubcategory:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
+ GeneralSubcategory.ThreatColorsText:SetJustifyH("LEFT")
+ GeneralSubcategory.ThreatColorsText:SetPoint("RIGHT", GeneralSubcategory.ThreatColorsCheckBox, 290, 0)
+ GeneralSubcategory.ThreatColorsText:SetText(
+ "Color all frame borders based on the unit's threat level" ..
+ "\n" ..
+ "Default: Only color the raid frames' borders"
+ )
UIDropDownMenu_Initialize(GeneralSubcategory.ThemeDropdownMenu,
function(ThemeDropdownMenu, Level)
View
@@ -0,0 +1,45 @@
+-- Meter.lua
+-- Written by Snail
+
+function HandleMeter()
+ if GetConfiguration().Meter then
+ local Class = select(2, UnitClass("Player"))
+ local Meter = CreateFrame("Frame", nil, UIParent)
+
+ Meter:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
+ Meter:RegisterEvent("PLAYER_REGEN_DISABLED")
+ Meter:RegisterEvent("PLAYER_REGEN_ENABLED")
+ Meter:SetPoint(GetConfiguration().Meter.Anchor, GetConfiguration().Meter.X, GetConfiguration().Meter.Y)
+ Meter:SetSize(GetConfiguration().Meter.Width - 6, GetConfiguration().Meter.Height - 6)
+ Meter:SetScript("OnEvent",
+ function(Self, Event, ...)
+ print(Event)
+ end
+ )
+
+ Meter.BackgroundBottom = Meter:CreateTexture(nil, "LOW")
+ Meter.BackgroundBottom:SetPoint("BOTTOM", 0, -2)
+ Meter.BackgroundBottom:SetSize(GetConfiguration().Meter.Width - 2, 1)
+ Meter.BackgroundBottom:SetTexture(RAID_CLASS_COLORS[Class].r, RAID_CLASS_COLORS[Class].g, RAID_CLASS_COLORS[Class].b)
+
+ Meter.BackgroundLeft = Meter:CreateTexture(nil, "LOW")
+ Meter.BackgroundLeft:SetPoint("LEFT", -2, 0)
+ Meter.BackgroundLeft:SetSize(1, GetConfiguration().Meter.Height - 4)
+ Meter.BackgroundLeft:SetTexture(RAID_CLASS_COLORS[Class].r, RAID_CLASS_COLORS[Class].g, RAID_CLASS_COLORS[Class].b)
+
+ Meter.BackgroundRight = Meter:CreateTexture(nil, "LOW")
+ Meter.BackgroundRight:SetPoint("RIGHT", 2, 0)
+ Meter.BackgroundRight:SetSize(1, GetConfiguration().Meter.Height - 4)
+ Meter.BackgroundRight:SetTexture(RAID_CLASS_COLORS[Class].r, RAID_CLASS_COLORS[Class].g, RAID_CLASS_COLORS[Class].b)
+
+ Meter.BackgroundTop = Meter:CreateTexture(nil, "LOW")
+ Meter.BackgroundTop:SetPoint("TOP", 0, 2)
+ Meter.BackgroundTop:SetSize(GetConfiguration().Meter.Width - 2, 1)
+ Meter.BackgroundTop:SetTexture(RAID_CLASS_COLORS[Class].r, RAID_CLASS_COLORS[Class].g, RAID_CLASS_COLORS[Class].b)
+
+ Meter.Border = Meter:CreateTexture(nil, "BACKGROUND")
+ Meter.Border:SetPoint("TOPLEFT", -3, 3)
+ Meter.Border:SetSize(GetConfiguration().Meter.Width, GetConfiguration().Meter.Height)
+ Meter.Border:SetTexture(0, 0, 0)
+ end
+end
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -26,6 +26,7 @@ Features
- Automatically repairs your items when visiting a vendor
- Automatically sells all gray items when visiting a vendor
- Automatically releases when you die in a battleground
+- Action button cooldown timers that are similar to OmniCC
------------------------------------------------------------------------------
View
@@ -1,7 +1,7 @@
-- Snail.lua
-- Written by Snail
-local Version = "0.4.1"
+local Version = "0.4.2"
oUF:RegisterStyle("SnailUI",
function(Self, Unit)
@@ -48,6 +48,7 @@ oUF:Factory(
HandleFocus(Self)
HandleFocusTarget(Self)
HandleInterfaceOptions(Version)
+ HandleMeter()
HandleMinimap()
HandlePet(Self)
HandlePlayer(Self)
View
@@ -1,15 +1,13 @@
## Author: Snail
## Dependencies: oUF, oUF_SpellRange
-## SavedVariables: Theme
+## SavedVariables: EnableThreatColorsOnAllFrames, Theme
## Interface: 50001
## Notes: Snail's minimalistic UI
## Title: SnailUI
-## Version: 0.4.1
+## Version: 0.4.2
Configuration.lua
Functions.lua
-oUF_WarlockSpecBars.lua
-Tags.lua
Themes\Default\Default.lua
Themes\Default\DefaultHealer.lua
@@ -33,12 +31,14 @@ Elements\Focus.lua
Elements\FocusTarget.lua
Elements\HealthBar.lua
Elements\InterfaceOptions.lua
+Elements\Meter.lua
Elements\Minimap.lua
Elements\Pet.lua
Elements\Player.lua
Elements\PowerBar.lua
Elements\Raid.lua
Elements\SpellRange.lua
+Elements\Tags.lua
Elements\Target.lua
Elements\TargetTarget.lua
Elements\Unit.lua
@@ -50,6 +50,7 @@ Elements\ClassBars\ComboPointsBar.lua
Elements\ClassBars\DemonicFuryBar.lua
Elements\ClassBars\EclipseBar.lua
Elements\ClassBars\HolyPowerBar.lua
+Elements\ClassBars\oUF_WarlockSpecBars.lua
Elements\ClassBars\RunesBar.lua
Elements\ClassBars\ShadowOrbsBar.lua
Elements\ClassBars\SoulShardsBar.lua
Oops, something went wrong.

0 comments on commit 7337c43

Please sign in to comment.