Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2167660
Showing
52 changed files
with
17,225 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
<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/ | ||
..\FrameXML\UI.xsd"> | ||
|
||
<Frame name="FFF_HandlerFrame"> | ||
<Scripts> | ||
<OnLoad function="FFF_OnLoad"/> | ||
<OnEvent function="FFF_OnEvent"/> | ||
<!--<OnUpdate function="FFF_OnUpdate"/>--> | ||
</Scripts> | ||
</Frame> | ||
|
||
<Frame name="FFF_ReputationExtraFillBar" parent="ReputationWatchBar" setAllPoints="true"> | ||
<Layers> | ||
<Layer level="BORDER"> | ||
<Texture name="$parentTexture" hidden="true" setAllPoints="true"> | ||
<Color r="1.0" g="1.0" b="1.0" a="1.0"/> | ||
</Texture> | ||
</Layer> | ||
</Layers> | ||
<Scripts> | ||
<OnLoad> | ||
self:SetFrameLevel(max(ReputationWatchStatusBar:GetFrameLevel() - 1, 0)); | ||
</OnLoad> | ||
</Scripts> | ||
</Frame> | ||
<Button name="FFF_ReputationTick" parent="ReputationWatchBar" hidden="true" frameStrata="DIALOG"> | ||
<Size> | ||
<AbsDimension x="32" y="32"/> | ||
</Size> | ||
<Anchors> | ||
<Anchor point="CENTER" relativeTo="ReputationWatchBar"> | ||
<Offset> | ||
<AbsDimension x="0" y="0"/> | ||
</Offset> | ||
</Anchor> | ||
</Anchors> | ||
<Scripts> | ||
<OnEnter> | ||
FFF_ReputationTick_Tooltip(); | ||
</OnEnter> | ||
<OnLeave> | ||
GameTooltip:Hide(); | ||
self:UnlockHighlight(); | ||
</OnLeave> | ||
<OnMouseDown> | ||
FFF_ReputationWatchBar_OnClick(arg1); | ||
</OnMouseDown> | ||
</Scripts> | ||
<NormalTexture file="Interface\MainMenuBar\UI-ExhaustionTickNormal"/> | ||
<HighlightTexture name="FFF_ReputationTickHighlight" file="Interface\MainMenuBar\UI-ExhaustionTickHighlight" alphaMode="ADD"/> | ||
</Button> | ||
|
||
<Button name="FFF_MenuListTemplate" hidden="true" frameStrata="DIALOG" enableMouse="true" virtual="true"> | ||
<Frames> | ||
<Frame name="$parentBackdrop" setAllPoints="true"> | ||
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> | ||
<EdgeSize> | ||
<AbsValue val="16"/> | ||
</EdgeSize> | ||
<TileSize> | ||
<AbsValue val="16"/> | ||
</TileSize> | ||
<BackgroundInsets> | ||
<AbsInset left="5" right="5" top="5" bottom="5"/> | ||
</BackgroundInsets> | ||
</Backdrop> | ||
<Scripts> | ||
<OnLoad> | ||
self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b); | ||
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b); | ||
</OnLoad> | ||
</Scripts> | ||
</Frame> | ||
</Frames> | ||
<Scripts> | ||
<OnClick> | ||
self:Hide(); | ||
</OnClick> | ||
<OnEnter function="FFF_Menu_StopCounting"/> | ||
<OnLeave function="FFF_Menu_StartCounting"/> | ||
<OnUpdate function="FFF_Menu_OnUpdate"/> | ||
<OnHide> | ||
FFF_HideMenus(self:GetID()); | ||
</OnHide> | ||
</Scripts> | ||
</Button> | ||
<Button name="FFF_MenuButtonTemplate" virtual="true"> | ||
<Size x="100" y="16"/> | ||
<Layers> | ||
<Layer level="OVERLAY"> | ||
<Texture name="$parentHighlightLeft" file="Interface\Buttons\UI-Listbox-Highlight2" alphaMode="ADD" hidden="true"/> | ||
<Texture name="$parentHighlightRight" file="Interface\Buttons\UI-Listbox-Highlight2" alphaMode="ADD" hidden="true"/> | ||
</Layer> | ||
<Layer level="ARTWORK"> | ||
<Texture name="$parentCheck" file="Interface\Buttons\UI-CheckBox-Check" hidden="true"> | ||
<Size x="18" y="18"/> | ||
<Anchors> | ||
<Anchor point="LEFT"> | ||
<Offset x="0" y="0"/> | ||
</Anchor> | ||
</Anchors> | ||
</Texture> | ||
<Texture name="$parentExpandArrow" file="Interface\ChatFrame\ChatFrameExpandArrow" hidden="true"> | ||
<Size x="16" y="16"/> | ||
<Anchors> | ||
<Anchor point="RIGHT"> | ||
<Offset x="0" y="0"/> | ||
</Anchor> | ||
</Anchors> | ||
</Texture> | ||
<FontString name="$parentLevel" inherits="GameFontHighlightSmallRight"> | ||
<Anchors> | ||
<Anchor point="RIGHT"> | ||
<Offset x="0" y="0"/> | ||
</Anchor> | ||
</Anchors> | ||
</FontString> | ||
</Layer> | ||
</Layers> | ||
<Frames> | ||
<Button name="$parentInvisibleButton" hidden="true" setAllPoints="true"> | ||
<Scripts> | ||
<OnEnter> | ||
FFF_Menu_StopCounting(self:GetParent():GetParent()); | ||
FFF_HideMenus(self:GetParent():GetParent():GetID() + 1); | ||
</OnEnter> | ||
<OnLeave> | ||
FFF_Menu_StartCounting(self:GetParent():GetParent()); | ||
</OnLeave> | ||
</Scripts> | ||
</Button> | ||
</Frames> | ||
<Scripts> | ||
<OnClick function="FFF_MenuButton_OnClick"/> | ||
<OnEnter function="FFF_MenuButton_OnEnter"/> | ||
<OnLeave function="FFF_MenuButton_OnLeave"/> | ||
</Scripts> | ||
<ButtonText name="$parentNormalText"> | ||
<Anchors> | ||
<Anchor point="LEFT"> | ||
<Offset x="-5" y="0"/> | ||
</Anchor> | ||
</Anchors> | ||
</ButtonText> | ||
<NormalFont style="GameFontHighlightSmallLeft"/> | ||
<HighlightFont style="GameFontHighlightSmallLeft"/> | ||
<DisabledFont style="GameFontDisableSmallLeft"/> | ||
</Button> | ||
|
||
<Button name="FFF_FactionButtonTemplate" virtual="true"> | ||
<Size x="16" y="16"/> | ||
<NormalTexture name="$parentIcon" file="Interface\GossipFrame\DailyQuestIcon" setAllPoints="true" /> | ||
<Scripts> | ||
<OnClick> | ||
ReputationBar_OnClick(self:GetParent(), button, down); | ||
</OnClick> | ||
<OnEnter> | ||
FFF_FactionButtonTooltip(self); | ||
local parent = self:GetParent(); | ||
if (parent.tooltip) then | ||
_G[parent:GetName().."ReputationBarFactionStanding"]:SetText(parent.tooltip); | ||
end | ||
_G[parent:GetName().."ReputationBarHighlight1"]:Show(); | ||
_G[parent:GetName().."ReputationBarHighlight2"]:Show(); | ||
</OnEnter> | ||
<OnLeave> | ||
GameTooltip:Hide(); | ||
local parent = self:GetParent(); | ||
_G[parent:GetName().."ReputationBarFactionStanding"]:SetText(parent.standingText); | ||
if ((GetSelectedFaction() ~= parent.index) or (not ReputationDetailFrame:IsShown())) then | ||
_G[parent:GetName().."ReputationBarHighlight1"]:Hide(); | ||
_G[parent:GetName().."ReputationBarHighlight2"]:Hide(); | ||
end | ||
</OnLeave> | ||
</Scripts> | ||
</Button> | ||
|
||
<GameTooltip name="FFF_CacheTooltip" frameStrata="TOOLTIP" hidden="true" parent="UIParent" inherits="GameTooltipTemplate"> | ||
<Scripts> | ||
<OnLoad> | ||
self:SetOwner(UIParent, "ANCHOR_NONE"); | ||
</OnLoad> | ||
</Scripts> | ||
</GameTooltip> | ||
|
||
</Ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
------------------------------------------------------ | ||
-- GFWTable.lua | ||
-- Utilities for manipulating tables | ||
------------------------------------------------------ | ||
|
||
GFWTABLE_THIS_VERSION = 8; | ||
|
||
------------------------------------------------------ | ||
|
||
-- Mean: returns the mean value of a table of numbers | ||
function GFWTable_temp_Mean(aTable) | ||
if (aTable == nil or table.getn(aTable) == 0) then | ||
return nil; | ||
end | ||
return GFWTable.Sum(aTable) / table.getn(aTable); | ||
end | ||
|
||
-- Sum: returns the sum of a table of numbers | ||
function GFWTable_temp_Sum(aTable) | ||
if (aTable == nil or table.getn(aTable) == 0) then | ||
return nil; | ||
end | ||
local sum = 0; | ||
for i=1, table.getn(aTable) do | ||
if (tonumber(aTable[i])) then | ||
sum = sum + aTable[i]; | ||
end | ||
end | ||
return sum; | ||
end | ||
|
||
-- Median: returns the median value (most useful in a table of numbers, but usable in any sorted table) | ||
function GFWTable_temp_Median(aTable) | ||
if (aTable == nil or table.getn(aTable) == 0) then | ||
return nil; | ||
end | ||
if (table.getn(aTable) == 1) then | ||
return aTable[1]; | ||
end | ||
local sortedTable = GFWTable.Copy(aTable); -- leave the original table in whatever order it's in | ||
table.sort(sortedTable); | ||
local count = table.getn(sortedTable); | ||
local median; | ||
if (math.fmod(count, 2) == 0) then -- even table size | ||
local middleIndex1 = count / 2; | ||
local middleIndex2 = middleIndex1 + 1; | ||
median = (sortedTable[middleIndex1] + sortedTable[middleIndex2]) / 2; --average the two middle values | ||
else -- the table size is odd | ||
local trueMiddleIndex = (count + 1) / 2; -- calculate the middle index | ||
median = sortedTable[trueMiddleIndex]; | ||
end | ||
return median; | ||
end | ||
|
||
-- Merge: returns the union of two tables (without repeated elements) | ||
function GFWTable_temp_Merge(table1, table2) | ||
local newTable = { }; | ||
if (table1) then | ||
for i=1, table.getn(table1) do | ||
table.insert(newTable, table1[i]); | ||
end | ||
end | ||
if (table2) then | ||
for i=1, table.getn(table2) do | ||
if (GFWTable.IndexOf(newTable, table2[i]) == 0) then | ||
table.insert(newTable, table2[i]); | ||
end | ||
end | ||
end | ||
return newTable; | ||
end | ||
|
||
-- Diff: returns the difference of two tables (those elements which occur in either but not both) | ||
function GFWTable_temp_Diff(table1, table2) | ||
local newTable = { }; | ||
if (table1 == nil) then | ||
table1 = {}; | ||
end | ||
if (table2 == nil) then | ||
table2 = {}; | ||
end | ||
for i=1, table.getn(table1) do | ||
if (GFWTable.IndexOf(table2, table1[i]) == 0) then | ||
table.insert(newTable, table1[i]); | ||
end | ||
end | ||
for i=1, table.getn(table2) do | ||
if (GFWTable.IndexOf(table1, table2[i]) == 0) then | ||
table.insert(newTable, table2[i]); | ||
end | ||
end | ||
return newTable; | ||
end | ||
|
||
-- Subtract: returns a table containing those items in table1 not present in table2 | ||
function GFWTable_temp_Subtract(table1, table2) | ||
local newTable = { }; | ||
if (table1 == nil or table.getn(table1) == 0) then return newTable; end | ||
if (table2 == nil or table.getn(table2) == 0) then return table1; end | ||
for i=1, table.getn(table1) do | ||
if (GFWTable.IndexOf(table2, table1[i]) == 0) then | ||
table.insert(newTable, table1[i]); | ||
end | ||
end | ||
return newTable; | ||
end | ||
|
||
-- IndexOf: returns the index (1-based) of an item in a table | ||
function GFWTable_temp_IndexOf(aTable, item) | ||
return GFWTable.KeyOf(aTable, item) or 0; | ||
end | ||
|
||
-- KeyOf: returns the key to an item in a table with numeric or non-numeric keys, or nil if not found | ||
function GFWTable_temp_KeyOf(aTable, item) | ||
if (aTable == nil or type(aTable) ~= "table") then | ||
return nil; -- caller probably won't expect this, causing traceable error in their code | ||
end | ||
for key, value in pairs(aTable) do | ||
if (item == value) then | ||
return key; | ||
end | ||
end | ||
return nil; | ||
end | ||
|
||
-- Copy: copies one table's elements into a new table (useful if you want to change them while preserving the first table). | ||
-- Not a deep copy. | ||
function GFWTable_temp_Copy(aTable) | ||
local newTable = { }; | ||
for i=1, table.getn(aTable) do | ||
newTable[i] = aTable[i]; | ||
end | ||
return newTable; | ||
end | ||
|
||
-- Count: returns number of items in a table regardless of whether it has numeric indices. | ||
function GFWTable_temp_Count(aTable) | ||
if (aTable == nil or type(aTable) ~= "table") then | ||
return nil; -- caller probably won't expect this, causing traceable error in their code | ||
end | ||
local count = 0; | ||
for key, value in pairs(aTable) do | ||
count = count + 1; | ||
end | ||
return count; | ||
end | ||
|
||
-- PairsByKeys: an iterator a la pairs() but with keys sorted (by comparator function f if present) | ||
-- Straight from the Lua book | ||
function GFWTable_temp_PairsByKeys(t,f) | ||
local a = {} | ||
for n in pairs(t) do table.insert(a, n) end | ||
table.sort(a, f) | ||
local i = 0 -- iterator variable | ||
local iter = function () -- iterator function | ||
i = i + 1 | ||
if a[i] == nil then return nil | ||
else return a[i], t[a[i]] | ||
end | ||
end | ||
return iter | ||
end | ||
|
||
------------------------------------------------------ | ||
-- load only if not already loaded | ||
------------------------------------------------------ | ||
|
||
if (GFWTable == nil) then | ||
GFWTable = {}; | ||
end | ||
local G = GFWTable; | ||
if (G.Version == nil or (tonumber(G.Version) ~= nil and G.Version < GFWTABLE_THIS_VERSION)) then | ||
|
||
-- Functions | ||
G.Mean = GFWTable_temp_Mean; | ||
G.Sum = GFWTable_temp_Sum; | ||
G.Median = GFWTable_temp_Median; | ||
G.Merge = GFWTable_temp_Merge; | ||
G.Diff = GFWTable_temp_Diff; | ||
G.Subtract = GFWTable_temp_Subtract; | ||
G.IndexOf = GFWTable_temp_IndexOf; | ||
G.KeyOf = GFWTable_temp_KeyOf; | ||
G.Copy = GFWTable_temp_Copy; | ||
G.Count = GFWTable_temp_Count; | ||
G.PairsByKeys = GFWTable_temp_PairsByKeys; | ||
|
||
-- Set version number | ||
G.Version = GFWTABLE_THIS_VERSION; | ||
end | ||
|
||
|
Oops, something went wrong.