Skip to content

Commit

Permalink
Next window option fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vae2009 committed Feb 14, 2025
1 parent edfd501 commit e4253fb
Show file tree
Hide file tree
Showing 16 changed files with 1,756 additions and 61 deletions.
2 changes: 1 addition & 1 deletion ConRO.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Title:-|cffFFFFFFConRO|r- Conflict Rotation Optimizer
## Notes: Rotation helper framework.
## Version: 11.0.16
## Version: 11.0.17
## Author: Vae
## Interface: 110007
## SavedVariables: ConROPreferences
Expand Down
26 changes: 26 additions & 0 deletions Libs/AceGUI-3.0_SFX-Widgets/AceGUI-3.0_SFX-Widgets.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Interface: 11504, 40400, 40401, 110002, 110005

## Author: StormFX
## Title: AceGUI-3.0: SFX Widgets
## Version: 1.3.11

## IconTexture: Interface\AddOns\AceGUI-3.0_SFX-Widgets\Textures\Icon
## OptionalDeps: Ace3

## Notes: Adds custom widgets to AceGUI-3.0 and AceConfigDialog-3.0.
## Notes-itIT: Aggiungi widgets personalizzati ad AceGUI-3.0 e AceConfigDialog-3.0.
## Notes-koKR: AceGUI-3.0 및 AceConfigDialog-3.0에 사용자 정의 위젯을 추가합니다.
## Notes-ruRU: Добавляет настраиваемые виджеты для AceGUI-3.0 и AceConfigDialog-3.0.
## Notes-zhTW: 新增自訂的小套件到 AceGUI-3.0 和 AceConfigDialog-3.0。

## X-Category: Library
## X-Credits: The Ace3 Team
## X-Discord: https://discord.gg/7MTWRgDzz8
## X-Website: https://github.com/SFX-WoW/AceGUI-3.0_SFX-Widgets

## X-Curse-Project-ID: 340803
## X-Wago-ID: RaN0zvKj
## X-WoWI-ID: 25658

LibStub\LibStub.lua
AceGUI-3.0_SFX-Widgets.xml
7 changes: 7 additions & 0 deletions Libs/AceGUI-3.0_SFX-Widgets/AceGUI-3.0_SFX-Widgets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="Widgets\SFX-Header.lua"/>
<Script file="Widgets\SFX-Header-II.lua"/>
<Script file="Widgets\SFX-Info.lua"/>
<Script file="Widgets\SFX-Info-URL.lua"/>
</Ui>
51 changes: 51 additions & 0 deletions Libs/AceGUI-3.0_SFX-Widgets/LibStub/LibStub.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info
-- LibStub is hereby placed in the Public Domain
-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
local LibStub = _G[LIBSTUB_MAJOR]

-- Check to see is this version of the stub is obsolete
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR

-- LibStub:NewLibrary(major, minor)
-- major (string) - the major version of the library
-- minor (string or number ) - the minor version of the library
--
-- returns nil if a newer or same version of the lib is already present
-- returns empty library object or old library object if upgrade is needed
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")

local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor
end

-- LibStub:GetLibrary(major, [silent])
-- major (string) - the major version of the library
-- silent (boolean) - if true, library is optional, silently return nil if its not found
--
-- throws an error if the library can not be found (except silent is set)
-- returns the library object if found
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end
return self.libs[major], self.minors[major]
end

-- LibStub:IterateLibraries()
--
-- Returns an iterator for the currently registered libraries
function LibStub:IterateLibraries()
return pairs(self.libs)
end

setmetatable(LibStub, { __call = LibStub.GetLibrary })
end
Binary file added Libs/AceGUI-3.0_SFX-Widgets/Textures/Icon.tga
Binary file not shown.
156 changes: 156 additions & 0 deletions Libs/AceGUI-3.0_SFX-Widgets/Widgets/SFX-Header-II.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
--[[
This file is part of 'AceGUI-3.0: SFX Widgets', an add-on for World of Warcraft. For bug reports,
documentation and license information, visit https://github.com/SFX-WoW/AceGUI-3.0_SFX-Widgets.
* File...: SFX-Header-II.lua
* Author.: StormFX
]]

----------------------------------------
-- Locals
---

local Type, Version = "SFX-Header-II", 1
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)

-- Exit if a current or newer version is loaded.
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

----------------------------------------
-- Lua API
---

local gsub, pairs = string.gsub, pairs

----------------------------------------
-- WoW API
---

local CreateFrame, UIParent = CreateFrame, UIParent

----------------------------------------
-- Utililty
---

-- Updates the border's visibility.
local function UpdateBorder(self)
local Height = 26

if self.disabled then
self.Border:Hide()
Height = 18
elseif self.Text == "" then
self.Border:Show()
Height = 18
else
self.Border:Show()
end

self:SetHeight(Height)
end

----------------------------------------
-- Widget Methods
---

local Methods = {

-- Widget:OnAcquire()
-- Fires when the widget is initialized.
OnAcquire = function(self)
-- Reset the widget.
self.disabled = nil
self:SetText()
self:SetFullWidth(true)
end,

-- Widget:SetDisabled()
-- Sets the text alignment.
SetCenter = function(self, Center)
Center = (Center and self.Text ~= "") or nil
self.Center = Center

local Label = self.Label

if Center then
Label:ClearAllPoints()
Label:SetPoint("TOP", 0, -3)
else
Label:ClearAllPoints()
Label:SetPoint("TOPLEFT", 0, -3)
end

UpdateBorder(self)
end,

-- Widget:SetDisabled()
-- Toggles the border.
SetDisabled = function(self, Disabled)
self.disabled = Disabled
UpdateBorder(self)
end,

-- Widget:SetText()
-- Sets the header text.
SetText = function(self, Text)
local Title, Count = gsub(Text or "", ">>>", "")

self.Text = Title

local Label = self.Label
Label:SetText(Title)

if Title == "" then
self.Border:ClearPoint("TOP")
else
self.Border:SetPoint("TOP", Label, "BOTTOM", 0, 2)
end

self:SetCenter(Count > 0)
end,

-- Unused Methods
-- OnRelease = nil,
-- OnHeightSet = nil,
-- OnWidthSet = nil,
}

----------------------------------------
-- Constructor
---

local function Constructor()
local Frame = CreateFrame("Frame", nil, UIParent)
Frame:Hide()

local Label = Frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
Label:SetJustifyH("CENTER")
Label:SetPoint("TOPLEFT", 0, -3)

local Border = Frame:CreateTexture(nil, "BACKGROUND")
Border:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
Border:SetTexCoord(0.81, 0.94, 0.5, 1)
Border:SetVertexColor(0.6, 0.6, 0.6)
Border:SetHeight(8)
Border:SetPoint("TOP", Label, "BOTTOM", 0, 2)
Border:SetPoint("RIGHT")
Border:SetPoint("LEFT")

local Widget = {
type = Type,
frame = Frame,

Label = Label,
Border = Border,
}

for method, func in pairs(Methods) do
Widget[method] = func
end

return AceGUI:RegisterAsWidget(Widget)
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)
Loading

0 comments on commit e4253fb

Please sign in to comment.