Prepare for release 1.0.1
This commit is contained in:
@@ -63,7 +63,6 @@ end
|
||||
function Main:SetupSlashCommands()
|
||||
SLASH_Guda1 = "/Guda"
|
||||
SLASH_Guda2 = "/guda"
|
||||
SLASH_Guda3 = "/gn"
|
||||
|
||||
SlashCmdList["Guda"] = function(msg)
|
||||
msg = string.lower(msg or "")
|
||||
@@ -76,10 +75,6 @@ function Main:SetupSlashCommands()
|
||||
-- Toggle bank
|
||||
addon.Modules.BankFrame:Toggle()
|
||||
|
||||
elseif msg == "char" or msg == "chars" or msg == "characters" then
|
||||
-- Toggle character selector
|
||||
addon.Modules.CharacterSelector:Toggle()
|
||||
|
||||
elseif msg == "sort" then
|
||||
-- Sort bags
|
||||
addon.Modules.SortEngine:SortBags()
|
||||
|
||||
@@ -23,14 +23,12 @@ Sorting\SortEngine.lua
|
||||
UI\ItemButton.lua
|
||||
UI\BagFrame.lua
|
||||
UI\BankFrame.lua
|
||||
UI\CharacterSelector.lua
|
||||
UI\MoneyDisplay.lua
|
||||
UI\SettingsPopup.lua
|
||||
|
||||
UI\ItemButton.xml
|
||||
UI\BagFrame.xml
|
||||
UI\BankFrame.xml
|
||||
UI\CharacterSelector.xml
|
||||
UI\SettingsPopup.xml
|
||||
|
||||
Core\Main.lua
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
-- Guda Character Selector
|
||||
-- Select character to view bags/bank
|
||||
|
||||
local addon = Guda
|
||||
|
||||
local CharacterSelector = {}
|
||||
addon.Modules.CharacterSelector = CharacterSelector
|
||||
|
||||
local charButtons = {}
|
||||
|
||||
-- OnLoad
|
||||
function Guda_CharacterSelector_OnLoad(self)
|
||||
getglobal(self:GetName().."_Title"):SetText("Select Character")
|
||||
addon:Debug("Character selector loaded")
|
||||
end
|
||||
|
||||
-- OnShow
|
||||
function Guda_CharacterSelector_OnShow(self)
|
||||
CharacterSelector:Update()
|
||||
end
|
||||
|
||||
-- Toggle visibility
|
||||
function CharacterSelector:Toggle()
|
||||
if Guda_CharacterSelector:IsShown() then
|
||||
Guda_CharacterSelector:Hide()
|
||||
else
|
||||
Guda_CharacterSelector:Show()
|
||||
end
|
||||
end
|
||||
|
||||
-- Update character list
|
||||
function CharacterSelector:Update()
|
||||
-- Clear existing buttons
|
||||
for _, button in ipairs(charButtons) do
|
||||
button:Hide()
|
||||
end
|
||||
charButtons = {}
|
||||
|
||||
-- Get all characters
|
||||
local characters = addon.Modules.DB:GetAllCharacters(true) -- Same faction only
|
||||
local characterList = getglobal("Guda_CharacterSelector_CharacterList")
|
||||
|
||||
-- Create buttons for each character
|
||||
local yOffset = -10
|
||||
for i, char in ipairs(characters) do
|
||||
local button = self:GetCharacterButton(i)
|
||||
|
||||
-- Set text with class color
|
||||
local classColor = addon.Modules.Utils:GetClassColor(char.class)
|
||||
local coloredName = addon.Modules.Utils:ColorText(char.name, classColor.r, classColor.g, classColor.b)
|
||||
|
||||
button:SetText(string.format("%s (Lv %d)", coloredName, char.level))
|
||||
button.charData = char
|
||||
|
||||
-- Position
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint("TOP", characterList, "TOP", 0, yOffset)
|
||||
yOffset = yOffset - 35
|
||||
|
||||
button:Show()
|
||||
table.insert(charButtons, button)
|
||||
end
|
||||
|
||||
if table.getn(characters) == 0 then
|
||||
addon:Debug("No other characters found")
|
||||
end
|
||||
end
|
||||
|
||||
-- Get or create character button
|
||||
function CharacterSelector:GetCharacterButton(index)
|
||||
local name = "Guda_CharButton" .. index
|
||||
local characterList = getglobal("Guda_CharacterSelector_CharacterList")
|
||||
|
||||
local button = getglobal(name)
|
||||
if not button then
|
||||
button = CreateFrame("Button", name, characterList, "Guda_CharacterButtonTemplate")
|
||||
end
|
||||
|
||||
return button
|
||||
end
|
||||
|
||||
-- Character button OnClick
|
||||
function Guda_CharacterButton_OnClick(self)
|
||||
if not self.charData then
|
||||
return
|
||||
end
|
||||
|
||||
addon:Print("Viewing %s's bags", self.charData.name)
|
||||
|
||||
-- Show bags for this character
|
||||
addon.Modules.BagFrame:ShowCharacter(self.charData.fullName)
|
||||
|
||||
-- Close selector
|
||||
Guda_CharacterSelector:Hide()
|
||||
|
||||
-- Show bag frame if not visible
|
||||
if not Guda_BagFrame:IsShown() then
|
||||
Guda_BagFrame:Show()
|
||||
end
|
||||
end
|
||||
|
||||
-- Character button OnEnter
|
||||
function Guda_CharacterButton_OnEnter(self)
|
||||
if not self.charData then
|
||||
return
|
||||
end
|
||||
|
||||
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
|
||||
GameTooltip:AddLine(self.charData.name, 1, 1, 1)
|
||||
GameTooltip:AddLine("Level " .. self.charData.level .. " " .. self.charData.class, 0.7, 0.7, 0.7)
|
||||
GameTooltip:AddLine("Money: " .. addon.Modules.Utils:FormatMoney(self.charData.money))
|
||||
|
||||
if self.charData.lastUpdate then
|
||||
GameTooltip:AddLine("Last seen: " .. addon.Modules.Utils:FormatTimeAgo(self.charData.lastUpdate), 0.5, 0.5, 0.5)
|
||||
end
|
||||
|
||||
GameTooltip:Show()
|
||||
end
|
||||
|
||||
-- Show current character
|
||||
function Guda_CharacterSelector_ShowCurrent()
|
||||
addon.Modules.BagFrame:ShowCurrentCharacter()
|
||||
Guda_CharacterSelector:Hide()
|
||||
|
||||
if not Guda_BagFrame:IsShown() then
|
||||
Guda_BagFrame:Show()
|
||||
end
|
||||
end
|
||||
@@ -1,115 +0,0 @@
|
||||
<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/">
|
||||
|
||||
<!-- Character Button Template -->
|
||||
<Button name="Guda_CharacterButtonTemplate" virtual="true" inherits="UIPanelButtonTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="240" y="30"/>
|
||||
</Size>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Guda_CharacterButton_OnClick(this)
|
||||
</OnClick>
|
||||
<OnEnter>
|
||||
Guda_CharacterButton_OnEnter(this)
|
||||
</OnEnter>
|
||||
<OnLeave>
|
||||
GameTooltip:Hide()
|
||||
</OnLeave>
|
||||
</Scripts>
|
||||
</Button>
|
||||
|
||||
<!-- Character Selector Frame -->
|
||||
<Frame name="Guda_CharacterSelector" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent">
|
||||
<Size>
|
||||
<AbsDimension x="280" y="400"/>
|
||||
</Size>
|
||||
|
||||
<Anchors>
|
||||
<Anchor point="CENTER" relativePoint="CENTER" relativeTo="UIParent">
|
||||
<Offset>
|
||||
<AbsDimension x="0" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
|
||||
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
|
||||
<BackgroundInsets>
|
||||
<AbsInset left="11" right="12" top="12" bottom="11"/>
|
||||
</BackgroundInsets>
|
||||
<TileSize>
|
||||
<AbsValue val="32"/>
|
||||
</TileSize>
|
||||
<EdgeSize>
|
||||
<AbsValue val="32"/>
|
||||
</EdgeSize>
|
||||
</Backdrop>
|
||||
|
||||
<Layers>
|
||||
<!-- Title -->
|
||||
<Layer level="ARTWORK">
|
||||
<FontString name="$parent_Title" inherits="GameFontNormalLarge">
|
||||
<Anchors>
|
||||
<Anchor point="TOP" x="0" y="-15"/>
|
||||
</Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
|
||||
<Frames>
|
||||
<!-- Close Button -->
|
||||
<Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
|
||||
<Anchors>
|
||||
<Anchor point="TOPRIGHT" x="-5" y="-5"/>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Guda_CharacterSelector:Hide()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
|
||||
<!-- Current Character Button -->
|
||||
<Button name="$parent_CurrentCharButton" inherits="UIPanelButtonTemplate" text="Current Character">
|
||||
<Size>
|
||||
<AbsDimension x="240" y="30"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOP" x="0" y="-45"/>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Guda_CharacterSelector_ShowCurrent()
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
|
||||
<!-- Character List Container -->
|
||||
<Frame name="$parent_CharacterList">
|
||||
<Size>
|
||||
<AbsDimension x="260" y="310"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="TOP" x="0" y="-85"/>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
</Frames>
|
||||
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Guda_CharacterSelector_OnLoad(this)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
Guda_CharacterSelector_OnShow(this)
|
||||
</OnShow>
|
||||
<OnMouseDown>
|
||||
if (arg1 == "LeftButton") then
|
||||
this:StartMoving()
|
||||
end
|
||||
</OnMouseDown>
|
||||
<OnMouseUp>
|
||||
this:StopMovingOrSizing()
|
||||
</OnMouseUp>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
</Ui>
|
||||
Reference in New Issue
Block a user