diff --git a/assets/Border.tga b/assets/Border.tga new file mode 100644 index 0000000..c6c8f4f Binary files /dev/null and b/assets/Border.tga differ diff --git a/assets/Comfortaa-Bold.ttf b/assets/Comfortaa-Bold.ttf new file mode 100644 index 0000000..3068e16 Binary files /dev/null and b/assets/Comfortaa-Bold.ttf differ diff --git a/assets/PTSans-Bold.ttf b/assets/PTSans-Bold.ttf new file mode 100644 index 0000000..d0265b2 Binary files /dev/null and b/assets/PTSans-Bold.ttf differ diff --git a/assets/PTSans-License.txt b/assets/PTSans-License.txt new file mode 100644 index 0000000..759ea1b --- /dev/null +++ b/assets/PTSans-License.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010, ParaType Ltd. (http://www.paratype.com/public), +with Reserved Font Names "PT Sans", "PT Serif" and "ParaType". + +This Font Software is licensed under the Open Font License, Version 1.1 +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/TargetOfTarget.blp b/assets/TargetOfTarget.blp new file mode 100644 index 0000000..9f4c2c0 Binary files /dev/null and b/assets/TargetOfTarget.blp differ diff --git a/assets/TargetOfTargetSquare.tga b/assets/TargetOfTargetSquare.tga new file mode 100644 index 0000000..c978699 Binary files /dev/null and b/assets/TargetOfTargetSquare.tga differ diff --git a/assets/UI-CastingBar-Border-Small.blp b/assets/UI-CastingBar-Border-Small.blp new file mode 100644 index 0000000..3a593c7 Binary files /dev/null and b/assets/UI-CastingBar-Border-Small.blp differ diff --git a/assets/UI-CastingBar-Flash-Small.blp b/assets/UI-CastingBar-Flash-Small.blp new file mode 100644 index 0000000..6cea8fa Binary files /dev/null and b/assets/UI-CastingBar-Flash-Small.blp differ diff --git a/assets/UI-CastingBar-Small-Shield.blp b/assets/UI-CastingBar-Small-Shield.blp new file mode 100644 index 0000000..1cba08f Binary files /dev/null and b/assets/UI-CastingBar-Small-Shield.blp differ diff --git a/assets/UI-Classes-Circles.blp b/assets/UI-Classes-Circles.blp new file mode 100644 index 0000000..b08b0a6 Binary files /dev/null and b/assets/UI-Classes-Circles.blp differ diff --git a/assets/UI-PARTYFRAME-FLASH.blp b/assets/UI-PARTYFRAME-FLASH.blp new file mode 100644 index 0000000..50b3d57 Binary files /dev/null and b/assets/UI-PARTYFRAME-FLASH.blp differ diff --git a/assets/UI-PartyFrame.blp b/assets/UI-PartyFrame.blp new file mode 100644 index 0000000..110bf6c Binary files /dev/null and b/assets/UI-PartyFrame.blp differ diff --git a/assets/UI-Player-Status.blp b/assets/UI-Player-Status.blp new file mode 100644 index 0000000..3580307 Binary files /dev/null and b/assets/UI-Player-Status.blp differ diff --git a/assets/UI-TargetingEliteFrame.blp b/assets/UI-TargetingEliteFrame.blp new file mode 100644 index 0000000..e67c06e Binary files /dev/null and b/assets/UI-TargetingEliteFrame.blp differ diff --git a/assets/UI-TargetingFrame.blp b/assets/UI-TargetingFrame.blp new file mode 100644 index 0000000..61d99ab Binary files /dev/null and b/assets/UI-TargetingFrame.blp differ diff --git a/assets/beige.tga b/assets/beige.tga new file mode 100644 index 0000000..5ce5372 Binary files /dev/null and b/assets/beige.tga differ diff --git a/assets/default.tga b/assets/default.tga new file mode 100644 index 0000000..b2e19a8 Binary files /dev/null and b/assets/default.tga differ diff --git a/assets/dualwield01.tga b/assets/dualwield01.tga new file mode 100644 index 0000000..d956ed3 Binary files /dev/null and b/assets/dualwield01.tga differ diff --git a/assets/fontAtari.ttf b/assets/fontAtari.ttf new file mode 100644 index 0000000..a111c5d Binary files /dev/null and b/assets/fontAtari.ttf differ diff --git a/assets/normal.ttf b/assets/normal.ttf new file mode 100644 index 0000000..1ca255c Binary files /dev/null and b/assets/normal.ttf differ diff --git a/assets/units_trinket_border.blp b/assets/units_trinket_border.blp new file mode 100644 index 0000000..095d107 Binary files /dev/null and b/assets/units_trinket_border.blp differ diff --git a/core/anchor.lua b/core/anchor.lua new file mode 100644 index 0000000..af04b35 --- /dev/null +++ b/core/anchor.lua @@ -0,0 +1,274 @@ +local addon = select(2,...); +local event_ = addon:package() + +-- /* lua lib */ +local unpack = unpack +local pairs = pairs +local wipe = wipe +local print = print +local table = addon.table + +-- /* WoW APIs */ +local GetEffectiveScale = GetEffectiveScale +local StaticPopup_Show = StaticPopup_Show +local InCombatLockdown = InCombatLockdown +local UIErrorsFrame = UIErrorsFrame +local UIParent = UIParent +local CreateFrame = CreateFrame + +-- /* consts */ +local CANCEL = CANCEL +local LOCK = LOCK +local OKAY = OKAY +local RESET = RESET +local ERR_NOT_IN_COMBAT = ERR_NOT_IN_COMBAT +local istoggle = false +local secure = true + +-- /* create screen shade */ +local shadeFrame = CreateFrame('Frame') +local shadeTexture = shadeFrame:CreateTexture(nil, 'BACKGROUND', nil, -8) +shadeFrame:SetFrameStrata('BACKGROUND') +shadeFrame:SetWidth(GetScreenWidth() * UIParent:GetEffectiveScale()) +shadeFrame:SetHeight(GetScreenHeight() * UIParent:GetEffectiveScale()) +shadeTexture:SetAllPoints(shadeFrame) +shadeFrame:SetPoint('CENTER', 0, 0) + +-- /* create screen crosshair */ +local crosshairFrameNS = CreateFrame('Frame') +local crosshairTextureNS = crosshairFrameNS:CreateTexture(nil, 'TOOLTIP') +crosshairFrameNS:SetFrameStrata('TOOLTIP') +crosshairFrameNS:SetWidth(1) +crosshairFrameNS:SetHeight(GetScreenHeight() * UIParent:GetEffectiveScale()) +crosshairTextureNS:SetAllPoints(crosshairFrameNS) +crosshairTextureNS:SetTexture(0, 0, 0, 1) + +local crosshairFrameEW = CreateFrame('Frame') +local crosshairTextureEW = crosshairFrameEW:CreateTexture(nil, 'TOOLTIP') +crosshairFrameEW:SetFrameStrata('TOOLTIP') +crosshairFrameEW:SetWidth(GetScreenWidth() * UIParent:GetEffectiveScale()) +crosshairFrameEW:SetHeight(1) +crosshairTextureEW:SetAllPoints(crosshairFrameEW) +crosshairTextureEW:SetTexture(0, 0, 0, 1) + +-- /* setup screen align */ +local function clear() + shadeFrame:Hide() + crosshairFrameNS:Hide() + crosshairFrameEW:Hide() +end + +local function shade(r, g, b, a) + shadeTexture:SetTexture(r, g, b, a) + shadeFrame:Show() +end + +local function follow() + local mouseX, mouseY = GetCursorPosition() + crosshairFrameNS:SetPoint('TOPLEFT', mouseX, 0) + crosshairFrameEW:SetPoint('BOTTOMLEFT', 0, mouseY) +end + +local function crosshair(arg) + local mouseX, mouseY = GetCursorPosition() + crosshairFrameNS:SetPoint('TOPLEFT', mouseX, 0) + crosshairFrameEW:SetPoint('BOTTOMLEFT', 0, mouseY) + crosshairFrameNS:Show() + crosshairFrameEW:Show() + if (arg == 'follow') then + crosshairFrameNS:SetScript('OnUpdate', follow) + else + crosshairFrameNS:SetScript('OnUpdate', nil) + end +end + +-- /* create mover elements */ +local anchorlist, backup, f = {}, {} +local function create_anchor(self, text, value, anchor, width, height) + local key = 'elements_anchor' + if not _appdata[key] then _appdata[key] = {} end + + -- setup frame + local mover = CreateFrame('Frame', nil, UIParent) + mover:SetWidth(width or self:GetWidth()) + mover:SetHeight(height or self:GetHeight()) + mover:SetBackdrop(addon.backdrop) + mover:SetBackdropColor(0.67058823529, 0.80392156862, 0.93725490196, .65) + mover:SetBackdropBorderColor(0, 1, .62, .5) + + -- setup name + mover.text = mover:CreateFontString(nil, 'OVERLAY', 'pUiFont') + mover.text:SetPoint('CENTER', 0, 2) + mover.text:SetTextColor(1, .8, 0) + mover.text:SetText(text) + + tinsert(anchorlist, mover) + + if not _appdata[key][value] then + mover:SetPoint(unpack(anchor)) + else + mover:SetPoint(unpack(_appdata[key][value])) + end + mover:EnableMouse(true) + mover:SetMovable(true) + mover:SetClampedToScreen(true) + mover:SetFrameStrata('HIGH') + mover:RegisterForDrag('LeftButton') + mover:SetScript('OnDragStart', function() mover:StartMoving() end) + mover:SetScript('OnDragStop', function() + mover:StopMovingOrSizing() + local orig, _, tar, x, y = mover:GetPoint() + _appdata[key][value] = {orig, 'UIParent', tar, x, y} + end) + mover:Hide() + + self:ClearAllPoints() + self:SetPoint('CENTER', mover, 'CENTER') + + return mover +end + +-- /* create mover options */ +local function unlock_elements() + for i = 1, #anchorlist do + local mover = anchorlist[i] + if (not mover:IsShown()) then + mover:Show() + end + end + table.copy(_appdata['elements_anchor'], backup) + f:Show() +end + +local function lock_elements() + for i = 1, #anchorlist do + local mover = anchorlist[i] + mover:Hide() + end + + f:Hide() + istoggle = false + clear() +end + +-- /* setup mover settings */ +StaticPopupDialogs['PRETTY_MOVER_RESET'] = { + text = 'Are you sure to reset all frames position?', + button1 = OKAY, + button2 = CANCEL, + OnAccept = function() + wipe(_appdata['elements_anchor']) + ReloadUI() + end, + timeout = 0, + whileDead = 1, + hideOnEscape = true, + preferredIndex = 5, +} + +StaticPopupDialogs['PRETTY_MOVER_CANCEL'] = { + text = 'Are you sure to reverse your positioning?', + button1 = OKAY, + button2 = CANCEL, + OnAccept = function() + table.copy(backup, _appdata['elements_anchor']) + ReloadUI() + end, + timeout = 0, + whileDead = 1, + hideOnEscape = true, + preferredIndex = 5, +} + +-- /* create mover console */ +local function createconsole() + if f then return end + + f = CreateFrame('Frame', nil, UIParent) + f:SetPoint('TOP', 0, -150) + f:SetSize(296, 65) + f:SetBackdrop(addon.backdrop) + f:SetBackdropColor(0, 0, 0, .7) + f:SetBackdropBorderColor(1, .71, 0, .4) + addon.console_anchor(f) + + f.text = f:CreateFontString(nil, 'OVERLAY', 'pUiFont') + f.text:SetPoint('TOP', 0, -10) + f.text:SetText('Console') + + -- setup buttons + local bu, text = {}, {LOCK, CANCEL, 'Grid', RESET} + for i = 1, 4 do + bu[i] = CreateFrame('Button', nil, f) + bu[i]:SetSize(70, 28) + + if i==1 then + bu[i]:SetPoint('BOTTOMLEFT', 5, 5) + else + bu[i]:SetPoint('LEFT', bu[i-1], 'RIGHT', 2, 0) + end + + bu.text = bu[i]:CreateFontString(nil, 'OVERLAY') + bu.text:SetFontObject('pUiFont') + bu.text:SetPoint('TOP', 0, -10) + bu.text:SetText(text[i]) + end + + -- create lock button + bu[1]:SetScript('OnClick', lock_elements) + + -- create cancel button + bu[2]:SetScript('OnClick', function() + StaticPopup_Show('PRETTY_MOVER_CANCEL') + end) + + -- create grids button + bu[3]:SetScript('OnClick', function() + if not istoggle then + istoggle = true + shade(1, 1, 1, .85) + crosshairTextureNS:SetTexture(0, 0, 0, 1) + crosshairTextureEW:SetTexture(0, 0, 0, 1) + crosshair('follow') + else + istoggle = false + clear() + end + end) + + -- create reset button + bu[4]:SetScript('OnClick', function() + StaticPopup_Show('PRETTY_MOVER_RESET') + end) +end + +-- /* create secure toggle function */ +function event_:PLAYER_REGEN_DISABLED() + addon:toggle_anchors(true) +end + +function addon:toggle_anchors(forcelock) + if secure and not forcelock then + if self:taint() then + return UIErrorsFrame:AddMessage(ERR_NOT_IN_COMBAT) + end + event_:RegisterEvent('PLAYER_REGEN_DISABLED') + createconsole() + unlock_elements() + elseif not secure then + if f and f:IsShown() then + lock_elements() + end + event_:UnregisterEvent('PLAYER_REGEN_DISABLED') + end + + secure = not secure + return secure +end + +SlashCmdList['PRETTY_MOVER'] = function(...) + addon:toggle_anchors() +end +SLASH_PRETTY_MOVER1 = '/mover' + +addon.c_anchor = create_anchor \ No newline at end of file diff --git a/core/config.lua b/core/config.lua new file mode 100644 index 0000000..cde8a06 --- /dev/null +++ b/core/config.lua @@ -0,0 +1,155 @@ +local addon = select(2,...); +local path = [[Interface\AddOns\pw_unitframes\assets\]] + +--[[ +/** + * general config + * default settings of pretty light UF + * https://github.com/s0h2x/ + * (c) 2022, s0h2x + * + * This file is provided as is (no warranties). + */ +]] + +local config = { + + -- general settings: + global = { + classportraits = true, -- enable portraits by class + prettyportraits = true, -- display custom portraits + combaticon = true, -- display combat state + framecolors = {.22, .22, .22, 1}, -- main colors theme of frames + castbar_scale = 1.2, -- castbar scale + castbar_offset = 2, -- castbar offset by x-axis + FFA = true, -- show FFA status icon for all frames + }, + + -- buffs & debuffs: + auras = { + -- size: + aura_size = 26, -- aura size + minscale = .5, -- minimum scale we want to show cooldown counts at, anything below this will be hidden + minduration = 3, -- minimum duration to show cooldown text + icon_size = 20, -- normal size for an icon (don't change this) + font_size = 14, -- base font size + threshold = 6.5, -- last seconds + duration_color = {1, .7, 0}, -- text color of duration > threshold + threshold_color = {1, 0, 0}, -- text color of duration < threshold + buffs_scale = 1.16, -- buffs scale + debuffs_scale = 1.16, -- debuffs scale + -- position: + start_x = 7, -- auras start position by x-axis (buffs) + start_y = 26, -- auras start position by y-axis (buffs) + offset_x = 1.3, -- spacing between auras by x-axis + offset_y = 3, -- spacing between auras by y-axis + numrow = 4, -- how many auras to show in one row + numrowtot = 3, -- how many auras to show in one (first) row on target if target has target of target (whut?) + debuffs_vertical = true, -- vertical growth (from bottom to top) + debuffs_offset_y = 5, -- vertical growth offset between debuffs + e_debuffs_offset_y = 30, -- vertical growth offset between debuffs on enemy frame + -- maximum number of buffs/debuffs: + target_maxbuffs = 12, -- max buffs show, recommended to set value between 8-16 + target_maxdebuffs = 12, -- default: 16, recommended to set value between 8-16 + -- misc: + dispelable = true, -- glowing dispelable buffs + }, + + -- player frame: + player = { + scale = 1.08, -- player scale + elite = true, -- make yourself an elite + level = false, -- show player level + leadericon = false, -- show player leader icon + name = true, -- show player name + petname = false, -- show pet name + runescale = 1, -- deathknight rune orbs scale + }, + + -- target frame: + target = { + scale = 1.08, -- target scale + level = false, -- show target level + leadericon = false, -- show target leader icon + pvpicon = true, -- show target pvp icon + name = true, -- show target name + threatscale = 1, -- threat aggro scale + threatplayer = true, -- show threat on player frame + }, + + -- focus frame: + focus = { + scale = 1, -- focus scale + fullsize = 1, -- cvar fullsize 0 or 1 + level = false, -- show focus level + leadericon = false, -- leader icon + name = true, -- show focus name + threatscale = 1, -- threat aggro scale + fk = true, -- enable hotkey macro mode + modbutton = 'shift', -- shift, alt, ctrl + mousebutton = '1', -- 1 = left, 2 = right, 3 = middle, 4 and 5 = thumb buttons if there are any + }, + + -- arena frame: + arena = { + enable = true, -- show arena enemys frames + scale = 1.6, -- arena scale + name = true, -- show arena enemys name + trinkets = true, -- show arena trinkets + trinket_announce = true, -- enable trinket announce + announce_chat = 'PARTY', -- trinket announce chat type + -- text announce: + text_trinket = 'Use Trinket!', -- Enemyname (Class): Use Trinket! + text_wotf = 'Use WotF!', + textstring_size = 8, -- text font size of health and mana bars + textcast_size = 7, -- text font size of castbar spell name + }, + + -- party frames: + party = { + enable = true, -- show party member frames + scale = 1.26, -- party members scale + castbar_scale = 1.07, -- castbar scale + showbuffs = true, -- show party buffs + maxbuffs = 4, -- how many buffs to show + }, + + -- target of targets: + targettarget = { + scale = 1.16, -- scale for target of target and focus target + squarestyle = false, -- enable square style for target of targets + partytargets = true, -- show party targets + arenatargets = true, -- show arena targets + partytarget_scale = 0.9, -- party target scale + arenatarget_scale = 0.6, -- arena target scale + }, + + -- default and backup for restore: + position = { + ['runebar'] = {'TOP', PlayerFrameManaBar, 'BOTTOM', 12, -10}, + }, + + media = { + -- assets: + statusbar = path..'beige.tga', -- main statusbar texture theme + targetFrame = path..'UI-TargetingFrame', -- player, target, focus texture + targetElite = path..'UI-TargetingEliteFrame', -- elite texture + targetTargetNormal = path..'TargetOfTarget', -- target of target normal + targetTargetSquare = path..'TargetOfTargetSquare.tga', -- target of target square style + partyFrame = path..'UI-PartyFrame', -- party frame texture + border = path..'Border.tga', -- main auras border texture + trinket_border = path..'units_trinket_border', -- trinket border + dualweild = path..'dualwield01.tga', -- combat icon + portraits = path..'UI-Classes-Circles', -- my custom portraits ^__^ + castborder = path..'UI-CastingBar-Border-Small', -- main castbar border texture + castflash = path..'UI-CastingBar-Flash-Small', -- main castbar flash texture + castshield = path..'UI-CastingBar-Small-Shield', -- castbar non-interrupt texture + -- font: + font = path..'normal.ttf', -- main font theme + font_style = '', -- OUTLINE + font_size = 14, -- font size + font_offset = 1, -- font shadow offset + }, +} + +addon.config = config \ No newline at end of file diff --git a/core/core.lua b/core/core.lua new file mode 100644 index 0000000..9f8d9f6 --- /dev/null +++ b/core/core.lua @@ -0,0 +1,81 @@ +--[[ +/** + * compatibility core functions + * https://github.com/s0h2x/ + * (c) 2022, s0h2x + * + * This file is provided as is (no warranties). + */ +]] + +local select = select +local addon = select(2,...); + +local UnitAffectingCombat = UnitAffectingCombat +local InCombatLockdown = InCombatLockdown + +-- /* init SavedVariables */ +local addon_config = {} +_appdata = addon_config + +-- /* implicit compatibility */ +local texcoord = {.08, .92, .08, .92} +local backdrop = {bgFile = [[Interface\Buttons\WHITE8x8]], +edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 14, +insets = {left = 2.6, right = 2.6, top = 2.6, bottom = 2.6}} +local noop = function() return end +local eject = function(obj) + if obj.UnregisterAllEvents then + obj:UnregisterAllEvents() + end + obj.Show = noop + obj:Hide() +end + +-- /* for avoid taint */ +local function taintable() + return (InCombatLockdown() or (UnitAffectingCombat('player') or UnitAffectingCombat('pet'))) +end + +-- /* checks if the texture we are trying to set it */ +local function check_texture(arg1, arg2) + if arg1:GetTexture() ~= arg2 then arg1:SetTexture(arg2) end +end + +-- /* create movable frame */ +local function console_anchor(parent, saved, shifthk) + local frame = parent or self + frame:SetMovable(true) + frame:SetUserPlaced(true) + frame:SetClampedToScreen(true) + frame:EnableMouse(true) + frame:RegisterForDrag('LeftButton') + frame:SetScript('OnDragStart', function() + if shifthk and not IsShiftKeyDown() then return end + frame:StartMoving() + end) + frame:SetScript('OnDragStop', function() + frame:StopMovingOrSizing() + if saved then + local orig, _, tar, x, y = frame:GetPoint() + _appdata['elements_anchor'][frame:GetName()] = {orig, 'UIParent', tar, x, y} + end + end) +end + +-- /* create main font */ +local pUiFont = CreateFont('pUiFont') +pUiFont:SetFont([[Interface\AddOns\pw_unitframes\assets\PTSans-Bold.ttf]], 14) +pUiFont:SetShadowColor(0, 0, 0, 1) +pUiFont:SetShadowOffset(1,-1) +local pUiFont_Auras = CreateFont('pUiFont_Auras') +pUiFont_Auras:SetFont(pUiFont:GetFont(), 10, 'OUTLINE') + +-- /* callback */ +addon.texcoord = texcoord +addon.noop = noop +addon.taint = taintable +addon.eject = eject +addon.backdrop = backdrop +addon.check_texture = check_texture +addon.console_anchor = console_anchor \ No newline at end of file diff --git a/core/core.xml b/core/core.xml new file mode 100644 index 0000000..030d948 --- /dev/null +++ b/core/core.xml @@ -0,0 +1,8 @@ + +