WoWInterface SVN MultiScreenSupport

Compare Revisions

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

Rev 5 → Rev 6

MultiScreenSupport.lua
2,12 → 2,83
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local AceConfig = LibStub("AceConfig-3.0")
--local L = LibStub("AceLocale-3.0"):GetLocale("MultiScreenSupport")
local FrameNumber = 0
 
local self = MultiScreenSupport
function MultiScreenSupport:OnInitialize()
MultiScreenSupport:RegisterEvent("PLAYER_LOGIN")
end
 
function MultiScreenSupport:IsNamePlate(obj)
local Object = obj
local Name = Object:GetName()
 
if (Name and Name:match("NamePlate")) then
return true
else
return false
end
end
 
function MultiScreenSupport:OnShowPlate()
if InCombatLockdown() then
--table.insert(frameUpdateList, self)
-- return -- TODO: watch this carefully
else
frameUpdateList = {}
self.Bar:SetSize(self.Bar:GetWidth()/_G['multiscreensupportsave']['screen'], self.Bar:GetHeight()/_G['multiscreensupportsave']['screen'])
end
end
 
function MultiScreenSupport:PlateTreatement(obj)
local Plate = obj
 
Plate.IsMultiScreenSupport = true
Plate.Bar, Plate.Frame = Plate:GetChildren()
if _G['multiscreensupportsave']['nameplatesbg'] ~= -1 then
Plate.Bar:SetBackdrop(
{
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "",
tile = true, tileSize = 1, edgeSize = 0,
insets = { left = 0, right = 0, top = 0, bottom = 0 }
}
);
Plate.Bar:SetBackdropColor(0,0,0,.2);
end
 
if _G['multiscreensupportsave']['nameplates'] ~= -1 then
Plate:HookScript("OnShow", self.OnShowPlate)
 
if InCombatLockdown() then
--table.insert(frameUpdateList, Plate)
-- return -- TODO: watch this carefully
else
frameUpdateList = {}
--NP.db.healthBar.width, NP.db.healthBar.height
Plate.Bar:SetSize(Plate.Bar:GetWidth()/_G['multiscreensupportsave']['screen'], Plate.Bar:GetHeight()/_G['multiscreensupportsave']['screen'])
end
end
end
 
function MultiScreenSupport:OnUpdate()
local CurrentFrameNumber = WorldFrame:GetNumChildren()
 
if (FrameNumber == CurrentFrameNumber) then
return
end
 
for _, Object in pairs({WorldFrame:GetChildren()}) do
local IsPlate = MultiScreenSupport.IsNamePlate(MultiScreenSupport, Object)
 
if (not Object.IsMultiScreenSupport and IsPlate) then
MultiScreenSupport:PlateTreatement(Object)
end
end
 
FrameNumber = CurrentFrameNumber
end
 
function MultiScreenSupport:addParentAnchor(frameName)
if _G[frameName] then
MultiScreenSupport:setParentAnchor(_G[frameName])
243,8 → 314,8
j=j+1
end)
 
local config = {
name = "MultiScreenSupport",
local standartconfig = {
name = "MultiScreenSupport Standard options",
handler = MultiScreenSupport,
type = "group",
args = setting
287,12 → 358,99
args = specificSetting
}
 
 
 
local config = {
name = "MultiScreenSupport",
handler = MultiScreenSupport,
type = "group",
args = {
Description = {
order = 0,
name = "Nameplates hacking try to resize nameplates to match correct size. It only works out of combat. To help targeting the right nameplate when in combat a additional background is displayed to show you the current click-able area. This option does not work well with default nameplates.",
fontSize = "medium",
type = "description"
},
NamePlates = {--NamePlates
order = 2,
name = "Enable Nameplates hacking",
--desc = "Enable Nameplates hacking",
type = "toggle",
set = function(info,val)
if not val then
_G['multiscreensupportsave']['nameplates'] = -1
print("To disable nameplates hacking you should reload your UI")
else
_G['multiscreensupportsave']['nameplates'] = val
end
end,
get = function(info)
if not _G['multiscreensupportsave']['nameplates'] then
_G['multiscreensupportsave']['nameplates'] = true
end
if _G['multiscreensupportsave']['nameplates'] == -1 then
return false
end
return _G['multiscreensupportsave']['nameplates']
end
},
Screens = {--Number of screens
order = 3,
name = "Number of screen",
--desc = "Number of screen",
type = "range",
min = 2,
max = 9,
step = 1,
bigStep = 1,
set = function(info,val)
_G['multiscreensupportsave']['screen'] = val
end,
get = function(info)
if not _G['multiscreensupportsave']['screen'] then
_G['multiscreensupportsave']['screen'] = 3
end
return _G['multiscreensupportsave']['screen']
end,
isPercent = false
},
NamePlatesBG = {--NamePlates
order = 4,
name = "Enable Nameplates background",
--desc = "Enable Nameplates background",
type = "toggle",
set = function(info,val)
_G['multiscreensupportsave']['nameplatesbg'] = val
if not val then
_G['multiscreensupportsave']['nameplatesbg'] = -1
print("To disable nameplates background you should reload your UI")
else
_G['multiscreensupportsave']['nameplatesbg'] = val
end
end,
get = function(info)
if not _G['multiscreensupportsave']['nameplatesbg'] then
_G['multiscreensupportsave']['nameplatesbg'] = true
end
if _G['multiscreensupportsave']['nameplatesbg'] == -1 then
return false
end
return _G['multiscreensupportsave']['nameplatesbg']
end
},
}
}
 
AceConfig:RegisterOptionsTable("MultiScreenSupport", config)
AceConfig:RegisterOptionsTable("MultiScreenSupport_standart", standartconfig)
AceConfig:RegisterOptionsTable("MultiScreenSupport_specific", specificconfig)
 
local SetDefaultOpttion = AceConfigDialog:AddToBlizOptions("MultiScreenSupport","MultiScreenSupport ".._G['multiscreensupportsave']["MSSVersion"])
SetDefaultOpttion.default = function() _G['multiscreensupportsave'] = { standart = {}, specific = {} } end
 
SetDefaultOpttion = AceConfigDialog:AddToBlizOptions("MultiScreenSupport_standart","MultiScreenSupport standard frame","MultiScreenSupport ".._G['multiscreensupportsave']["MSSVersion"])
SetDefaultOpttion.default = function() _G['multiscreensupportsave'] = { standart = {}, specific = {} } end
 
SetDefaultOpttion = AceConfigDialog:AddToBlizOptions("MultiScreenSupport_specific","MultiScreenSupport specific frame","MultiScreenSupport ".._G['multiscreensupportsave']["MSSVersion"])
SetDefaultOpttion.default = function() _G['multiscreensupportsave'] = { standart = {}, specific = {} } end
 
310,6 → 468,15
 
--to add specific addon frame like blizzard one.
MultiScreenSupport:RegisterEvent("ADDON_LOADED")
 
--NAMEPLATES Hacking
if not _G['multiscreensupportsave']['screen'] then
_G['multiscreensupportsave']['screen'] = 3
end
if _G['multiscreensupportsave']['nameplatesbg'] ~= -1 or _G['multiscreensupportsave']['nameplates'] ~= -1 then
local Plates = CreateFrame("Frame", nil, WorldFrame)
Plates:SetScript("OnUpdate",function () MultiScreenSupport:OnUpdate() end)
end
end
 
function MultiScreenSupport:ADDON_LOADED(event, addon)
MultiScreenSupport.toc
1,6 → 1,6
## Interface: 60200
## Author: Tomate
## Version: 2.2
## Version: 3.0
## Title: MultiScreenSupport
## Notes: Eyefinity and Surround gaming assist to anchor default UI panels to the center monitor.
## X-Embeds: Ace3