WoWInterface SVN FluidFrames

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

trunk/FluidFrames/FluidFrames.toc New file
0,0 → 1,16
## Interface: 30000
## Title: FluidFrames
## Notes: Move, Resize, Rescale!
## Author: AnduinLothar
## RequiredDeps: Portfolio
## OptionalDeps:
## SavedVariablesPerCharacter: FluidFramesModifiedFrames, FluidFrames_SavedVars
## Version: 2.1
## X-Date: Oct 15 2008
## X-Category: Frames
## X-Website: http://www.wowinterface.com/downloads/info7080-FluidFrames.html
## X-Email: karlkfi@yahoo.com
## X-Localizations: enUS
## X-CompatibleLocales: enUS, enGB
localization.en.lua
FluidFrames.lua
trunk/FluidFrames/readme.rtf New file
0,0 → 1,123
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red0\green127\blue15;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2}
{\list\listtemplateid3\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid3}
{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid4}
{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid5}
{\list\listtemplateid6\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid6}
{\list\listtemplateid7\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid7}
{\list\listtemplateid8\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid8}
{\list\listtemplateid9\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid9}
{\list\listtemplateid10\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid10}
{\list\listtemplateid11\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid11}
{\list\listtemplateid12\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid12}
{\list\listtemplateid13\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid13}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}}
\margl1440\margr1440\vieww12240\viewh15840\viewkind1
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
 
\f0\b\fs48 \cf2 FluidFrames
\b0\fs24 \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
\cf0 Move, hide, scale, and resize frames with independent x&y axes.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
\b\fs36 \cf2 Usage Instructions:
\b0\fs24 \cf0 \
\
 
\i\fs28 \cf2 Unsaved Movement
\i0\fs24 \cf0 \
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls1\ilvl0\cf0 {\listtext \'95 }Drag almost any normal UI Panel (e.g. CharacterFrame, SpellbookFrame, TalentFrame, QuestLogFrame, FriendsFrame, etc.) from any open space on the frame. This movement is intended to be for temporary changes and does not store location in the FluidFrames database. \
{\listtext \'95 }However, this movement registers the frame as user placed. The position will be remembered by the WoW client and restored on subsequent login/reloadui if not overridden by placement code (e.g. CharacterFrame, Minimap). Most of these draggable frames reset if you hide and re-show them. \
{\listtext \'95 }Some frames will not reset automatically (e.g. GameMenuFrame, BattlefieldFrame). To reset these, highlight the frame, right click to reset and then reloadui/relog.\
{\listtext \'95 }The MinimapCluster is an added exception case and can be dragged by the top bar.\
{\listtext \'95 }Temporary dragging can be disabled using the checkbox in the Khoas options.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
\i\fs28 \cf2 Saved Movement\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls2\ilvl0
\i0\fs24 \cf0 {\listtext 1. }
\b Setup a Binding
\b0 - Assign a key-binding [Main Menu > Key Bindings > FluidFrames > Highlight Mouse Frame] to select, highlight and cycle through frames under the cursor. (The "Highlight All Mouse Frames" binding cycles through all frames under the cursor, including unnamed ones.)\
{\listtext 2. }
\b Highlight a Frame
\b0 - Put your cursor over the frame you want to move and use the key-binding. It will select the frame the furthest underneath. Consecutively using the key-binding will highlight frames closer to the front. Hold shift while using the key-binding to cycle backwards through the frames.\
{\listtext 3. }
\b Move
\b0 - Drag the highlighted frame to relocate it permanently. It will disable movement from other code sources and save across sessions.\
{\listtext 4. }
\b Resize
\b0 - Hold shift and drag from the sides or corners to resize.\
{\listtext 5. }
\b Re-scale
\b0 - Hold shift and drag the bottom right re-scale icon to re-scale.\
{\listtext 6. }
\b Reset
\b0 - Right-click to reset a moved/resized/rescaled frame once highlighted.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
\b\fs36 \cf2 Bindings:\
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
\ls3\ilvl0
\b0\fs24 \cf0 {\listtext 1. }
\b Highlight Mouse Frame
\b0 - Cycle through highlighting frames under the cursor (hold shift to cycle backwards)\
{\listtext 2. }
\b Highlight All Mouse Frames
\b0 - Cycle through highlighting all frames under the cursor, including unnamed frames (hold shift to cycle backwards)\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
\b\fs36 \cf2 Notes:
\b0\fs24 \cf0 \
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls4\ilvl0\cf0 {\listtext \'95 }Dragging will also drag sibling frames. (Frames that have the same parent and are anchored to the frame you are dragging.)\
{\listtext \'95 }To drag some bars you have to drag the 1st button.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls5\ilvl0\cf0 {\listtext \'95 }To move the primary action button bar drag ActionButton1.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls6\ilvl0\cf0 {\listtext \'95 }To find the ShapeshiftBarFrame put your mouse over the left edge of the 1st button when using the key-binding.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls7\ilvl0\cf0 {\listtext \'95 }To drag all the player buffs & debuffs make sure you drag the TemporaryEnchantFrame.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls8\ilvl0\cf0 {\listtext \'95 }To move Chat Frames just unlock and use the default tabs.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls9\ilvl0\cf0 {\listtext \'95 }To drag the TargetFrame make sure you don't drag the TargetFrameTextureFrame on accident.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls10\ilvl0\cf0 {\listtext \'95 }To move the whole minimap drag the MinimapCluster.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls11\ilvl0\cf0 {\listtext \'95 }Experiment with which frame to change. if it doesn't work the way you wanted just right-click to reset.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls12\ilvl0\cf0 {\listtext \'95 }Some frames have complex sub frames that update their locations independent of parent size. If resizing doesn't work well try scaling.\
\pard\tx220\tx720\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li720\fi-720\ql\qnatural\pardirnatural
\ls13\ilvl0\cf0 {\listtext \'95 }If secure frames are moved by default blizzard code while in combat they cannot be moved back until after combat. Also, you will not be able to drag secure frames in combat.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 
\b\fs36 \cf2 Change Log:
\b0\fs24 \cf0 \
\
v2.1\
- Changed distribution to distribute FluidFrames with Portfolio unembedded.\
- Fixed bug that caused LoD UI Panels to not be temporarily draggable\
- TOC to 30000\
\
v2.0\
- Embedded Interface Config Option Panel (Using Portfolio instead of Khaos)\
- Added Re-show All option, to show all hidden frames without resetting position.\
- Fixed temporary dragging}
\ No newline at end of file
trunk/FluidFrames/localization.en.lua New file
0,0 → 1,68
--------------------------------------------------------------------------
-- localization.lua
--------------------------------------------------------------------------
 
BINDING_HEADER_FLUIDFRAMES = "FluidFrames";
BINDING_NAME_HIGHLIGHTMOUSEFRAME = "Highlight Mouse Frame";
BINDING_NAME_HIGHLIGHTALLMOUSEFRAMES = "Highlight All Mouse Frames";
 
if (not SHOW) then
SHOW = "Show";
end
 
local frame = LIGHTYELLOW_FONT_COLOR_CODE.."%s"..FONT_COLOR_CODE_CLOSE
 
FLUIDFRAMES_CANT_FIND_STORED = "Can't Find "..frame.." to set its stored location."
FLUIDFRAMES_CANT_MOVE_IN_COMBAT = "Can't Move "..frame.." in combat."
FLUIDFRAMES_DELAYING_EXCEPTION_FRAME = "Delaying init of exception frame "..frame.."."
FLUIDFRAMES_CANT_RESIZE_IN_COMBAT = frame.." cannot be resized or moved in combat."
FLUIDFRAMES_CANT_RESCALE_IN_COMBAT = frame.." cannot be rescaled or moved in combat."
FLUIDFRAMES_CANT_MOVE_IN_COMBAT = frame.." cannot be moved in combat."
FLUIDFRAMES_START_RESIZE = "Starting to resize "..frame.."."
FLUIDFRAMES_STOP_RESIZE = "Stopped resizing "..frame.."."
FLUIDFRAMES_NO_MOVABLE_FRAMES = "No movable frames found under the cursor."
FLUIDFRAMES_HIGHLIGHT = "Highlighting: "..frame.." Parent: "..frame
FLUIDFRAMES_CANT_IMMOBILIZE_NOT_UIPARENT = "Can't Immobilize "..frame..". Not anchored to UIParent."
FLUIDFRAMES_CANT_IMMOBILIZE_NO_DEFAULT = "Can't Immobilize "..frame..". Default location not saved."
FLUIDFRAMES_CANT_IMMOBILIZE_UNNAMED = "Can't Immobilize Unamed Frame."
FLUIDFRAMES_UNNAMED_ANCHOR = frame.." may not reset properly after logging out, because it is anchored to an unnamed frame. If you want to reset it later you will probably have to \"/console reloadui\"."
FLUIDFRAMES_CANT_RESET_UNNAMED = "Can't Reset Unamed Frame."
FLUIDFRAMES_CANT_RESET_NO_DEFAULT = "Can't Reset "..frame..". Default location not saved. \"/console reloadui\" might reset it."
FLUIDFRAMES_CANT_RESET_NOT_FOUND = "Can't Reset "..frame..". The frame cannot be found."
FLUIDFRAMES_RESET = "Frame Reset: "..frame
FLUIDFRAMES_NIL = "(nil)"
FLUIDFRAMES_REPARENTING = "Reparenting "..frame.." from "..frame.." to "..frame.."."
FLUIDFRAMES_REPARENTING_SIBLING = "Reparenting sibling "..frame.." from "..frame.." to "..frame.."."
FLUIDFRAMES_CANT_HIDE = "Can't hide "..frame..", data not stored."
 
--Khaos Texts
FLUIDFRAMES_HEADER = "FluidFrames"
FLUIDFRAMES_HEADER_WITH_VERSION = "FluidFrames v%.2f"
FLUIDFRAMES_DESC = "Move, Resize, Rescale!"
FLUIDFRAMES_DESC_FULL = "Move, resize, and scale frames with independent x&y axes."
FLUIDFRAMES_HELP_HEADER = "Usage Instructions"
FLUIDFRAMES_HELP1 = "• Assign key bindings to select and highlight frames:"
FLUIDFRAMES_HELP2 = " · Binding #1: cycle through highlighting frames under the cursor "
FLUIDFRAMES_HELP3 = " · Binding #2: cycle through highlighting all frames under the cursor, including unnamed frames"
FLUIDFRAMES_HELP4 = " · Hold shift to cycle backwards when using a binding."
FLUIDFRAMES_HELP5 = " · Note: To drag some bars you have to drag the 1st button."
FLUIDFRAMES_HELP6 = "• Right-click to reset a moved/resized/rescaled frame once highlighted."
FLUIDFRAMES_HELP7 = "• Hold shift and drag from the sides or corners to resize."
FLUIDFRAMES_HELP8 = "• Hold shift and drag the bottom right re-scale icon to re-scale."
FLUIDFRAMES_RESHOW_HELP = "Disable permenent hiding of %s"
FLUIDFRAMES_RESHOW_FEEDBACK = "%s has been re-shown."
FLUIDFRAMES_RESHOW = "Re-Show"
FLUIDFRAMES_RESHOW_ALL = "Re-Show All"
FLUIDFRAMES_RESHOW_ALL_FINISHED = "All frames have been re-shown."
FLUIDFRAMES_RESET_HEADER = "Reset Modified Frames";
FLUIDFRAMES_RESET_ALL = "Reset All"
FLUIDFRAMES_RESET_ALL_FRAMES = "Reset all frames."
FLUIDFRAMES_RESET_ALL_FINISHED = "All frames have been reset."
FLUIDFRAMES_RESET_HELP = "Re-show and reset the location of %s"
FLUIDFRAMES_RESET_FEEDBACK = "%s has been reset."
FLUIDFRAMES_TEMP_DRAGGABLE = "Enable temporary dragging of UI Panels"
 
FLUIDFRAMES_NEWLINE = "\n"
 
--Slash commands
SLASH_FLUIDFRAMESSLASH1 = "/resetframes"
\ No newline at end of file
trunk/FluidFrames/Bindings.xml New file
0,0 → 1,8
<Bindings>
<Binding name="HIGHLIGHTMOUSEFRAME" header="FLUIDFRAMES">
FluidFrames.HighlightMouseFrame();
</Binding>
<Binding name="HIGHLIGHTALLMOUSEFRAMES">
FluidFrames.HighlightMouseFrame(true);
</Binding>
</Bindings>
trunk/FluidFrames/FluidFrames.lua New file
0,0 → 1,1459
--------------------------------------------------------------------------
-- FluidFrames.lua
--------------------------------------------------------------------------
--[[
FluidFrames
 
By: AnduinLothar <KarlKFI@cosmosui.org>
 
$Id: FluidFrames.lua 5241 2008-04-06 00:13:33Z karlkfi $
$Rev: 5241 $
$LastChangedBy: karlkfi $
$Date: 2008-04-05 19:13:33 -0500 (Sat, 05 Apr 2008) $
 
 
]]--
 
FluidFrames = {}
 
FluidFrames.version = tonumber(GetAddOnMetadata("FluidFrames", "Version"))
 
FluidFrames.debug = false
 
FluidFrames.NEW_PARENT = "UIParent"
 
local function Print(text)
-- Grey
DEFAULT_CHAT_FRAME:AddMessage(text, .5,.5,.5)
end
 
local function DebugPrint(text)
if (FluidFrames.debug) then
-- Grey
DEFAULT_CHAT_FRAME:AddMessage(text, .5,.5,.5)
end
end
 
local function OrNil(text)
return text or FLUIDFRAMES_NIL
end
 
function FluidFrames.Round(x, place)
if not place then place = 1 end
return floor(x*place+0.5)/place
end
 
function FluidFrames.Compare(x, y)
local delta = 0.001
return x <= y + delta and x >= y - delta
end
 
FluidFrames.UninitializedFrames = {}
 
FluidFrames.FramesToDragByParent = {
"PaperDollFrame",
"ReputationFrame",
"SkillFrame",
"PVPFrameHonor",
"PetPaperDollFrame",
"PVPFrame",
}
 
FluidFrames.FramesToInitLater = {
["QuestWatchFrame"] = true,
}
 
function FluidFrames.InitMovedFrames(frameList)
local framesToHide = {};
 
for k,v in pairs(frameList) do
-- remove parents that used to be unnamed frames
if (type(v.parent) ~= "string") then
v.parent = nil
end
-- remove relativeTo points that used to be unnamed frames
for kk,vv in ipairs(v.point) do
if (type(vv[2]) ~= "string") then
v.point[kk] = nil
end
end
 
local frame = getglobal(k)
if (not frame) then
DebugPrint(format(FLUIDFRAMES_CANT_FIND_STORED, k))
-- Add to the Uninitialized list and check on subsequent ADDON_LOADED and PLAYER_REGEN_ENABLED events
if (frameList ~= FluidFrames.UninitializedFrames) then
FluidFrames.UninitializedFrames[k] = frameList[k]
end
 
elseif (frame:IsProtected() and InCombatLockdown()) then
DebugPrint(format(FLUIDFRAMES_CANT_MOVE_IN_COMBAT, k))
-- Add to the Uninitialized list and check on subsequent ADDON_LOADED and PLAYER_REGEN_ENABLED events
if (frameList ~= FluidFrames.UninitializedFrames) then
FluidFrames.UninitializedFrames[k] = frameList[k]
end
 
elseif (FluidFrames.FramesToInitLater[k] and frameList ~= FluidFrames.UninitializedFrames) then
DebugPrint(format(FLUIDFRAMES_DELAYING_EXCEPTION_FRAME, k))
-- Exception frames load on PLAYER_REGEN_ENABLED or QUEST_LOG_UPDATE after PLAYER_ENTERING_WORLD
FluidFrames.UninitializedFrames[k] = frameList[k]
 
else
-- SetPoint to stored location, immobilize and establish SetPointHook
if (v.immobilized) then
local data = v.immobilized
if (data.point) then
if (data.scale and not FluidFrames.Compare(data.scale, frame:GetScale())) then
frame:SetScale(data.scale)
end
if (data.width and data.height) then
local widthScale = data.width/frame:GetWidth()
local heightScale = data.height/frame:GetHeight()
if (FluidFrames.debug) then
Print("Dimension Restore: "..(frame.GetName and frame:GetName() or "(nil)"))
Print("Saved Width: "..FluidFrames.Round(data.width, 100).." Curr Width: "..FluidFrames.Round(frame:GetWidth(), 100))
Print("Saved Height: "..FluidFrames.Round(data.height, 100).." Curr Height: "..FluidFrames.Round(frame:GetHeight(), 100))
Print("WidthScale: "..FluidFrames.Round(widthScale, 100).." HeightScale: "..FluidFrames.Round(heightScale, 100))
end
FluidFrames.RescaleFrame(frame, widthScale, heightScale, true)
end
else
-- update v1.01 sv
data.point = { data[1], data[2], data[3], data[4], data[5] }
data[1] = nil
data[2] = nil
data[3] = nil
data[4] = nil
data[5] = nil
end
 
FluidFrames.FreeFrameFromParent(frame)
 
frame:ClearAllPoints()
frame:SetPoint(unpack(data.point))
frame:SetMovable(1)
frame:SetUserPlaced(1)
frame.FFImmobilized = true
hooksecurefunc(frame, "SetPoint", FluidFrames.SetPointHook)
hooksecurefunc(frame, "SetWidth", FluidFrames.SetWidthHook)
hooksecurefunc(frame, "SetHeight", FluidFrames.SetHeightHook)
frame.FFSetXHooked = true
end
 
-- Store frame to hide later (so that it doesn't hide moved child frames before they are reparented)
if (v.hidden) then
tinsert(framesToHide, k)
end
 
-- Remove from the Uninitialized list
if (frameList == FluidFrames.UninitializedFrames) then
frameList[k] = nil
end
 
end
 
end
 
-- Hide frames and establish ShowHook
for i,frameName in pairs(framesToHide) do
local frame = getglobal(frameName)
FluidFrames.LockHiddenFrame(frame)
end
end
 
function FluidFrames.InitTempDraggableFrames()
-- Make UIPanels temporarily draggable (position not saved)
for frameName,info in pairs(UIPanelWindows) do
local frame = getglobal(frameName)
if (frame and frame.GetTitleRegion) then
local titleRegion = frame:GetTitleRegion()
if (not titleRegion) then
titleRegion = frame:CreateTitleRegion()
end
--titleRegion:SetAllPoints(frame)
frame:EnableMouse(1)
end
end
 
for frameName,info in pairs(UIChildWindows) do
local frame = getglobal(frameName)
if (frame and frame.GetTitleRegion) then
local titleRegion = frame:GetTitleRegion()
if (not titleRegion) then
titleRegion = frame:CreateTitleRegion()
end
--titleRegion:SetAllPoints(frame)
frame:EnableMouse(1)
end
end
 
-- Disable the mouse on a few child frames so that the parent is draggable
for i,frameName in ipairs(FluidFrames.FramesToDragByParent) do
local frame = getglobal(frameName)
if (frame) then
frame:EnableMouse(nil)
end
end
 
--Exceptions
if (not MinimapCluster:GetTitleRegion()) then
MinimapCluster:SetScript("OnEnter", function()
local tempthis = this
this = MinimapZoneTextButton
MinimapZoneTextButton:GetScript("OnEnter")(MinimapZoneTextButton)
this = tempthis
end)
MinimapCluster:SetScript("OnLeave", function()
local tempthis = this
this = MinimapZoneTextButton
MinimapZoneTextButton:GetScript("OnLeave")(MinimapZoneTextButton)
this = tempthis
end)
MinimapCluster:CreateTitleRegion():SetAllPoints(MinimapCluster)
MinimapZoneTextButton:EnableMouse(nil)
end
 
-- Update Enabled (mostly for LoD)
if (FluidFrames_SavedVars) then
FluidFrames.ToggleTempDraggableFrames(FluidFrames_SavedVars.TempDraggable == "1")
end
end
 
function FluidFrames.ToggleTempDraggableFrames(value)
for frameName,info in pairs(UIPanelWindows) do
local frame = getglobal(frameName)
if (frame and frame.GetTitleRegion) then
local titleRegion = frame:GetTitleRegion()
if (titleRegion) then
if (value) then
titleRegion:SetAllPoints(frame)
else
titleRegion:ClearAllPoints()
titleRegion:SetHeight(0)
titleRegion:SetWidth(0)
end
end
end
end
 
for frameName,info in pairs(UIChildWindows) do
local frame = getglobal(frameName)
if (frame and frame.GetTitleRegion) then
local titleRegion = frame:GetTitleRegion()
if (titleRegion) then
if (value) then
titleRegion:SetAllPoints(frame)
else
titleRegion:ClearAllPoints()
titleRegion:SetHeight(0)
titleRegion:SetWidth(0)
end
end
end
end
 
--Exceptions
local titleRegion = MinimapCluster:GetTitleRegion()
if (titleRegion) then
if (value) then
titleRegion:SetAllPoints(MinimapCluster)
else
titleRegion:ClearAllPoints()
titleRegion:SetHeight(0)
titleRegion:SetWidth(0)
end
end
 
if (value and AchievementFrame) then
AchievementFrameHeader:EnableMouse(false)
end
end
 
function FluidFrames.OnEvent(self, event, arg1)
if (event == "ADDON_LOADED") then
-- Catch Load on Demand Addon frames
-- Use OnUpdate to load after their LoadWith's
self.nextFrameInit = true
 
elseif (event == "VARIABLES_LOADED") then
FluidFrames.InitTempDraggableFrames()
if (Portfolio) then
FluidFrames.RegisterPortfolio()
end
self:RegisterEvent("PLAYER_ENTERING_WORLD")
 
elseif (event == "PLAYER_ENTERING_WORLD") then
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("QUEST_LOG_UPDATE")
self:RegisterEvent("PLAYER_REGEN_ENABLED")
self:RegisterEvent("ADDON_LOADED")
 
if (not FluidFramesModifiedFrames) then
FluidFramesModifiedFrames = {}
else
FluidFrames.InitMovedFrames(FluidFramesModifiedFrames)
hooksecurefunc("CreateFrame", FluidFrames.CreateFrameHook)
end
--FluidFrames.InitTempDraggableFrames()
 
-- QUEST_LOG_UPDATE should fire when you log in or reloadui, regardless of whether you have any quests
--This makes sure QuestWatchFrame has been resized
elseif (event == "QUEST_LOG_UPDATE") then
self:UnregisterEvent("QUEST_LOG_UPDATE")
FluidFrames.InitMovedFrames(FluidFrames.UninitializedFrames)
 
elseif (event == "PLAYER_REGEN_ENABLED") then
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
FluidFrames.InitMovedFrames(FluidFrames.UninitializedFrames)
 
end
end
 
function FluidFrames.CreateFrameHook(frameType, frameName, parent)
if (frameName and FluidFrames.UninitializedFrames[frameName]) then
FluidFrames.EventFrame.nextFrameInit = true
end
end
 
function FluidFrames.EventOnUpdate(self, delay)
if (self.nextFrameInit) then
FluidFrames.InitMovedFrames(FluidFrames.UninitializedFrames)
FluidFrames.InitTempDraggableFrames()
self.nextFrameInit = false
end
end
 
function FluidFrames.OnUpdate(self, delay)
if (self.frame and (self.isResizing or self.isMoving or self.isRescaling)) then
if (not this.count) then
self.count = delay
elseif (this.count < .02) then
self.count = self.count + delay
 
elseif (this.isRescaling) then
this.count = 0
local frame = self.frame
 
local x, y = GetCursorPosition()
local UIScale = UIParent:GetEffectiveScale()
local currScale = self:GetEffectiveScale()
x = x / currScale - 10 / currScale
y = y / currScale + 10 / currScale
local left = self:GetLeft()
local top = self:GetTop()
local wScale = (x-left)/self:GetWidth()
local hScale = (top-y)/self:GetHeight()
local scale = max(min(max(wScale, hScale), 1.2), 0.8)
 
if (scale < 1 and currScale < 0.1) then
return
end
 
FluidFrames.RelativelyScaleFrame(this, scale)
FluidFrames.RelativelyScaleFrame(frame, scale)
 
local xOffset = left/scale
local yOffset = top/scale - this:GetHeight()
 
frame:SetUserPlaced(nil)
frame:ClearAllPoints()
frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", xOffset, yOffset)
frame:SetUserPlaced(1)
 
self:ClearAllPoints()
self:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", xOffset, yOffset)
 
else
self.count = 0
local frame = self.frame
 
if (this.isResizing) then
local wScale = self:GetWidth()/frame:GetWidth()
if (frame.MFwScale) then
frame.MFwScale = frame.MFwScale * wScale
else
frame.MFwScale = wScale
end
local hScale = self:GetHeight()/frame:GetHeight()
if (frame.MFhScale) then
frame.MFhScale = frame.MFhScale * hScale
else
frame.MFhScale = hScale
end
 
FluidFrames.RescaleFrame(frame, wScale, hScale, not IsAltKeyDown())
end
 
frame:SetUserPlaced(nil)
frame:ClearAllPoints()
frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", self:GetLeft(), self:GetBottom())
frame:SetUserPlaced(1)
 
end
end
end
 
function FluidFrames.InitEventFrame()
if (FluidFrames.EventFrame) then
return
end
local eventFrame = CreateFrame("Frame", "FluidEventFrame", UIParent)
eventFrame:RegisterEvent("VARIABLES_LOADED")
eventFrame:SetScript("OnEvent", FluidFrames.OnEvent)
eventFrame:SetScript("OnUpdate", FluidFrames.EventOnUpdate)
FluidFrames.EventFrame = eventFrame
end
 
function FluidFrames.InitDraggableFrame()
if (FluidFrames.DragFrame) then
return
end
 
local dragFrame = CreateFrame("Frame", "FluidFrame", UIParent)
dragFrame:Hide()
dragFrame:SetToplevel(1)
dragFrame:SetFrameStrata("TOOLTIP")
dragFrame:SetResizable(1)
dragFrame:SetMovable(1)
dragFrame:EnableMouse("LeftButton")
dragFrame:SetAlpha(0.25)
 
dragFrame:SetScript("OnMouseDown", FluidFrames.StartMoving)
dragFrame:SetScript("OnMouseUp", FluidFrames.StopDragFrameMovingOrSizing)
dragFrame:SetScript("OnUpdate", FluidFrames.OnUpdate)
 
local minsize = 10
 
FluidFrames.DragFrame = dragFrame
 
--dragFrame:CreateTitleRegion():SetAllPoints(dragFrame)
--Frame:GetTitleRegion()
 
local red = 0
local green = 0.2
local blue = 0.7
-- Don't make bigger than the UIParent?
dragFrame:SetMinResize(minsize, minsize)
--dragFrame:SetMaxResize()
 
local background = dragFrame:CreateTexture("FluidFrameBackground", "BACKGROUND")
background:SetTexture("Interface\\ChatFrame\\ChatFrameBackground")
background:SetVertexColor(red, green, blue)
background:SetPoint("TOP", 0, -2)
background:SetPoint("BOTTOM", 0, 1)
background:SetPoint("LEFT", 1, 0)
background:SetPoint("RIGHT", -1, 0)
 
local ResizeTopLeft = CreateFrame("Button", "FluidFrameResizeTopLeft", dragFrame)
--ResizeTopLeft:SetFrameLevel(ResizeTopLeft:GetFrameLevel()-1)
ResizeTopLeft:SetHeight(16)
ResizeTopLeft:SetWidth(16)
ResizeTopLeft:SetPoint("TOPLEFT", -2, 2)
local rtlTexture = ResizeTopLeft:CreateTexture("FluidFramertlTexture", "BACKGROUND")
rtlTexture:SetVertexColor(red, green, blue)
rtlTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rtlTexture:SetAllPoints(ResizeTopLeft) --TOPLEFT 16/16?
rtlTexture:SetTexCoord(0, 0.25, 0, 0.125)
ResizeTopLeft:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "TOPLEFT") end)
ResizeTopLeft:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeTopLeft:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rtlTexture) end)
ResizeTopLeft:SetScript("OnLeave", function() rtlTexture:SetVertexColor(red, green, blue) end)
 
local ResizeTopRight = CreateFrame("Button", "FluidFrameResizeTopRight", dragFrame)
--ResizeTopRight:SetFrameLevel(ResizeTopRight:GetFrameLevel()-1)
ResizeTopRight:SetHeight(16)
ResizeTopRight:SetWidth(16)
ResizeTopRight:SetPoint("TOPRIGHT", 2, 2)
local rtrTexture = ResizeTopRight:CreateTexture("FluidFramertrTexture", "BACKGROUND")
rtrTexture:SetVertexColor(red, green, blue)
rtrTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rtrTexture:SetAllPoints(ResizeTopRight) --TOPRIGHT 16/16?
rtrTexture:SetTexCoord(0.75, 1.0, 0, 0.125)
ResizeTopRight:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "TOPRIGHT") end)
ResizeTopRight:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeTopRight:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rtrTexture) end)
ResizeTopRight:SetScript("OnLeave", function() rtrTexture:SetVertexColor(red, green, blue) end)
 
local ResizeBottomLeft = CreateFrame("Button", "FluidFrameResizeBottomLeft", dragFrame)
--ResizeBottomLeft:SetFrameLevel(ResizeBottomLeft:GetFrameLevel()-1)
ResizeBottomLeft:SetHeight(16)
ResizeBottomLeft:SetWidth(16)
ResizeBottomLeft:SetPoint("BOTTOMLEFT", -2, -3)
local rblTexture = ResizeBottomLeft:CreateTexture("FluidFramerblTexture", "BACKGROUND")
rblTexture:SetVertexColor(red, green, blue)
rblTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rblTexture:SetAllPoints(ResizeBottomLeft) --TOPLEFT 16/16?
rblTexture:SetTexCoord(0, 0.25, 0.7265625, 0.8515625)
ResizeBottomLeft:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "BOTTOMLEFT") end)
ResizeBottomLeft:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeBottomLeft:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rblTexture) end)
ResizeBottomLeft:SetScript("OnLeave", function() rblTexture:SetVertexColor(red, green, blue) end)
 
local ResizeBottomRight = CreateFrame("Button", "FluidFrameResizeBottomRight", dragFrame)
--ResizeBottomRight:SetFrameLevel(ResizeBottomRight:GetFrameLevel()-1)
ResizeBottomRight:SetHeight(16)
ResizeBottomRight:SetWidth(16)
ResizeBottomRight:SetPoint("BOTTOMRIGHT", 2, -3)
local rbrTexture = ResizeBottomRight:CreateTexture("FluidFramerbrTexture", "BACKGROUND")
rbrTexture:SetVertexColor(red, green, blue)
rbrTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rbrTexture:SetAllPoints(ResizeBottomRight) --BOTTOMRIGHT 16/16?
rbrTexture:SetTexCoord(0.75, 1.0, 0.7265625, 0.8515625)
ResizeBottomRight:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "BOTTOMRIGHT") end)
ResizeBottomRight:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeBottomRight:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rbrTexture) end)
ResizeBottomRight:SetScript("OnLeave", function() rbrTexture:SetVertexColor(red, green, blue) end)
 
local ResizeTop = CreateFrame("Button", "FluidFrameResizeTop", dragFrame)
--ResizeTop:SetFrameLevel(ResizeTop:GetFrameLevel()-1)
ResizeTop:SetHeight(16)
ResizeTop:SetWidth(16)
ResizeTop:SetPoint("LEFT", ResizeTopLeft, "RIGHT", 0, 0)
ResizeTop:SetPoint("RIGHT", ResizeTopRight, "LEFT", 0, 0)
local rtTexture = ResizeTop:CreateTexture("FluidFramertTexture", "BACKGROUND")
rtTexture:SetVertexColor(red, green, blue)
rtTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rtTexture:SetAllPoints(ResizeTop)
rtTexture:SetTexCoord(0.25, 0.75, 0, 0.125)
ResizeTop:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "TOP") end)
ResizeTop:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeTop:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rtTexture) end)
ResizeTop:SetScript("OnLeave", function() rtTexture:SetVertexColor(red, green, blue) end)
 
local ResizeBottom = CreateFrame("Button", "FluidFrameResizeBottom", dragFrame)
--ResizeBottom:SetFrameLevel(ResizeBottom:GetFrameLevel()-1)
ResizeBottom:SetHeight(16)
ResizeBottom:SetWidth(16)
ResizeBottom:SetPoint("LEFT", ResizeBottomLeft, "RIGHT", 0, 0)
ResizeBottom:SetPoint("RIGHT", ResizeBottomRight, "LEFT", 0, 0)
local rbTexture = ResizeBottom:CreateTexture("FluidFramerbTexture", "BACKGROUND")
rbTexture:SetVertexColor(red, green, blue)
rbTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rbTexture:SetAllPoints(ResizeBottom) --TOPLEFT 16/16?
rbTexture:SetTexCoord(0.25, 0.75, 0.7265625, 0.8515625)
ResizeBottom:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "BOTTOM") end)
ResizeBottom:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeBottom:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rbTexture) end)
ResizeBottom:SetScript("OnLeave", function() rbTexture:SetVertexColor(red, green, blue) end)
 
local ResizeLeft = CreateFrame("Button", "FluidFrameResizeLeft", dragFrame)
--ResizeLeft:SetFrameLevel(ResizeLeft:GetFrameLevel()-1)
ResizeLeft:SetHeight(16)
ResizeLeft:SetWidth(16)
ResizeLeft:SetPoint("TOP", ResizeTopLeft, "BOTTOM", 0, 0)
ResizeLeft:SetPoint("BOTTOM", ResizeBottomLeft, "TOP", 0, 0)
local rbTexture = ResizeLeft:CreateTexture("FluidFramerbTexture", "BACKGROUND")
rbTexture:SetVertexColor(red, green, blue)
rbTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rbTexture:SetAllPoints(ResizeLeft)
rbTexture:SetTexCoord(0, 0.25, 0.125, 0.7265625)
ResizeLeft:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "LEFT") end)
ResizeLeft:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeLeft:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rbTexture) end)
ResizeLeft:SetScript("OnLeave", function() rbTexture:SetVertexColor(red, green, blue) end)
 
local ResizeRight = CreateFrame("Button", "FluidFrameResizeRight", dragFrame)
--ResizeRight:SetFrameLevel(ResizeRight:GetFrameLevel()-1)
ResizeRight:SetHeight(16)
ResizeRight:SetWidth(16)
ResizeRight:SetPoint("TOP", ResizeTopRight, "BOTTOM", 0, 0)
ResizeRight:SetPoint("BOTTOM", ResizeBottomRight, "TOP", 0, 0)
local rrTexture = ResizeRight:CreateTexture("FluidFramerrTexture", "BACKGROUND")
rrTexture:SetVertexColor(red, green, blue)
rrTexture:SetTexture("Interface\\ChatFrame\\ChatFrameBorder")
rrTexture:SetAllPoints(ResizeRight)
rrTexture:SetTexCoord(0.75, 1.0, 0.125, 0.7265625)
ResizeRight:SetScript("OnMouseDown", function(self, button) FluidFrames.StartParentResizing(self, button, "RIGHT") end)
ResizeRight:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
ResizeRight:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(rrTexture) end)
ResizeRight:SetScript("OnLeave", function() rrTexture:SetVertexColor(red, green, blue) end)
 
local Scale = CreateFrame("Button", "FluidFrameRescale", dragFrame)
Scale:SetFrameLevel(Scale:GetFrameLevel()+1)
Scale:SetHeight(20)
Scale:SetWidth(20)
Scale:SetPoint("BOTTOMRIGHT", 20, -20)
local sTexture = Scale:CreateTexture("FluidFrameRescaleTexture", "BACKGROUND")
sTexture:SetVertexColor(red, green, blue)
sTexture:SetTexture("Interface\\AddOns\\FluidFrames\\Skin\\Rescale")
sTexture:SetAllPoints(Scale)
Scale:SetScript("OnMouseDown", FluidFrames.StartParentRescaling)
Scale:SetScript("OnMouseUp", FluidFrames.StopParentMovingOrSizing)
Scale:SetScript("OnEnter", function() FluidFrames.SetColorHighlight(sTexture) end)
Scale:SetScript("OnLeave", function() sTexture:SetVertexColor(red, green, blue) end)
 
local HideButton = CreateFrame("Button", "FluidFrameHideButton", dragFrame, "UIPanelButtonTemplate2")
HideButton:SetText(HIDE)
HideButton:SetPoint("BOTTOM", dragFrame, "TOP", 10, 0)
HideButton:SetScript("OnClick", FluidFrames.HideButton_OnClick)
HideButton:SetClampedToScreen(1)
end
 
function FluidFrames.SetColorHighlight(frame)
if (IsShiftKeyDown()) then
frame:SetVertexColor(1, 0.82, 0)
end
end
 
function FluidFrames.HideButton_OnClick(self)
if (FluidFrames.DragFrame.frame.FFHidden) then
FluidFrames.UnlockHiddenFrame(FluidFrames.DragFrame.frame)
self:SetText(HIDE)
else
FluidFrames.StoreFrameDefault(FluidFrames.DragFrame.frame)
FluidFrames.LockHiddenFrame(FluidFrames.DragFrame.frame)
self:SetText(SHOW)
end
end
 
function FluidFrames.StartParentResizing(self, button, anchorPoint)
local frame = self:GetParent()
if (frame.isLocked) then
return
end
if (frame:IsProtected() and InCombatLockdown()) then
Print(format(FLUIDFRAMES_CANT_RESIZE_IN_COMBAT, frame:GetName()))
return
elseif (button == "RightButton") then
FluidFrames.ResetFrame(frame.frame)
elseif (IsShiftKeyDown()) then
FluidFrames.StoreFrameDefault(frame.frame, true, true)
FluidFrames.Mobilize(frame.frame)
FluidFrames.FreeFrameFromParent(frame.frame)
frame.isResizing = true
frame:StartSizing(anchorPoint)
else
FluidFrames.StoreFrameDefault(frame.frame)
FluidFrames.Mobilize(frame.frame)
FluidFrames.FreeFrameFromParent(frame.frame)
frame:StartMoving()
frame.isMoving = true
end
end
 
function FluidFrames.StartMoving(self, button)
if (self.frame:IsProtected() and InCombatLockdown()) then
Print(format(FLUIDFRAMES_CANT_MOVE_IN_COMBAT, self.frame:GetName()))
return
elseif (button == "RightButton") then
FluidFrames.ResetFrame(self.frame)
elseif (not self.isLocked) then
FluidFrames.StoreFrameDefault(self.frame)
FluidFrames.Mobilize(self.frame)
FluidFrames.FreeFrameFromParent(self.frame)
self:StartMoving()
self.isMoving = true
end
end
 
function FluidFrames.StartParentRescaling(self, button)
local frame = self:GetParent()
if (frame:IsProtected() and InCombatLockdown()) then
Print(format(FLUIDFRAMES_CANT_RESCALE_IN_COMBAT, frame:GetName()))
return
elseif (button == "RightButton") then
FluidFrames.ResetFrame(frame.frame)
elseif (IsShiftKeyDown()) then
if (not frame.isLocked) then
FluidFrames.StoreFrameDefault(frame.frame, true)
FluidFrames.Mobilize(frame.frame)
FluidFrames.FreeFrameFromParent(frame.frame)
frame.isRescaling = true
end
else
FluidFrames.StoreFrameDefault(frame.frame)
FluidFrames.Mobilize(frame.frame)
FluidFrames.FreeFrameFromParent(frame.frame)
frame:StartMoving()
frame.isMoving = true
end
end
 
function FluidFrames.StopParentMovingOrSizing(self)
if (button ~= "RightButton") then
local frame = self:GetParent()
frame:StopMovingOrSizing()
if (frame.isRescaling or frame.isResizing or frame.isMoving) then
local storeScale = frame.isRescaling or frame.isResizing
local storeDimentions = frame.isResizing
frame.isMoving = nil
frame.isResizing = nil
frame.isRescaling = nil
FluidFrames.ImmobilizeAndStoreDimentions(frame.frame, storeScale, storeDimentions)
end
end
end
 
function FluidFrames.StopDragFrameMovingOrSizing(self)
if (button ~= "RightButton") then
self:StopMovingOrSizing()
local storeScale = self.isRescaling or self.isResizing
local storeDimentions = self.isResizing
self.isMoving = nil
self.isResizing = nil
self.isRescaling = nil
FluidFrames.ImmobilizeAndStoreDimentions(self.frame, storeScale, storeDimentions)
end
end
 
--/z FluidFrames.StartFrameResize(FriendsFrame)
function FluidFrames.StartFrameResize(frame)
if (not frame) then
return
elseif (frame:IsProtected() and InCombatLockdown()) then
Print(format(FLUIDFRAMES_CANT_RESIZE_IN_COMBAT, frame:GetName()))
return
end
FluidFrames.InitDraggableFrame()
local dragFrame = FluidFrames.DragFrame
 
Print(format(FLUIDFRAMES_START_RESIZE, OrNil(frame:GetName())))
 
dragFrame:SetWidth(frame:GetWidth())
dragFrame:SetHeight(frame:GetHeight())
local left = frame:GetLeft()
local bottom = frame:GetBottom()
dragFrame:ClearAllPoints()
dragFrame:SetPoint("BOTTOMLEFT", left, bottom)
frame:SetUserPlaced(nil)
frame:ClearAllPoints()
frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", left, bottom)
frame:SetUserPlaced(1)
dragFrame.frame = frame
dragFrame:Show()
end
 
function FluidFrames.EndResizeFrame(frame)
if (not frame) then
return
end
local dragFrame = FluidFrames.DragFrame
 
Print(format(FLUIDFRAMES_STOP_RESIZE, OrNil(frame:GetName())))
 
dragFrame.frame = nil
dragFrame:Hide()
end
 
function FluidFrames.RescaleChildren(widthScale, heightScale, resizeFontStrings, ...)
for i=1, select("#", ...) do
local child = select(i, ...)
if (child) then
if (child:IsObjectType("FontString")) then
local fontName, fontHeight, fontFlags = child:GetFont()
if (fontName and fontHeight > 0 and heightScale ~= child:GetParent():GetScale()) then
child:SetFont(fontName, fontHeight*heightScale, fontFlags)
--Print("Resizing FontString: "..(child:GetName() or "<Unnamed>").." Scale: "..FluidFrames.Round(heightScale, 100).." FontSize: "..FluidFrames.Round(fontHeight*heightScale, 100))
end
if ( resizeFontStrings and child:GetStringWidth() > 0 and not FluidFrames.Compare(child:GetStringWidth(), child:GetWidth()) ) then
--Use height for now, untill there's a way to check if the FontString has been absoolutely sized or not
if (child.GetName and child:GetName()) then
--Print(child:GetName()..": resizeFontStrings - "..floor(child:GetStringWidth()).." "..floor(child:GetWidth()).." "..floor(child:GetHeight()).." "..FluidFrames.Round(heightScale, 100))
child:SetWidth(child:GetWidth()*heightScale)
child:SetHeight(child:GetHeight()*heightScale)
--Print("SetWidth: "..FluidFrames.Round(child:GetWidth()*heightScale, 100).." SetHeight: "..FluidFrames.Round(child:GetHeight()*heightScale, 100))
end
end
else
child:SetWidth(child:GetWidth()*widthScale)
child:SetHeight(child:GetHeight()*heightScale)
end
if (child.GetChildren) then
FluidFrames.RescaleChildren(widthScale, heightScale, resizeFontStrings, child:GetChildren())
end
if (child.GetRegions) then
FluidFrames.RescaleChildren(widthScale, heightScale, resizeFontStrings, child:GetRegions())
end
 
if (child.GetNumPoints) then
for p=1, child:GetNumPoints() do
local point, relativeTo, relativePoint, xOffset, yOffset = child:GetPoint(p)
child:SetPoint(point, relativeTo, relativePoint, xOffset*widthScale, yOffset*heightScale)
end
end
end
end
end
 
--/z FluidFrames.RescaleFrame(ShapeshiftBarFrame, 1.5, 1)
--/z FluidFrames.RescaleFrame(PlayerFrame, 1.5, 1)
function FluidFrames.RescaleFrame(frame, widthScale, heightScale, resizeFontStrings)
if (not frame) then
return
elseif (frame:IsProtected() and InCombatLockdown()) then
return
end
 
frame:SetWidth(frame:GetWidth()*widthScale)
frame:SetHeight(frame:GetHeight()*heightScale)
 
if (frame.GetChildren) then
FluidFrames.RescaleChildren(widthScale, heightScale, resizeFontStrings, frame:GetChildren())
end
if (frame.GetRegions) then
FluidFrames.RescaleChildren(widthScale, heightScale, resizeFontStrings, frame:GetRegions())
end
end
 
function FluidFrames.RelativelyScaleFrame(frame, scale)
if (not frame) then
return
end
frame:SetScale(frame:GetScale()*scale)
end
 
----------------------------
-- Frame Stack Code
----------------------------
 
FluidFrames.FrameStack = {}
FluidFrames.ExcludedFrames = {
WorldFrame = true,
UIParent = true,
 
MainMenuBarArtFrame = true,
MainMenuBarOverlayFrame = true,
TargetFrameTextureFrame = true,
LFGWizardFrame = true,
FriendsListFrame = true,
}
for i=1, NUM_CONTAINER_FRAMES do
FluidFrames.ExcludedFrames["ContainerFrame"..i] = true
end
 
function FluidFrames.IsChildFrame(frame, child)
if (not frame or not child) then
return
end
while (child ~= frame) do
child = child:GetParent()
if (not child) then
return false
end
end
return true
end
 
function FluidFrames.BuildCursorFrameStack()
local stack = FluidFrames.FrameStack
 
--Empty Stack
local stackSize = #stack
while (stackSize > 0) do
tremove(stack, #stack)
stackSize = #stack
end
 
local frame = EnumerateFrames()
while (frame) do
local frameName = frame.GetName and frame:GetName()
if (frame:IsVisible()
and (not frameName or not FluidFrames.ExcludedFrames[frameName])
and MouseIsOver(frame)
and not FluidFrames.IsChildFrame(FluidFrames.DragFrame, frame)
) then
tinsert(stack, frame)
end
frame = EnumerateFrames(frame)
end
end
 
function FluidFrames.GetNextStackFrame(frame, showAll)
local stack = FluidFrames.FrameStack
 
local returnNext
 
if (not frame) then
if (#stack > 0) then
returnNext = true
else
return
end
end
 
for i, sFrame in ipairs(stack) do
if (showAll or sFrame:GetName()) then
if (returnNext) then
return sFrame
elseif (frame == sFrame) then
returnNext = true
end
end
end
end
 
 
function FluidFrames.GetPreviousStackFrame(frame)
local stack = FluidFrames.FrameStack
 
if (not frame) then
if (#stack > 0) then
return stack[#stack]
else
return
end
end
 
local prevFrame
for i, sFrame in ipairs(stack) do
if (frame == sFrame) then
return prevFrame
end
prevFrame = sFrame
end
end
 
----------------------------
-- Highlight a Frame
----------------------------
 
function FluidFrames.HighlightMouseFrame(showAll)
 
local dragFrame = FluidFrames.DragFrame
 
if (dragFrame.isResizing) then
dragFrame:StopMovingOrSizing()
dragFrame.isResizing = nil
end
 
FluidFrames.BuildCursorFrameStack()
 
local newFrame
if (not dragFrame:IsVisible()) then
if (IsShiftKeyDown()) then
newFrame = FluidFrames.GetPreviousStackFrame()
else
newFrame = FluidFrames.GetNextStackFrame()
end
else
if (#FluidFrames.FrameStack > 0) then
if (IsShiftKeyDown()) then
newFrame = FluidFrames.GetPreviousStackFrame(dragFrame.frame)
else
newFrame = FluidFrames.GetNextStackFrame(dragFrame.frame)
end
if (not newFrame) then
dragFrame.frame = nil
dragFrame:Hide()
return
end
end
end
 
if (not newFrame) then
Print(FLUIDFRAMES_NO_MOVABLE_FRAMES)
dragFrame.frame = nil
dragFrame:Hide()
return
end
 
 
local parent = newFrame:GetParent()
Print(format(FLUIDFRAMES_HIGHLIGHT, OrNil(newFrame:GetName()), OrNil(parent and parent:GetName())))
 
dragFrame:SetWidth(newFrame:GetWidth())
dragFrame:SetHeight(newFrame:GetHeight())
local scale = newFrame:GetEffectiveScale()/UIParent:GetEffectiveScale()
dragFrame:SetScale(scale)
local left = newFrame:GetLeft()
local bottom = newFrame:GetBottom()
dragFrame:ClearAllPoints()
dragFrame:SetPoint("BOTTOMLEFT", left, bottom)
 
newFrame:SetMovable(1)
 
if (parent == UIParent or parent == nil) then
--[[
newFrame:SetUserPlaced(nil)
newFrame:ClearAllPoints()
newFrame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", left, bottom)
newFrame:SetUserPlaced(1)
]]--
end
 
dragFrame.frame = newFrame
dragFrame:Show()
end
 
----------------------------
-- Immobilization Code
----------------------------
 
function FluidFrames.SetPointHook(self, ...)
if (self.FFImmobilized) then
DebugPrint(format("%s:SetPoint intercepted - Immobilized.", self:GetName()))
local data = FluidFramesModifiedFrames[self:GetName()]
if (data and data.immobilized) then
if (self:IsProtected() and InCombatLockdown()) then
DebugPrint(format("%s:SetPoint intercepted - Can't move in combat.", self:GetName()))
else
self.FFImmobilized = nil
self:ClearAllPoints()
self:SetPoint(unpack(data.immobilized.point))
self.FFImmobilized = true
DebugPrint(format("%s:SetPoint intercepted - Moved to saved location.", self:GetName()))
end
end
else
DebugPrint(format("%s:SetPoint intercepted - Mobile: %s.", self:GetName(), (this and this.GetName and this:GetName() or "Unknown")))
end
end
 
function FluidFrames.SetWidthHook(self, width)
if (self.FFImmobilized) then
DebugPrint(format("%s:SetWidth intercepted - %s.", self:GetName(), width))
-- Allow SetWidth when immobilized, update saved data
local data = FluidFramesModifiedFrames[self:GetName()]
if (data and data.immobilized and data.immobilized.width and data.width) then
-- Update Reset Width by scaling by difference between the previous immobilized width and the new width
data.width = data.width * (width / data.immobilized.width)
-- Update Immobilized Width
data.immobilized.width = width
end
end
end
 
function FluidFrames.SetHeightHook(self, height)
if (self.FFImmobilized) then
DebugPrint(format("%s:SetHeight intercepted - %s.", self:GetName(), height))
-- Allow SetHeight when immobilized, update saved data
local data = FluidFramesModifiedFrames[self:GetName()]
if (data and data.immobilized and data.immobilized.height and data.height) then
-- Update Reset Height by scaling by difference between the previous immobilized height and the new height
data.height = data.height * (height / data.immobilized.height)
-- Update Immobilized Height
data.immobilized.height = height
--[[ Update position (since it's will be set from the bottom left)
self.FFImmobilized = nil
self:ClearAllPoints()
self:SetPoint(unpack(data.immobilized.point))
self.FFImmobilized = true
]]--
end
end
end
 
 
function FluidFrames.Immobilize(frame)
if (frame.GetName and frame:GetName()) then
if (not frame.FFSetXHooked) then
hooksecurefunc(frame, "SetPoint", FluidFrames.SetPointHook)
hooksecurefunc(frame, "SetWidth", FluidFrames.SetWidthHook)
hooksecurefunc(frame, "SetHeight", FluidFrames.SetHeightHook)
frame.FFSetXHooked = true
end
-- Should be just a single point relative to UIParent. Maybe store in SV? Set relativeTo = "UIParent"?
local data = FluidFramesModifiedFrames[frame:GetName()]
if (data) then
local point = { frame:GetPoint(1) }
if (point[2] == UIParent) then
point[2] = "UIParent"
frame.FFImmobilized = true
 
if (not data.immobilized) then
data.immobilized = {}
end
data.immobilized.point = point
else
if (data.immobilized) then
if (not data.immobilized.scale) then
data.immobilized = nil
else
data.immobilized.point = nil
end
end
frame.FFImmobilized = nil
Print(format(FLUIDFRAMES_CANT_IMMOBILIZE_NOT_UIPARENT, frame:GetName()))
end
else
Print(format(FLUIDFRAMES_CANT_IMMOBILIZE_NO_DEFAULT, frame:GetName()))
end
else
Print(FLUIDFRAMES_CANT_IMMOBILIZE_UNNAMED)
end
end
 
function FluidFrames.ImmobilizeAndStoreDimentions(frame, storeScale, storeDimentions)
if (frame.GetName and frame:GetName()) then
if (not frame.FFSetXHooked) then
hooksecurefunc(frame, "SetPoint", FluidFrames.SetPointHook)
hooksecurefunc(frame, "SetWidth", FluidFrames.SetWidthHook)
hooksecurefunc(frame, "SetHeight", FluidFrames.SetHeightHook)
frame.FFSetXHooked = true
end
-- Should be just a single point relative to UIParent. Maybe store in SV? Set relativeTo = "UIParent"?
local data = FluidFramesModifiedFrames[frame:GetName()]
if (data) then
local point = { frame:GetPoint(1) }
if (point[2] == UIParent) then
point[2] = "UIParent"
frame.FFImmobilized = true
 
if (not data.immobilized) then
data.immobilized = {}
end
data.immobilized.point = point
if (storeScale) then
data.immobilized.scale = frame:GetScale()
end
if (storeDimentions) then
data.immobilized.height = frame:GetHeight()
data.immobilized.width = frame:GetWidth()
end
else
data.immobilized = nil
frame.FFImmobilized = nil
Print(format(FLUIDFRAMES_CANT_IMMOBILIZE_NOT_UIPARENT, frame:GetName()))
end
else
Print(format(FLUIDFRAMES_CANT_IMMOBILIZE_NO_DEFAULT, frame:GetName()))
end
else
Print(FLUIDFRAMES_CANT_IMMOBILIZE_UNNAMED)
end
end
 
function FluidFrames.Mobilize(frame)
frame.FFImmobilized = nil
if (frame.GetName and frame:GetName()) then
local data = FluidFramesModifiedFrames[frame:GetName()]
if (data and data.immobilized) then
data.immobilized.point = nil
--data.immobilized = nil
end
end
end
 
 
----------------------------
-- Accociative Reparent Code (Fixes things like dragging ActionBar1
----------------------------
 
function FluidFrames.FreeFrameSiblingsFromParent(frame, oldParent, newParent, reShow, ...)
for i=1, select("#", ...) do
local sibling = select(i, ...)
if (sibling and sibling:GetParent() == oldParent) then
if (sibling:GetNumPoints() == 1) then
local pdata = { sibling:GetPoint(1) }
if (pdata[2] == frame) then
if (sibling.GetName) then
DebugPrint(format(FLUIDFRAMES_REPARENTING_SIBLING, sibling:GetName(), OrNil(oldParent:GetName()), OrNil(newParent:GetName())))
end
sibling:SetParent(newParent)
--if (reShow and sibling:IsShown()) then
-- sibling:Show()
--end
FluidFrames.FreeFrameSiblingsFromParent(sibling, oldParent, newParent, reShow, ...)
FluidFrames.FreeFrameSiblingsFromParent(sibling, oldParent, newParent, reShow, ...)
end
end
end
end
end
--/z FluidFrames.FreeFrameSiblingsFromParent(ActionButton1, MainMenuBarArtFrame, UIParent, MainMenuBarArtFrame:GetChildren())
--/z FluidFrames.FreeFrameSiblingsFromParent(CharacterMicroButton, MainMenuBarArtFrame, UIParent, MainMenuBarArtFrame:GetChildren())
 
--[[
function FluidFrames.HasHiddenAncestorFrame(frame)
local parent = frame:GetParent()
if (not parent or FluidFrames.ExcludedFrames[parent]) then
return false
elseif (parent.FFHidden) then
return true
else
return FluidFrames.HasHiddenAncestorFrame(parent)
end
end
]]--
 
function FluidFrames.ReparentAssociatedFrames(frame, oldParent, newParent)
if (oldParent and oldParent ~= newParent) then
frame:SetParent(newParent)
--local reShow = FluidFrames.HasHiddenAncestorFrame(oldParent)
--if (reShow and frame:IsShown()) then
-- frame:Show()
--end
DebugPrint(format(FLUIDFRAMES_REPARENTING, frame:GetName(), OrNil(oldParent:GetName()), OrNil(newParent:GetName())))
FluidFrames.FreeFrameSiblingsFromParent(frame, oldParent, newParent, reShow, oldParent:GetChildren())
FluidFrames.FreeFrameSiblingsFromParent(frame, oldParent, newParent, reShow, oldParent:GetRegions())
end
end
 
function FluidFrames.FreeFrameFromParent(frame)
local oldParent = frame:GetParent()
if (oldParent) then
local newParent = getglobal(FluidFrames.NEW_PARENT)
FluidFrames.ReparentAssociatedFrames(frame, oldParent, newParent)
end
end
 
function FluidFrames.ResetFrameParent(frame, origParent)
--local parent = getglobal(FluidFrames.NEW_PARENT)
local parent = frame:GetParent()
FluidFrames.ReparentAssociatedFrames(frame, parent, origParent)
end
 
----------------------------
-- Hide Code
----------------------------
 
function FluidFrames.ShowHook(self)
if (self.FFHidden) then
self:Hide()
end
end
 
--/z FluidFrames.LockHiddenFrame(MainMenuBar)
function FluidFrames.LockHiddenFrame(frame)
if (frame.GetName and frame:GetName()) then
if (not frame.FFShowHooked) then
hooksecurefunc(frame, "Show", FluidFrames.ShowHook)
frame.FFShowHooked = true
end
local data = FluidFramesModifiedFrames[frame:GetName()]
if (data) then
DebugPrint(format("Hiding: %s", frame:GetName()))
frame.FFHidden = true
data.hidden = true
data.unitAttr = frame:GetAttribute("unit")
if (data.unitAttr) then
frame:SetAttribute("unit", nil)
end
frame:Hide()
FluidFrames.UpdateGUI()
else
DebugPrint(format(FLUIDFRAMES_CANT_HIDE, frame:GetName()))
end
end
end
 
--/z FluidFrames.UnlockHiddenFrame(MainMenuBar)
--MainMenuBarBackpackButton:Show()
function FluidFrames.UnlockHiddenFrame(frame)
if (frame.GetName and frame:GetName()) then
local data = FluidFramesModifiedFrames[frame:GetName()]
if (data) then
DebugPrint(format("Un-hiding: %s", frame:GetName()))
frame.FFHidden = nil
data.hidden = nil
if (data.unitAttr) then
frame:SetAttribute("unit", data.unitAttr)
data.unitAttr = nil
end
frame:Show()
FluidFrames.UpdateGUI()
else
DebugPrint(format(FLUIDFRAMES_CANT_HIDE, frame:GetName()))
end
end
end
 
----------------------------
-- Reset Code
----------------------------
 
FluidFramesModifiedFrames = {}
 
function FluidFrames.StoreFrameDefault(frame, storeScale, storeDimentions)
local name = frame:GetName()
if (not name) then
return
end
local data = FluidFramesModifiedFrames[name]
if (not data) then
data = {}
end
if (storeScale and not data.scale) then
data.scale = frame:GetScale()
end
if (storeDimentions and (not data.height or not data.width)) then
data.height = frame:GetHeight()
data.width = frame:GetWidth()
end
if (not data.parent) then
local parent = frame:GetParent()
data.parent = parent and parent:GetName() or parent
end
if (not data.point) then
data.point = {}
for i=1, frame:GetNumPoints() do
local pdata = { frame:GetPoint(i) }
--{ point, relativeTo, relativePoint, xofs, yofs }
if (pdata[2] and pdata[2].GetName and pdata[2]:GetName()) then
pdata[2] = pdata[2]:GetName()
tinsert(data.point, pdata)
else
--No anchor name.... won't save accross sessions (deleted on VARIABLES_LOADED).
Print(format(FLUIDFRAMES_UNNAMED_ANCHOR, name))
tinsert(data.point, pdata)
end
end
end
if (not FluidFramesModifiedFrames[name]) then
FluidFramesModifiedFrames[name] = data
FluidFrames.UpdateGUI()
end
end
 
function FluidFrames.ResetFrame(frame)
-- Remove saved position regardless.
frame:SetUserPlaced(nil)
 
local name = frame:GetName()
if (not name) then
Print(FLUIDFRAMES_CANT_RESET_UNNAMED)
return
elseif (not FluidFramesModifiedFrames[name]) then
Print(format(FLUIDFRAMES_CANT_RESET_NO_DEFAULT, name))
return
end
local data = FluidFramesModifiedFrames[name]
--WOW Crash!!! uncomment this and reset a frame. FluidFrames.RescaleFrame(frame, data.width/frame:GetWidth(), data.height/frame:GetHeight())
 
FluidFrames.Mobilize(frame)
 
if (type(data.parent) == "string") then
local parent = getglobal(data.parent)
if (parent) then
FluidFrames.ResetFrameParent(frame, parent)
end
elseif (type(data.parent) == "table") then
FluidFrames.ResetFrameParent(frame, data.parent)
end
 
if (data.scale) then
frame:SetScale(data.scale)
end
 
if (data.width and data.height) then
local widthScale = data.width/frame:GetWidth()
local heightScale = data.height/frame:GetHeight()
FluidFrames.RescaleFrame(frame, widthScale, heightScale, true)
end
 
frame:ClearAllPoints()
for i=1, #data.point do
frame:SetPoint(data.point[i][1], data.point[i][2], data.point[i][3], data.point[i][4], data.point[i][5])
end
 
FluidFrames.UnlockHiddenFrame(frame)
 
FluidFramesModifiedFrames[name] = nil
 
-- Refresh frame with it's OnShow updates
frame:Hide()
frame:Show()
 
FluidFrames.DragFrame.frame = nil
FluidFrames.DragFrame:Hide()
 
FluidFrames.UpdateGUI()
Print(format(FLUIDFRAMES_RESET, name))
end
 
function FluidFrames.ResetAll()
FluidFrames.DoNotUpdateGUI = true
for k,v in pairs(FluidFramesModifiedFrames) do
local frame = getglobal(k)
if (frame) then
FluidFrames.ResetFrame(frame)
else
Print(format(FLUIDFRAMES_CANT_RESET_NOT_FOUND, k))
end
end
FluidFrames.DoNotUpdateGUI = nil
FluidFrames.UpdateGUI()
Print(FLUIDFRAMES_RESET_ALL_FINISHED)
end
 
SlashCmdList["FLUIDFRAMESSLASH"] = FluidFrames.ResetAll;
 
function FluidFrames.ReshowAll()
FluidFrames.DoNotUpdateGUI = true
for k,v in pairs(FluidFramesModifiedFrames) do
local frame = getglobal(k)
if (frame and frame.FFHidden) then
FluidFrames.UnlockHiddenFrame(frame)
end
end
FluidFrames.DoNotUpdateGUI = nil
FluidFrames.UpdateGUI()
Print(FLUIDFRAMES_RESHOW_ALL_FINISHED)
end
 
 
----------------------------
-- Portfolio Registration
----------------------------
 
function FluidFrames.UpdateGUI()
if (Portfolio) then
if (not FluidFrames.DoNotUpdateGUI) then
--TODO: add update options to show hidden and moved frames
--FluidFrames.RegisterPortfolio(true)
end
end
end
 
function FluidFrames.RegisterPortfolio()
local optionTable = {
id="FluidFrames";
subText=FLUIDFRAMES_DESC_FULL;
options={
-- Pulls the first header and helptext from the addon toc data
{
id = "TempDraggable";
tvar = "TempDraggable",
text = FLUIDFRAMES_TEMP_DRAGGABLE;
type = CONTROLTYPE_CHECKBOX;
callback = function(value)
FluidFrames.ToggleTempDraggableFrames(value == "1")
end;
defaultValue = "1",
};
{
id = "Reset";
text = FLUIDFRAMES_RESET_ALL;
type = CONTROLTYPE_BUTTON;
callback = FluidFrames.ResetAll;
point = {nil, nil, nil, 0, -30};
};
{
id = "Reshow";
text = FLUIDFRAMES_RESHOW_ALL;
type = CONTROLTYPE_BUTTON;
callback = FluidFrames.ReshowAll;
point = {"TOPLEFT", "Reset", "TOPRIGHT", 40, 0};
};
{
id = "Help";
text = FLUIDFRAMES_HELP_HEADER;
subText = FLUIDFRAMES_HELP1..FLUIDFRAMES_NEWLINE..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP2..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP3..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP4..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP5..FLUIDFRAMES_NEWLINE..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP6..FLUIDFRAMES_NEWLINE..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP7..FLUIDFRAMES_NEWLINE..FLUIDFRAMES_NEWLINE
..FLUIDFRAMES_HELP8;
type = CONTROLTYPE_HEADER;
point = {nil, "Reset", nil, nil, -40};
init = function(header, subtext)
subtext:SetHeight(140)
end;
};
};
savedVarTable = "FluidFrames_SavedVars";
loadVars = true;
}
 
Portfolio.RegisterOptionSet(optionTable)
end
 
 
----------------------------
-- OnLoad Inits
----------------------------
FluidFrames.InitDraggableFrame()
FluidFrames.InitEventFrame()
 
trunk/FluidFrames/Skin/Rescale.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes : Added: svn:mime-type + application/octet-stream