/branches/SoopUI 3.0 beta 1.0.1/Core
local SoopUI = LibStub("AceAddon-3.0"):GetAddon("SoopUI") |
SoopUI:RegisterChatCommand("rl", function() ReloadUI() end) |
SoopUI:RegisterChatCommand("install", function() SoopUI:NewInstallProcess() end) |
SoopUI:RegisterChatCommand("getcharlayout", function() print("Current layout: "..dbc.layout.current) end) |
SoopUI:RegisterChatCommand("switch", function() SoopUI:SwitchLayout() end) |
SoopUI:RegisterChatCommand("overrideAddonLoad", function(arg1) SoopUI:LoadSpecificAddOnData(arg1) end) |
SoopUI:RegisterChatCommand("suihelp", function() |
print("SoopUI Help") |
print("-----------------------------------------------------") |
-------------------------------------------------------------------------- |
-- Install.lua -- SoopUI Version 3.0.0 Beta 1 |
-- For help please check WoWinterface or TopShelfSargeras.com |
-- You can reach me on Twitter @TrueSteve or Soopie (Sargeras [US] Alliance) |
-- http://www.wowinterface.com/downloads/info22541-SoopUI.html |
-------------------------------------------------------------------------- |
local SoopUI = LibStub("AceAddon-3.0"):GetAddon("SoopUI") |
local db, dbc, dbg, spec |
installStage = 0, |
} |
-------------------------------------------------------------------------- |
-- Console Variables (CVars) |
-- CVars |
-------------------------------------------------------------------------- |
function SoopUI:SetupCVars() |
FCF_SetLocked(ChatFrame1, 1) |
FCF_DockFrame(ChatFrame2) |
FCF_SetLocked(ChatFrame2, 1) |
FCF_OpenNewWindow(LOOT) |
FCF_DockFrame(ChatFrame4) |
FCF_SetLocked(ChatFrame4, 1) |
FCF_OpenNewWindow(LOOT) |
FCF_DockFrame(ChatFrame3) |
FCF_SetLocked(ChatFrame3, 1) |
if i == 1 then |
frame:ClearAllPoints() |
frame:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 0, 0) |
frame:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 40, 30) |
frame:SetHeight(100) |
frame:SetWidth(375) |
end |
if i == 1 then |
FCF_SetWindowName(frame, "G/S/W") |
elseif i == 2 then |
FCF_SetWindowName(frame, "COMBAT_LOG") |
FCF_SetWindowName(frame, "") |
elseif i == 3 then |
FCF_SetWindowName(frame, "Gen / Trade") |
elseif i == 4 then |
else |
InstallPrevButton:Enable() |
end |
-------------------------------------------------------------------------- |
-- Installation Text |
-------------------------------------------------------------------------- |
if PageNum == 1 then |
f.subtitle:SetText("This is SoopUI!!") |
----------------- Logo |
f.logoText = f:CreateTexture(nil, "OVERLAY") ---- <--- might break it |
f.logoText:SetPoint("CENTER", f, "CENTER") |
f.logoText:SetSize(400, 100) |
f.logoText:SetTexture(MEDIA_PATH .. "Interface\\AddOns\\SoopUI\\media\\logo_sui") |
----------------- Logo |
f.desc1:SetText("SoopUI 3 Beta 1") |
f.desc2:SetText("Healing NOT supported this beta version") |
f.desc1:SetText("This is filler text") |
f.desc2:SetText("This is still filler text.") |
InstallOption1Button:Hide() |
InstallOption2Button:Hide() |
elseif PageNum == 2 then |
f.subtitle:SetText("Spec Setup") |
f.desc1:SetText("Certain functions will be automatically enabled or disabled") |
f.desc3:SetText("This UI is optimized for Tanking (or DPS). ") |
f.desc3:SetText("This UI is optimized for Tanking (DPS somewhat)") |
InstallOption1Button:Show() |
InstallOption1Button:SetScript("OnClick", SetupTank) |
InstallOption1Button:SetText("Tank") |
InstallOption2Button:SetScript("OnClick", SetupHealing) |
InstallOption2Button:SetText("Healing") |
elseif PageNum == 3 then |
f.subtitle:SetText("Console Variables (CVars)") |
f.desc1:SetText("Optimized default WoW console settings") |
f.subtitle:SetText("Character Variables (CVars)") |
f.desc1:SetText("Optimized default WoW settings") |
f.desc2:SetText("Changes options like, disabling profanity filter and camera by default") |
f.desc3:SetText("Press Setup CVars to load SoopUI CVars and continue.") |
InstallOption2Button:Hide() |
end |
end |
-------------------------------------------------------------------------- |
-- Installation Button Positions |
-------------------------------------------------------------------------- |
function SoopUI:NewInstallProcess() |
if not SoopUIInstallFrame then |
local f = CreateFrame("Button", "SoopUIInstallFrame", UIParent) |
f:SetSize(550, 400) |
f:SetBackdrop({bgFile = [[Interface\Addons\SoopUI\media\Minimalist]], ---- <--- might break it |
f:SetBackdrop({bgFile = [[Interface\BUTTONS\WHITE8X8]], |
edgeFile = "", |
tile = false, tileSize = 0, edgeSize = 1, |
insets = { left = 0, right = 0, top = 0, bottom = 0 } |
f.title:SetPoint("TOP", 0, -5) |
f.title:SetFont([[Interface\Addons\SoopUI\media\expressway.ttf]], 13) |
f.title:SetText("SoopUI Installation v"..SoopUI.version) |
f.subtitle = f:CreateFontString(nil, "OVERLAY") |
f.subtitle:SetPoint("TOP", 0, -40) |
f.subtitle:SetFont(SoopUI.media.express, 15) |
NextPage() |
end |
-------------------------------------------------------------------------- |
-- Button handlers |
-------------------------------------------------------------------------- |
function SoopUI:HandleButton(f, strip) |
if f.Left then f.Left:SetAlpha(0) end |
if f.Middle then f.Middle:SetAlpha(0) end |
end |
end |
-------------------------------------------------------------------------- |
-- Popup Dialogues |
-------------------------------------------------------------------------- |
StaticPopupDialogs["SOOPUI_RELOADUI"] = { |
text = "You must reload your UI before using it. Should we do that now?", |
button1 = "Yes", |
preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ |
} |
-------------------------------------------------------------------------- |
-- Resolution Check |
-------------------------------------------------------------------------- |
function SoopUI:CheckResolution() |
local resolution = GetCVar("gxResolution") |
local resHeight = tonumber(string.match(resolution, "%d+x(%d+)")) |