/trunk/StufRaid_Options
BlizOptionsGroup Container |
Simple container widget for the integration of AceGUI into the Blizzard Interface Options |
-------------------------------------------------------------------------------]] |
local Type, Version = "BlizOptionsGroup", 20 |
local Type, Version = "BlizOptionsGroup", 21 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
frame.obj:Fire("cancel") |
end |
local function defaults(frame) |
frame.obj:Fire("defaults") |
local function default(frame) |
frame.obj:Fire("default") |
end |
local function refresh(frame) |
frame.obj:Fire("refresh") |
end |
--[[----------------------------------------------------------------------------- |
Methods |
-------------------------------------------------------------------------------]] |
-- support functions for the Blizzard Interface Options |
frame.okay = okay |
frame.cancel = cancel |
frame.defaults = defaults |
frame.default = default |
frame.refresh = refresh |
frame:SetScript("OnHide", OnHide) |
frame:SetScript("OnShow", OnShow) |
InlineGroup Container |
Simple container widget that creates a visible "box" with an optional title. |
-------------------------------------------------------------------------------]] |
local Type, Version = "InlineGroup", 20 |
local Type, Version = "InlineGroup", 21 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
["OnAcquire"] = function(self) |
self:SetWidth(300) |
self:SetHeight(100) |
self:SetTitle("") |
end, |
-- ["OnRelease"] = nil, |
--[[----------------------------------------------------------------------------- |
ColorPicker Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "ColorPicker", 20 |
local Type, Version = "ColorPicker", 21 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local self = frame.obj |
if not self.disabled then |
ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG") |
ColorPickerFrame:SetClampedToScreen(true) |
ColorPickerFrame.func = function() |
local r, g, b = ColorPickerFrame:GetColorRGB() |
local DataVersion = 9001 -- dev version always overwrites everything else :) |
--@end-debug@]===] |
--@non-debug@ |
local DataVersion = 42 |
local DataVersion = 46 |
--@end-non-debug@ |
local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) |
DLeft:SetTexture([[Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame]]) |
DLeft:SetTexCoord(0, 0.1953125, 0, 1) |
frame.DLeft = DLeft |
local DRight = frame:CreateTexture(nil, "ARTWORK") |
DRight:SetWidth(25) |
DRight:SetHeight(64) |
DRight:SetTexture([[Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame]]) |
DRight:SetTexCoord(0.8046875, 1, 0, 1) |
frame.DRight = DRight |
local DMiddle = frame:CreateTexture(nil, "ARTWORK") |
DMiddle:SetHeight(64) |
DMiddle:SetPoint("TOP", DLeft, "TOP") |
local function AddFrame(self, frame) |
frame:SetParent(self.contentframe) |
local strata = self:GetFrameStrata() |
frame:SetFrameStrata(strata) |
local level = self:GetFrameLevel() + 100 |
frame:SetFrameLevel(level) |
frame:SetFrameStrata(self:GetFrameStrata()) |
frame:SetFrameLevel(self:GetFrameLevel() + 100) |
if next(self.contentRepo) then |
frame:SetPoint("TOPLEFT", self.contentRepo[#self.contentRepo], "BOTTOMLEFT", 0, 0) |
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0) |
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0) |
self.contentRepo[1] = frame |
end |
if self.contentframe:GetHeight() > UIParent:GetHeight()*2/5 - 20 then |
self.scrollframe:SetWidth(146) |
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -28, 12) |
self:SetHeight(UIParent:GetHeight()*2/5) |
self.slider:Show() |
self:SetScript("OnMouseWheel", OnMouseWheel) |
self.scrollframe:UpdateScrollChildRect() |
self.slider:SetMinMaxValues(0, self.contentframe:GetHeight()-self.scrollframe:GetHeight()) |
else |
self.scrollframe:SetWidth(160) |
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -14, 12) |
self:SetHeight(self.contentframe:GetHeight()+25) |
self.slider:Hide() |
self:SetScript("OnMouseWheel", nil) |
contentframe:SetWidth(160) |
contentframe:SetHeight(0) |
frame.contentframe = contentframe |
local scrollframe = CreateFrame("ScrollFrame", nil, frame) |
scrollframe:SetWidth(160) |
scrollframe:SetPoint("TOPLEFT", frame, "TOPLEFT", 14, -13) |
scrollframe:SetPoint("BOTTOM", frame, "BOTTOM", 0, 12) |
scrollframe:SetWidth(160) |
scrollframe:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -14, 12) |
scrollframe:SetScrollChild(contentframe) |
frame.scrollframe = scrollframe |
contentframe:SetPoint("TOPLEFT", scrollframe) |
contentframe:SetPoint("TOPRIGHT", scrollframe) |
local bgTex = frame:CreateTexture(nil, "ARTWORK") |
bgTex:SetAllPoints(scrollframe) |
frame.bgTex = bgTex |
frame.AddFrame = AddFrame |
frame.ClearFrames = ClearFrames |
frame.contentRepo = {} -- store all our frames in here so we can get rid of them later |
local slider = CreateFrame("Slider", nil, scrollframe) |
slider:SetOrientation("VERTICAL") |
slider:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -14, -10) |
do |
local widgetType = "LSM30_Font" |
local widgetVersion = 9 |
local widgetVersion = 10 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
do |
local widgetType = "LSM30_Sound" |
local widgetVersion = 9 |
local widgetVersion = 10 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function ContentSpeakerOnClick(this, button) |
local self = this.frame.obj |
local sound = this.frame.text:GetText() |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master") |
end |
local function GetContentLine() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
local function WidgetPlaySound(this) |
local self = this.obj |
local sound = self.frame.text:GetText() |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master") |
end |
local function Constructor() |
do |
local widgetType = "LSM30_Statusbar" |
local widgetVersion = 9 |
local widgetVersion = 10 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
frame.dropButton:SetScript("OnClick",ToggleDrop) |
frame:SetScript("OnHide", OnHide) |
local bar = frame:CreateTexture(nil, "ARTWORK") |
local bar = frame:CreateTexture(nil, "OVERLAY") |
bar:SetPoint("TOPLEFT", frame,"TOPLEFT",6,-25) |
bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5) |
bar:SetAlpha(0.5) |
self.bar = bar |
self.alignoffset = 31 |
self.OnRelease = OnRelease |
self.OnAcquire = OnAcquire |
self.ClearFocus = ClearFocus |
do |
local widgetType = "LSM30_Border" |
local widgetVersion = 9 |
local widgetVersion = 10 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
do |
local widgetType = "LSM30_Background" |
local widgetVersion = 9 |
local widgetVersion = 10 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD") |
frame:SetScript("OnClick", ContentOnClick) |
frame:SetScript("OnEnter", ContentOnEnter) |
local check = frame:CreateTexture("OVERLAY") |
check:SetWidth(16) |
check:SetHeight(16) |
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check") |
check:Hide() |
frame.check = check |
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite") |
local font, size = text:GetFont() |
text:SetFont(font,size,"OUTLINE") |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
frame.ReturnSelf = ReturnSelf |
end |
frame:Show() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
## Interface: 50100 |
## Interface: 50200 |
## Title: Stuf Raid Options |
## Author: TotalPackage |
## Notes: Configuration Menu for StufRaid. |