WoWInterface SVN OPieMasque

Compare Revisions

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

Rev 1 → Rev 2

trunk/README.txt New file
0,0 → 1,35
OPie Masque
===========
 
* Written by Phanx <addons@phanx.net>
* http://www.wowinterface.com/downloads/info22218-OPieMasque.html
* http://www.curse.com/addons/wow/opie-masque
 
 
Description
-----------
 
Adds Masque skinning support to OPie.
 
 
Localization
------------
 
Compatible with all locales. Does not require translations.
 
 
Feedback
--------
 
Bugs, errors, or other problems:
Please use the ticket system on either download page.
 
Feature requests or other suggestions:
Please use the ticket system on either download page.
 
General questions or comments:
Post a comment on either download page.
 
If you need to contact me privately for a reason other than those listed
above, you can send me a private message on either download site, or
email me at <addons@phanx.net>.
\ No newline at end of file
trunk/OPieMasque.toc New file
0,0 → 1,19
## Interface: 50200
## Version: 5.2.0.wowi:revision
 
## Title: OPie Masque
## Notes: Adds Masque skinning support to OPie.
## Notes-esES: Capacita a Masque para cambiar la apariencia de OPie.
## Notes-esMX: Capacita a Masque para cambiar la apariencia de OPie.
 
## Author: Phanx
## X-Email: addons@phanx.net
## X-License: Public Domain
## X-CompatibleLocales: deDE, enUS, esES, esMX, frFR, itIT, ptBR, koKR, ruRU, zhCN, zhTW
## X-Website: http://www.wowinterface.com/downloads/info22218-OPieMasque.html
## X-Curse-Project-Name: opie-masque
## X-WoWI-ID: 22218
 
## Dependencies: Masque, OPie
 
Addon.lua
\ No newline at end of file
trunk/UNLICENSE.txt New file
0,0 → 1,24
This is free and unencumbered software released into the public domain.
 
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
 
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 
For more information, please refer to <http://unlicense.org/>
\ No newline at end of file
trunk/Addon.lua New file
0,0 → 1,164
--[[------------------------------------------------------
OPie_Masque
Adds Masque skinning support to OPie.
Written by Phanx <addons@phanx.net>
See the accompanying README file for more information.
http://www.wowinterface.com/downloads/info22218-OPieMasque.html
http://www.curse.com/addons/wow/opie-masque/
----------------------------------------------------------------------]]
 
assert(OneRingLib, "OneRingLib not found")
assert(OneRingLib.ext, "OneRingLib.ext not found")
assert(OneRingLib.ext.OPieUI, "OneRingLib.ext.OPieUI not found")
 
local Masque = LibStub("Masque", true)
assert(Masque, "Masque not found")
 
local id
local group
local buttons = {} _G.obuttons=buttons
local prototype = {}
 
function prototype:SetIcon(texture)
self.icon:SetTexture(texture)
end
 
function prototype:SetIconTexCoord(...)
self.icon:SetTexCoord(...)
end
 
function prototype:SetIconVertexColor(r, g, b)
self.icon:SetVertexColor(r, g, b)
end
 
function prototype:SetDominantColor(r, g, b)
self.border:SetShown(floor(r + 0.5) ~= 1 or floor(g + 0.5) ~= 1 or floor(b + 0.5) ~= 1) -- don't override skin color if it's white
self.border:SetVertexColor(r, g, b)
for i = 1, #self.glowTextures do
self.glowTextures[i]:SetVertexColor(r, g, b)
end
end
 
function prototype:SetOverlayIcon(texture, w, h, ...)
-- wat?
--[[
if not texture then
self.overIcon:Hide()
else
self.overIcon:Show()
self.overIcon:SetTexture(texture)
self.overIcon:SetSize(w, h)
if ... then
self.overIcon:SetTexCoord(...)
end
end
]]
end
 
function prototype:SetCount(count)
self.count:SetText(count or "")
end
 
function prototype:SetBindingText(text)
self.hotkey:SetText(text or "")
end
 
function prototype:SetCooldown(remain, duration, usable)
if duration and duration > 0 and remain and remain > 0 then
local start = GetTime() + duration - remain
self.cooldown:SetCooldown(start, duration)
self.cooldown:Show()
else
self.cooldown:Hide()
end
end
 
function prototype:SetCooldownFormattedText(pattern, ...)
-- Do nothing, let OmniCC handle it
end
 
function prototype:SetHighlighted(highlight)
self[highlight and "LockHighlight" or "UnlockHighlight"](self)
self:GetPushedTexture():SetShown(highlight)
end
 
function prototype:SetActive(active)
self:SetChecked(active)
end
 
function prototype:SetOuterGlow(shown)
for i = 1, #self.glowTextures do
self.glowTextures[i]:SetShown(shown)
end
end
 
local function Reskin()
for _, button in pairs(buttons) do
local r, g, b = button.glowTextures[1]:GetVertexColor()
local _, _, _, a = button.border:GetVertexColor()
button.border:SetVertexColor(r, g, b, a)
end
end
 
local id = 1
 
local function CreateIndicator(name, parent, size, ghost)
name = name or "OPieSliceButton"..id
parent = parent or UIParent
size = size or 36
id = id + 1
 
local button = CreateFrame("CheckButton", name, parent, "ActionButtonTemplate")
button:SetSize(size, size)
button:EnableMouse(false)
 
button.border = _G[name .. "Border"] -- highlight
button.cooldown = _G[name .. "Cooldown"]
button.count = _G[name .. "Count"]
button.flash = _G[name .. "Flash"] -- inner glow / checked
button.hotkey = _G[name .. "HotKey"]
button.icon = _G[name .. "Icon"]
button.normalTexture = _G[name .. "NormalTexture"] -- border
 
-- Outer glow
button.glowTextures = {}
for i = 1, 4 do
local glow = button:CreateTexture(nil, "BACKGROUND", nil, -8)
glow:SetSize(size, size)
glow:SetTexture("Interface\\AddOns\\OPie\\gfx\\oglow")
glow:Hide()
button.glowTextures[i] = glow
end
button.glowTextures[1]:SetPoint("CENTER", button, "TOPLEFT")
button.glowTextures[1]:SetTexCoord(0, 1, 0, 1)
button.glowTextures[2]:SetPoint("CENTER", button, "TOPRIGHT")
button.glowTextures[2]:SetTexCoord(1, 0, 0, 1)
button.glowTextures[3]:SetPoint("CENTER", button, "BOTTOMRIGHT")
button.glowTextures[3]:SetTexCoord(1, 0, 1, 0)
button.glowTextures[4]:SetPoint("CENTER", button, "BOTTOMLEFT")
button.glowTextures[4]:SetTexCoord(0, 1, 1, 0)
 
--[[ Overlay icon (???)
button.overIcon = button:CreateTexture(nil, "ARTWORK", 1)
button.overIcon:SetPoint("BOTTOMLEFT", button, "BOTTOMLEFT", 4, 4)]]
 
--[[ Cooldown text
button.cdText = button:CreateFontString(nil, "OVERLAY", "NumberFontNormalHuge")
button.cdText:SetPoint("CENTER")]]
 
for k, v in pairs(prototype) do
button[k] = v
end
 
-- Let Masque skin it
if not group then
group = Masque:Group("OPie")
Masque:Register("OPie", Reskin)
end
group:AddButton(button)
 
tinsert(buttons, button)
return button
end
 
OneRingLib.ext.OPieUI:SetIndicatorConstructor(CreateIndicator)
\ No newline at end of file
trunk Property changes : Added: wowi:dirname + OPieMasque