Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit 6ddcba3

Browse files
Merge branch 'main' into Add-frame-to-display-reputations-and-curencies
2 parents bb75b8c + 3307154 commit 6ddcba3

12 files changed

Lines changed: 116 additions & 55 deletions

.luacheckrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ globals = {
2626
"UnitIsConnected", "event", "arg1", "arg2", "MultiBotSaved", "GetUnitName", "GetTime", "GetNumMacros", "ReloadUI", "GetQuestLogLeaderBoard", "AbandonQuest",
2727
"GetMacroIconInfo", "GetPlayerInfoByGUID", "UnitGUID", "ConvertToRaid", "HandleQuestsAllResponse", "UnitXPMax", "UnitXP", "UnitManaMax", "UnitMana",
2828
"GetCurrentMapContinent", "GetCurrentMapAreaID", "SLASH_MULTIBOT1", "SLASH_MULTIBOT2", "SLASH_MULTIBOT3", "SLASH_MULTIBOTOPTIONS1", "SLASH_MBFAKEGM1",
29-
"SLASH_MBCLASS1", "SLASH_MBCLASSTEST1", "icon", "FauxScrollFrame_OnVerticalScroll", "FauxScrollFrame_GetOffset", "FauxScrollFrame_Update", "UIDropDownMenu_SetText",
29+
"SLASH_MBCLASS1", "SLASH_MBCLASSTEST1", "icon", "FauxScrollFrame_OnVerticalScroll", "FauxScrollFrame_GetOffset", "FauxScrollFrame_Update",
3030
"time", "UIDropDownMenu_SetText", "UIDropDownMenu_SetWidth", "UIDropDownMenu_Initialize", "UIDropDownMenu_CreateInfo",
31-
"UIDropDownMenu_AddButton", "UIDropDownMenu_SetSelectedValue", "isFav"
32-
31+
"UIDropDownMenu_AddButton", "UIDropDownMenu_SetSelectedValue", "isFav", "ToggleDropDownMenu"
3332
}
3433

3534
read_globals = {

Core/MultiBot.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4553,6 +4553,9 @@ MultiBot.tips.raidus.level =
45534553
MultiBot.tips.raidus.class =
45544554
"|cffffff00Sort Bots by Class|r";
45554555

4556+
MultiBot.tips.raidus.slot =
4557+
"|cffffff00Select Raidus save slot|r";
4558+
45564559
MultiBot.tips.raidus.autobalance =
45574560
"|cffffff00Auto-Balance Raid|r\n|cffffffff"..
45584561
"Automatically arranges bots into raid groups for a more balanced setup.|r\n"..

Core/MultiBotEngine.lua

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ function MultiBot.UpdateClickBlocker(frame)
755755
end
756756

757757
local minL, maxR, minB, maxT
758+
local foundButton = false
758759

759760
local function consider(l, r, b, t)
760761
if(not l or not r or not b or not t) then return end
@@ -769,23 +770,21 @@ function MultiBot.UpdateClickBlocker(frame)
769770

770771
if(f.buttons) then
771772
for _, b in pairs(f.buttons) do
772-
if(b and b.IsShown and b:IsShown()) then
773+
if(b and b.IsVisible and b:IsVisible()) then
773774
consider(b:GetLeft(), b:GetRight(), b:GetBottom(), b:GetTop())
775+
foundButton = true
774776
end
775777
end
776778
end
777-
778-
if(f.frames) then
779-
for _, sf in pairs(f.frames) do
780-
scan(sf)
781-
end
782-
end
783779
end
784780

785-
-- fallback minimal : la zone du frame lui-même
786-
consider(frame:GetLeft(), frame:GetRight(), frame:GetBottom(), frame:GetTop())
787781
scan(frame)
788782

783+
if(not foundButton) then
784+
cb:Hide()
785+
return
786+
end
787+
789788
if(not minL or not maxR or not minB or not maxT) then
790789
cb:Hide()
791790
return

Features/MultiBotRaidus.lua

Lines changed: 85 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -187,50 +187,47 @@ MultiBot.raidus.wowButton("Load", -762, 360, 80, 20, 12)
187187
end
188188
end
189189

190-
MultiBot.raidus.wowButton("1", -734, 360, 22, 20, 12).setDisable()
191-
.doLeft = function(pButton)
192-
if(pButton.state) then
193-
pButton.parent.save = ""
194-
pButton.setDisable()
195-
MultiBot.raidus.setRaidus()
196-
else
197-
pButton.parent.save = "1"
198-
pButton.parent.buttons["2"].setDisable()
199-
pButton.parent.buttons["3"].setDisable()
200-
pButton.setEnable()
201-
MultiBot.raidus.setRaidus()
190+
local function UpdateRaidusSlotButtonText(button)
191+
local label = "Slot"
192+
if MultiBot.raidus.save ~= "" then
193+
label = "Slot " .. MultiBot.raidus.save
202194
end
195+
button.text:SetText("|cffffcc00" .. label .. "|r")
203196
end
204197

205-
MultiBot.raidus.wowButton("2", -707, 360, 22, 20, 12).setDisable()
206-
.doLeft = function(pButton)
207-
if(pButton.state) then
208-
pButton.parent.save = ""
209-
pButton.setDisable()
210-
MultiBot.raidus.setRaidus()
211-
else
212-
pButton.parent.save = "2"
213-
pButton.parent.buttons["1"].setDisable()
214-
pButton.parent.buttons["3"].setDisable()
215-
pButton.setEnable()
216-
MultiBot.raidus.setRaidus()
198+
local slotDropDown = CreateFrame("Frame", "MultiBotRaidusSlotDropDown", MultiBot.raidus, "UIDropDownMenuTemplate")
199+
UIDropDownMenu_SetWidth(slotDropDown, 80)
200+
UIDropDownMenu_Initialize(slotDropDown, function(self, level)
201+
for i = 1, 10 do
202+
local info = UIDropDownMenu_CreateInfo()
203+
info.text = tostring(i)
204+
info.value = tostring(i)
205+
info.func = function()
206+
MultiBot.raidus.save = tostring(i)
207+
UIDropDownMenu_SetSelectedValue(slotDropDown, tostring(i))
208+
UpdateRaidusSlotButtonText(MultiBot.raidus.buttons["Slot"])
209+
MultiBot.raidus.setRaidus()
210+
end
211+
UIDropDownMenu_AddButton(info, level)
217212
end
218-
end
213+
end)
219214

220-
MultiBot.raidus.wowButton("3", -680, 360, 22, 20, 12).setDisable()
221-
.doLeft = function(pButton)
222-
if(pButton.state) then
223-
pButton.parent.save = ""
224-
pButton.setDisable()
225-
MultiBot.raidus.setRaidus()
226-
else
227-
pButton.parent.save = "3"
228-
pButton.parent.buttons["1"].setDisable()
229-
pButton.parent.buttons["2"].setDisable()
230-
pButton.setEnable()
231-
MultiBot.raidus.setRaidus()
215+
local slotButton = MultiBot.raidus.wowButton("Slot", -682, 360, 80, 20, 12)
216+
slotButton.tip = MultiBot.tips.raidus.slot
217+
slotButton:SetScript("OnEnter", function(self)
218+
GameTooltip:SetOwner(self, "ANCHOR_TOP")
219+
GameTooltip:SetText(self.tip or "", 1, 1, 1, true)
220+
end)
221+
slotButton:SetScript("OnLeave", function()
222+
GameTooltip:Hide()
223+
end)
224+
slotButton.doLeft = function()
225+
if MultiBot.raidus.save ~= "" then
226+
UIDropDownMenu_SetSelectedValue(slotDropDown, MultiBot.raidus.save)
232227
end
228+
ToggleDropDownMenu(1, nil, slotDropDown, slotButton, 0, 0)
233229
end
230+
UpdateRaidusSlotButtonText(slotButton)
234231

235232
-- Contrôle du mode Tri, "Score / Level / Class"
236233
local sortBaseX = -300 -- position du bouton "Score", pour déplacer tout le groupe il faut modifier cette valeur
@@ -356,13 +353,13 @@ MultiBot.raidus.wowButton("Apply", -514, 360, 80, 20, 12)
356353

357354
local tSelf = UnitName("player")
358355
MultiBot.index.raidus = {}
356+
local tSelected = 0
357+
local selectedNames = {}
359358

360359
for tName, tValue in pairs(MultiBot.frames["MultiBar"].frames["Units"].buttons) do
361360
if(tValue.state) then
362-
if(tName ~= tSelf and tRaidByName[tName] == nil) then
363-
if(UnitInGroup(tName) or UnitInRaid(tName)) then UninviteUnit(tName) end
364-
SendChatMessage(".playerbot bot remove " .. tName, "SAY")
365-
end
361+
tSelected = tSelected + 1
362+
selectedNames[tName] = true
366363
else
367364
if(tName ~= tSelf and tRaidByName[tName] ~= nil) then
368365
table.insert(MultiBot.index.raidus, tName)
@@ -372,7 +369,53 @@ MultiBot.raidus.wowButton("Apply", -514, 360, 80, 20, 12)
372369

373370
local tNeeds = #MultiBot.index.raidus
374371

375-
if(tNeeds > 0) then
372+
local usedLayoutFallback = false
373+
374+
local tFallback = {}
375+
local hasLayoutOnly = false
376+
for tName, _ in pairs(tRaidByName) do
377+
if tName ~= tSelf then
378+
if not selectedNames[tName] then
379+
hasLayoutOnly = true
380+
end
381+
if not MultiBot.isMember(tName) then
382+
table.insert(tFallback, tName)
383+
end
384+
end
385+
end
386+
387+
if tSelected == 0 or hasLayoutOnly then
388+
if #tFallback > 0 then
389+
MultiBot.index.raidus = tFallback
390+
tNeeds = #tFallback
391+
usedLayoutFallback = true
392+
end
393+
end
394+
395+
local tRaidByMembers = MultiBot.raidus.getRaidState()
396+
for tName, _ in pairs(tRaidByMembers) do
397+
if tName ~= tSelf and tRaidByName[tName] == nil then
398+
if MultiBot.isMember(tName) then
399+
UninviteUnit(tName)
400+
end
401+
SendChatMessage(".playerbot bot remove " .. tName, "SAY")
402+
end
403+
end
404+
405+
local tList = ""
406+
if tNeeds > 0 then
407+
tList = table.concat(MultiBot.index.raidus, ", ")
408+
end
409+
if usedLayoutFallback then
410+
SendChatMessage("Raidus Apply: using layout list, selected=" .. tSelected .. " toInvite=" .. tNeeds, "SAY")
411+
else
412+
SendChatMessage("Raidus Apply: selected=" .. tSelected .. " toInvite=" .. tNeeds, "SAY")
413+
end
414+
if tList ~= "" then
415+
SendChatMessage("Raidus Apply list: " .. tList, "SAY")
416+
end
417+
418+
if(tNeeds > 0) then
376419
SendChatMessage(MultiBot.info.starting, "SAY")
377420
MultiBot.timer.invite.roster = "raidus"
378421
MultiBot.timer.invite.needs = tNeeds

Locales/MultiBotLanguage-deDE.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3336,6 +3336,8 @@ MultiBot.tips.group.group =
33363336

33373337
MultiBot.tips.raidus.class = "|cffffff00Bots nach Klasse sortieren|r"
33383338

3339+
MultiBot.tips.raidus.slot = "|cffffff00Raidus-Speicherslot auswählen|r"
3340+
33393341
MultiBot.tips.raidus.autobalance = "|cffffff00Automatisches Raid-Balancing|r\n|cffffffff"
33403342
.. "Ordnet Bots automatisch in Raid-Gruppen für ein ausgewogeneres Setup.|r\n"
33413343
.. "|cffff0000Linksklick:|r |cffffffffBalancing nach Punktzahl (gesamte Raidstärke).|r\n"

Locales/MultiBotLanguage-enGB.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,8 @@ MultiBot.tips.group.group =
32583258

32593259
MultiBot.tips.raidus.class = "|cffffff00Sort Bots by Class|r"
32603260

3261+
MultiBot.tips.raidus.slot = "|cffffff00Select Raidus save slot|r"
3262+
32613263
MultiBot.tips.raidus.autobalance = "|cffffff00Auto-Balance Raid|r\n|cffffffff"
32623264
.. "Automatically arranges bots into raid groups for a more balanced setup.|r\n"
32633265
.. "|cffff0000Left-Click:|r |cffffffffBalance by score (overall raid power).|r\n"

Locales/MultiBotLanguage-enUS.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,8 @@ MultiBot.tips.group.group =
32583258

32593259
MultiBot.tips.raidus.class = "|cffffff00Sort Bots by Class|r"
32603260

3261+
MultiBot.tips.raidus.slot = "|cffffff00Select Raidus save slot|r"
3262+
32613263
MultiBot.tips.raidus.autobalance = "|cffffff00Auto-Balance Raid|r\n|cffffffff"
32623264
.. "Automatically arranges bots into raid groups for a more balanced setup.|r\n"
32633265
.. "|cffff0000Left-Click:|r |cffffffffBalance by score (overall raid power).|r\n"

Locales/MultiBotLanguage-esES.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,6 +3344,8 @@ MultiBot.tips.group.group =
33443344

33453345
MultiBot.tips.raidus.class = "|cffffff00Ordenar Bots por Clase|r"
33463346

3347+
MultiBot.tips.raidus.slot = "|cffffff00Seleccionar ranura de guardado de Raidus|r"
3348+
33473349
MultiBot.tips.raidus.autobalance = "|cffffff00Balanceo automático de la Raid|r\n|cffffffff"
33483350
.. "Organiza automáticamente los bots en grupos de raid para una configuración más equilibrada.|r\n"
33493351
.. "|cffff0000Clic izquierdo:|r |cffffffffBalancear por puntuación (poder total de la raid).|r\n"

Locales/MultiBotLanguage-frFR.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3351,14 +3351,17 @@ MultiBot.tips.group.group =
33513351
.. "|cff999999(Ordre d'exécution : Raid, Groupe)|r"
33523352

33533353
-- Raidus
3354-
MultiBot.tips.raidus = {}
33553354

33563355
MultiBot.tips.raidus.score = "|cffffff00Trier les Bots par Score|r"
33573356

33583357
MultiBot.tips.raidus.level = "|cffffff00Trier les Bots par Niveau|r"
33593358

33603359
MultiBot.tips.raidus.class = "|cffffff00Trier les Bots par Classe|r"
33613360

3361+
MultiBot.tips.raidus.slot = "|cffffff00Selectionnez un slot de Sauvegarde Raidus|r";
3362+
3363+
MultiBot.tips.raidus.slot = "|cffffff00Sélectionner l'emplacement de sauvegarde Raidus|r"
3364+
33623365
MultiBot.tips.raidus.autobalance = "|cffffff00Équilibrage automatique du Raid|r\n|cffffffff"
33633366
.. "Arrange automatiquement les bots en groupes de raid pour une configuration plus équilibrée.|r\n"
33643367
.. "|cffff0000Clic gauche:|r |cffffffffÉquilibrage par score (puissance totale du raid).|r\n"

Locales/MultiBotLanguage-koKR.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,6 +3310,8 @@ MultiBot.tips.group.group =
33103310

33113311
MultiBot.tips.raidus.class = "|cffffff00직업으로 봇 정렬|r"
33123312

3313+
MultiBot.tips.raidus.slot = "|cffffff00Sélectionner l'emplacement de sauvegarde Raidus|r"
3314+
33133315
MultiBot.tips.raidus.autobalance = "|cffffff00자동 레이드 균형 조정|r\n|cffffffff"
33143316
.. "더 균형 잡힌 구성을 위해 봇을 자동으로 레이드 그룹에 배치합니다.|r\n"
33153317
.. "|cffff0000왼쪽 클릭:|r |cffffffff점수 기준으로 균형 조정 (전체 레이드 전투력).|r\n"

0 commit comments

Comments
 (0)