Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ TODO
* Voir si il y'a pas d'autres option que l'on peut ajouter à la frame options de multibot
* Faire en sorte que le strata soit appliqué a vraiment toutes les frames de multibot
* creer le multilangue pour le tooltip: setTooltip(self, "Show / Hide / Move Quick Shaman") des fichiers quickshaman et quickhunter
* Livres des sorts: faire en sorte que l'icone de regrise quand on le ferme avec la croix de la frame


Ajouter la fonction unequipe à Multibit:
Expand Down
26 changes: 13 additions & 13 deletions UI/MultiBotGameObjectCopyFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ local Shared = MultiBot.QuestUIShared or {}
local CopyFrame = MultiBot.GameObjectCopyFrame or {}
MultiBot.GameObjectCopyFrame = CopyFrame

local function focusAndSelect(editor)
local editBox = editor and editor.editBox
if editBox and editBox.SetFocus then
editBox:SetFocus()
end
if editBox and editBox.HighlightText then
editBox:HighlightText()
end
end

function MultiBot.ShowGameObjectCopyBox()
local frame = MultiBot.InitializeGameObjectCopyFrame()
if not frame then
Expand All @@ -18,14 +28,7 @@ function MultiBot.ShowGameObjectCopyBox()
local text = Shared.BuildGameObjectCopyText and Shared.BuildGameObjectCopyText(bots) or ""
frame.editor:SetText(text)
frame.window:Show()

local editBox = frame.editor and frame.editor.editBox
if editBox and editBox.SetFocus then
editBox:SetFocus()
end
if editBox and editBox.HighlightText then
editBox:HighlightText()
end
focusAndSelect(frame.editor)
end

function MultiBot.InitializeGameObjectCopyFrame()
Expand All @@ -49,6 +52,7 @@ function MultiBot.InitializeGameObjectCopyFrame()
window:EnableResize(false)
window:SetLayout("Fill")
window.frame:SetFrameStrata("DIALOG")

if MultiBot.SetAceWindowCloseToHide then MultiBot.SetAceWindowCloseToHide(window) end
if MultiBot.RegisterAceWindowEscapeClose then MultiBot.RegisterAceWindowEscapeClose(window, "GameObjCopy") end
if MultiBot.BindAceWindowPosition then MultiBot.BindAceWindowPosition(window, "gameobject_copy") end
Expand All @@ -65,14 +69,10 @@ function MultiBot.InitializeGameObjectCopyFrame()
if editor.editBox and editor.editBox.SetTextInsets then
editor.editBox:SetTextInsets(6, 6, 6, 6)
end
if editor.scrollBG and Shared.ApplyPanelStyle then
Shared.ApplyPanelStyle(editor.scrollBG, 0.92)
elseif editor.frame and Shared.ApplyPanelStyle then
Shared.ApplyPanelStyle(editor.frame, 0.92)
end

CopyFrame.window = window
CopyFrame.editor = editor
CopyFrame.aceGUI = aceGUI
MultiBot.GameObjCopyBox = CopyFrame
return CopyFrame
end
67 changes: 31 additions & 36 deletions UI/MultiBotGameObjectResultsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,52 @@ local Shared = MultiBot.QuestUIShared or {}
local ResultsFrame = MultiBot.GameObjectResultsFrame or {}
MultiBot.GameObjectResultsFrame = ResultsFrame

function MultiBot.ShowGameObjectPopup()
local frame = MultiBot.InitializeGameObjectResultsFrame()
if not frame then
return
end

if frame.window:IsShown() then
frame.window:Hide()
local function clearResults(frame)
if frame and frame.scroll then
frame.scroll:ReleaseChildren()
end
end

frame.scroll:ReleaseChildren()
local function addLabel(aceGUI, parent, text)
local label = aceGUI:Create("Label")
label:SetFullWidth(true)
label:SetText(text or "")
parent:AddChild(label)
return label
end

local aceGUI = MultiBot.ResolveAceGUI and MultiBot.ResolveAceGUI("AceGUI-3.0 is required for MB_GameObjPopup") or nil
if not aceGUI then
return
end
local function renderGameObjectResults(frame)
clearResults(frame)

local aceGUI = frame.aceGUI
local bots = Shared.CollectSortedGameObjectBots and Shared.CollectSortedGameObjectBots() or {}

for _, bot in ipairs(bots) do
local botLabel = aceGUI:Create("Label")
botLabel:SetFullWidth(true)
botLabel:SetText("Bot: |cff80ff80" .. bot .. "|r")
frame.scroll:AddChild(botLabel)
addLabel(aceGUI, frame.scroll, "Bot: |cff80ff80" .. bot .. "|r")

for _, textLine in ipairs(Shared.GetGameObjectEntries(bot) or {}) do
local line = aceGUI:Create("Label")
line:SetFullWidth(true)
if Shared.IsDashedSectionHeader(textLine) then
line:SetText("|cffffff66" .. textLine .. "|r")
addLabel(aceGUI, frame.scroll, "|cffffff66" .. textLine .. "|r")
else
line:SetText(" " .. textLine)
addLabel(aceGUI, frame.scroll, " " .. textLine)
end
frame.scroll:AddChild(line)
end

local spacer = aceGUI:Create("Label")
spacer:SetFullWidth(true)
spacer:SetText(" ")
frame.scroll:AddChild(spacer)
addLabel(aceGUI, frame.scroll, " ")
end

if #bots == 0 then
local noData = aceGUI:Create("Label")
noData:SetFullWidth(true)
noData:SetText(MultiBot.L("tips.quests.gobnosearchdata"))
frame.scroll:AddChild(noData)
addLabel(aceGUI, frame.scroll, MultiBot.L("tips.quests.gobnosearchdata") or "")
end
end

function MultiBot.ShowGameObjectPopup()
local frame = MultiBot.InitializeGameObjectResultsFrame()
if not frame then
return
end

renderGameObjectResults(frame)
frame.window:Show()
end

Expand All @@ -74,8 +72,9 @@ function MultiBot.InitializeGameObjectResultsFrame()
window:SetWidth(420)
window:SetHeight(380)
window:EnableResize(false)
window:SetLayout("Flow")
window:SetLayout("List")
window.frame:SetFrameStrata("DIALOG")

if MultiBot.SetAceWindowCloseToHide then MultiBot.SetAceWindowCloseToHide(window) end
if MultiBot.RegisterAceWindowEscapeClose then MultiBot.RegisterAceWindowEscapeClose(window, "GameObjPopup") end
if MultiBot.BindAceWindowPosition then MultiBot.BindAceWindowPosition(window, "gameobject_popup") end
Expand All @@ -86,11 +85,6 @@ function MultiBot.InitializeGameObjectResultsFrame()
scroll:SetLayout("List")
window:AddChild(scroll)

local buttonSpacer = aceGUI:Create("Label")
buttonSpacer:SetFullWidth(true)
buttonSpacer:SetText(" ")
window:AddChild(buttonSpacer)

local copyButton = aceGUI:Create("Button")
copyButton:SetText(MultiBot.L("tips.quests.gobselectall"))
copyButton:SetWidth(170)
Expand All @@ -104,6 +98,7 @@ function MultiBot.InitializeGameObjectResultsFrame()
ResultsFrame.window = window
ResultsFrame.scroll = scroll
ResultsFrame.copyButton = copyButton
ResultsFrame.aceGUI = aceGUI
MultiBot.GameObjPopup = ResultsFrame
return ResultsFrame
end
Loading
Loading