WoWInterface SVN UnitFrameTweaks

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 4 to Rev 5
    Reverse comparison

Rev 4 → Rev 5

UnitFrameTweaks/UnitFrameTweaks.toc
2,10 → 2,11
## Title: Unit Frame Tweaks
## Notes: Class Icons/Portraits, Health Color, and Hit Indicators.
## Author: AnduinLothar
## OptionalDeps:
## OptionalDeps: Portfolio
## RequiredDeps: Portfolio
## SavedVariables: UnitFrameTweaks_SavedVars
## Version: 1.1
## X-Embeds: Portfolio
## X-Revision: $Rev: 5127 $
## X-Date: $Date: 2007-11-13 18:34:54 -0600 (Tue, 13 Nov 2007) $
## X-Category: UnitFrames
UnitFrameTweaks/PortfolioRegistration.lua
6,108 → 6,71
UnitFrameTweaks = {}
end
 
local Portfolio = LibStub and LibStub("Portfolio")
if not Portfolio then return end
 
local optionTable = {
id = "UnitFrameTweaks",
id = "UnitFrameTweaks";
options = {
{
id = "HealthColor",
tvar = "HealthColor",
text = "Health Bar Color Change",
tooltipText = "Healthbar changes color as it decreases.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "1",
},
id = "HealthColor";
text = "Health Bar Color Change";
tooltipText = "Healthbar changes color as it decreases.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "1";
};
{
id = "ClassPortraits",
tvar = "ClassPortraits",
text = "Class Portraits",
tooltipText = "Replace unit portraits with class icons when applicable.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "0",
callback = UnitFrameTweaks.UpdateClassPortraits,
},
id = "ClassPortraits";
text = "Class Portraits";
tooltipText = "Replace unit portraits with class icons when applicable.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "0";
callback = UnitFrameTweaks.UpdateClassPortraits;
};
{
id = "ClassIcons",
tvar = "ClassIcons",
text = "Class Icons",
tooltipText = "Adds class icons to the target and party member frames.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "0",
callback = UnitFrameTweaks.UpdateClassIcons,
},
id = "ClassIcons";
text = "Class Icons";
tooltipText = "Adds class icons to the target and party member frames.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "0";
callback = UnitFrameTweaks.UpdateClassIcons;
};
{
id = "HitIndicators",
text = "Hit Indicators",
subText = "Toggle the hit indicators on the unit frame portraits.",
type = CONTROLTYPE_HEADER,
},
id = "HitIndicators";
text = "Hit Indicators";
subText = "Toggle the hit indicators on the unit frame portraits.";
type = CONTROLTYPE_HEADER;
};
{
id = "PlayerHitIndicator",
tvar = "PlayerHitIndicator",
text = "Player",
tooltipText = "Toggles the hit indicator on the player portrait.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "1",
callback = UnitFrameTweaks.UpdatePlayerHitIndicatorStatus,
point = {nil, nil, nil, nil, 0},
},
id = "PlayerHitIndicator";
text = "Player";
tooltipText = "Toggles the hit indicator on the player portrait.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "1";
callback = UnitFrameTweaks.UpdatePlayerHitIndicatorStatus;
point = {nil, nil, nil, nil, 0};
};
{
id = "TargetHitIndicator",
tvar = "TargetHitIndicator",
text = "Target",
tooltipText = "Toggles the hit indicator on the target portrait.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "0",
callback = UnitFrameTweaks.UpdateTargetHitIndicatorStatus,
point = {"TOPLEFT", "PlayerHitIndicator", "TOPRIGHT", 100, 0},
},
id = "TargetHitIndicator";
text = "Target";
tooltipText = "Toggles the hit indicator on the target portrait.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "0";
callback = UnitFrameTweaks.UpdateTargetHitIndicatorStatus;
point = {"TOPLEFT", "PlayerHitIndicator", "TOPRIGHT", 100, 0};
};
{
id = "PartyHitIndicator",
tvar = "PartyHitIndicator",
text = "Party",
tooltipText = "Toggles the hit indicator on the party portraits.",
type = CONTROLTYPE_CHECKBOX,
defaultValue = "0",
callback = UnitFrameTweaks.UpdatePartyHitIndicatorStatus,
point = {"TOPLEFT", "TargetHitIndicator", "TOPRIGHT", 100, 0},
},
},
savedVarTable = "UnitFrameTweaks_SavedVars",
id = "PartyHitIndicator";
text = "Party";
tooltipText = "Toggles the hit indicator on the party portraits.";
type = CONTROLTYPE_CHECKBOX;
defaultValue = "0";
callback = UnitFrameTweaks.UpdatePartyHitIndicatorStatus;
point = {"TOPLEFT", "TargetHitIndicator", "TOPRIGHT", 100, 0};
};
};
savedVarTable = "UnitFrameTweaks_SavedVars";
}
 
Portfolio.RegisterOptionSet(optionTable)
 
-- <= == == == == == == == == == == == == =>
-- => Event Registration
-- <= == == == == == == == == == == == == =>
 
if (not UnitFrameTweaks.events) then
UnitFrameTweaks.events = {}
end
 
function UnitFrameTweaks.events.VARIABLES_LOADED()
UnitFrameTweaks.init = false
end
 
function UnitFrameTweaks.events.PLAYER_ENTERING_WORLD()
if (not UnitFrameTweaks.init) then
UnitFrameTweaks.init = true
--Portfolio.RegisterOptionSet(optionTable)
UnitFrameTweaks.UpdateClassIcons(UnitFrameTweaks_SavedVars["ClassIcons"])
UnitFrameTweaks.UpdateClassPortraits(UnitFrameTweaks_SavedVars["ClassPortraits"])
UnitFrameTweaks.UpdatePlayerHitIndicatorStatus(UnitFrameTweaks_SavedVars["PlayerHitIndicator"])
UnitFrameTweaks.UpdateTargetHitIndicatorStatus(UnitFrameTweaks_SavedVars["TargetHitIndicator"])
UnitFrameTweaks.UpdatePartyHitIndicatorStatus(UnitFrameTweaks_SavedVars["PartyHitIndicator"])
end
end
 
-- Event Registration
if (UnitFrameTweaks.events) then
local frame = CreateFrame("Frame", "UnitFrameTweaksFrame")
for event, func in pairs(UnitFrameTweaks.events) do
frame:RegisterEvent(event)
end
frame:SetScript("OnEvent", function(self, event, ...)
UnitFrameTweaks.events[event](self, event, ...)
end)
end
UnitFrameTweaks/UnitFrameTweaks.xml
1,6 → 1,9
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
<!-- $Id: Portfolio.xml 5169 2007-12-07 11:37:43Z karlkfi $ -->
 
<Include file="Libs\Portfolio\Portfolio.xml"/>
 
<Script file="HealthColor.lua"/>
<Script file="ClassPortraits.lua"/>
<Script file="ClassIcons.lua"/>