Skip to content

Commit cd8ee75

Browse files
committed
feat: add Raidus pool deletion and localized tooltip
1 parent 59c471d commit cd8ee75

10 files changed

Lines changed: 125 additions & 0 deletions

Core/MultiBot.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,27 @@ function MultiBot.SetGlobalBotEntry(name, value)
287287
return value
288288
end
289289

290+
function MultiBot.RemoveGlobalBotEntry(name)
291+
if type(name) ~= "string" or name == "" then
292+
return false
293+
end
294+
295+
local removed = false
296+
local store = MultiBot.Store and MultiBot.Store.GetBotsStore and MultiBot.Store.GetBotsStore()
297+
if store and store[name] ~= nil then
298+
store[name] = nil
299+
removed = true
300+
end
301+
302+
local legacyStore = getLegacyGlobalBotStore()
303+
if legacyStore[name] ~= nil and isGlobalBotRosterEntry(legacyStore[name]) then
304+
legacyStore[name] = nil
305+
removed = true
306+
end
307+
308+
return removed
309+
end
310+
290311
function MultiBot.ClearGlobalBotStore()
291312
local store = MultiBot.Store and MultiBot.Store.EnsureBotsStore and MultiBot.Store.EnsureBotsStore()
292313
if not store then

Features/MultiBotRaidus.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,37 @@ local function applyRaidusLayout(layout)
848848
end
849849
end
850850

851+
-- MB_RAIDUS_POOL_DELETE_V1_BEGIN
852+
if StaticPopupDialogs then
853+
StaticPopupDialogs["MULTIBOT_RAIDUS_DELETE_POOL_BOT"] = {
854+
text = MultiBot.L("raidus.pool.delete.confirm"),
855+
button1 = YES,
856+
button2 = NO,
857+
OnAccept = function(self)
858+
local data = self and self.data
859+
local name = data and data.name
860+
if not name or name == "" or not MultiBot.RemoveGlobalBotEntry then
861+
return
862+
end
863+
864+
local currentLayout = parseRaidusLayoutData(serializeRaidusLayoutFromFrames())
865+
if not MultiBot.RemoveGlobalBotEntry(name) then
866+
return
867+
end
868+
869+
if MultiBot.raidus.setRaidus then
870+
MultiBot.raidus.setRaidus()
871+
applyRaidusLayout(currentLayout)
872+
end
873+
end,
874+
timeout = 0,
875+
whileDead = 1,
876+
hideOnEscape = 1,
877+
preferredIndex = 3,
878+
}
879+
end
880+
-- MB_RAIDUS_POOL_DELETE_V1_END
881+
851882
local RAIDUS_ACTION_BAR_Y = raidusUsesAceWindow and 332 or 360
852883
local RAIDUS_ACTION_SHIFT_X = raidusUsesAceWindow and -20 or 0
853884
local RAIDUS_SORT_SHIFT_X = raidusUsesAceWindow and -55 or 0
@@ -1392,6 +1423,34 @@ MultiBot.raidus.setRaidus = function()
13921423
pButton.tip.addText("5", "|c" .. roleHex .. formatRaidusRoleLabel(botRole) .. "|r |cff333333Score:|r |cffffdd55" .. botScore .. "|r", "BOTTOM", 0, 188, 15)
13931424
pButton.tip.addText("6", "|cff333333Talents:|r |cff505050" .. botTalents .. "|r", "BOTTOM", 0, 172, 14)
13941425
pButton.tip.addText("7", "|cff555555CASH - " .. tReward .. " - GOLD|h", "BOTTOM", 0, 154, 20)
1426+
-- MB_RAIDUS_TOOLTIP_INTERACTION_PANEL_V1_BEGIN
1427+
local interactionPanel = CreateFrame("Frame", nil, pButton.tip)
1428+
interactionPanel:SetPoint("BOTTOM", pButton.tip, "BOTTOM", 0, 96)
1429+
interactionPanel:SetSize(232, 54)
1430+
interactionPanel:EnableMouse(false)
1431+
interactionPanel:SetFrameLevel((pButton.tip:GetFrameLevel() or 0) + 2)
1432+
1433+
if interactionPanel.SetBackdrop then
1434+
interactionPanel:SetBackdrop({
1435+
bgFile = "Interface\\Buttons\\WHITE8X8",
1436+
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
1437+
tile = true,
1438+
tileSize = 8,
1439+
edgeSize = 10,
1440+
insets = { left = 3, right = 3, top = 3, bottom = 3 },
1441+
})
1442+
interactionPanel:SetBackdropColor(0, 0, 0, 0.82)
1443+
interactionPanel:SetBackdropBorderColor(1, 0.82, 0, 0.78)
1444+
end
1445+
1446+
local interactionText = interactionPanel:CreateFontString(nil, "ARTWORK")
1447+
interactionText:SetFont("Fonts\\ARIALN.ttf", 13, "PLAIN")
1448+
interactionText:SetPoint("CENTER", interactionPanel, "CENTER", 0, 0)
1449+
interactionText:SetWidth(214)
1450+
interactionText:SetJustifyH("CENTER")
1451+
interactionText:SetText(MultiBot.L("tips.raidus.pool.interactions"))
1452+
interactionText:Show()
1453+
-- MB_RAIDUS_TOOLTIP_INTERACTION_PANEL_V1_END
13951454
pButton.tip:Show()
13961455
end)
13971456

@@ -1463,6 +1522,19 @@ MultiBot.raidus.setRaidus = function()
14631522
return
14641523
end
14651524

1525+
if IsShiftKeyDown and IsShiftKeyDown() then
1526+
local poolFrame = MultiBot.raidus.frames and MultiBot.raidus.frames["Pool"]
1527+
if pButton.parent.parent ~= poolFrame then
1528+
return
1529+
end
1530+
1531+
local dialog = StaticPopup_Show and StaticPopup_Show("MULTIBOT_RAIDUS_DELETE_POOL_BOT", name)
1532+
if dialog then
1533+
dialog.data = { name = name }
1534+
end
1535+
return
1536+
end
1537+
14661538
if MultiBotRaidusIsBotGrouped(name) then
14671539
-- Bot déjà dans le groupe/raid :
14681540
-- on laisse le core playerbots gérer leave + logout

Locales/MultiBotAceLocale-deDE.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local deDEValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "%s aus dem Raidus-Pool entfernen?\n\nDadurch wird nur der von MultiBot gespeicherte Eintrag entfernt. Der Servercharakter wird nicht gelöscht.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffLinksklick: ziehen und ablegen|r\n|cffff4444Umschalt + Rechtsklick: aus dem Raidus-Pool entfernen|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Immer plündern: Gegenstand hinzufügen",
913
["loot.item.remove"] = "Immer plündern: Gegenstand entfernen",

Locales/MultiBotAceLocale-enGB.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local enGBValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "Remove %s from the Raidus pool?\n\nThis removes only the saved MultiBot entry. The server character is not deleted.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffLeft-click: drag and drop|r\n|cffff4444Shift + Right-click: remove from the Raidus pool|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Always loot: add item",
913
["loot.item.remove"] = "Always loot: remove item",

Locales/MultiBotAceLocale-enUS.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local enUSValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "Remove %s from the Raidus pool?\n\nThis removes only the saved MultiBot entry. The server character is not deleted.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffLeft-click: drag and drop|r\n|cffff4444Shift + Right-click: remove from the Raidus pool|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Always loot: add item",
913
["loot.item.remove"] = "Always loot: remove item",

Locales/MultiBotAceLocale-esES.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local esESValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "¿Eliminar a %s del pool de Raidus?\n\nEsta acción elimina únicamente la entrada guardada por MultiBot. El personaje del servidor no se elimina.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffClic izquierdo: arrastrar y soltar|r\n|cffff4444Mayús + clic derecho: eliminar del pool de Raidus|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Despojar siempre: añadir objeto",
913
["loot.item.remove"] = "Despojar siempre: retirar objeto",

Locales/MultiBotAceLocale-frFR.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local frFRValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "Supprimer %s du pool Raidus ?\n\nCette action supprime uniquement l'entrée sauvegardée par MultiBot. Le personnage du serveur n'est pas supprimé.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffClic gauche : glisser-déposer|r\n|cffff4444Shift + clic droit : supprimer du pool Raidus|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Toujours ramasser : ajouter un objet",
913
["loot.item.remove"] = "Toujours ramasser : retirer un objet",

Locales/MultiBotAceLocale-koKR.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local koKRValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "Raidus 풀에서 %s 캐릭터를 제거하시겠습니까?\n\nMultiBot에 저장된 항목만 삭제됩니다. 서버의 캐릭터는 삭제되지 않습니다.",
9+
["tips.raidus.pool.interactions"] = "|cffffffff왼쪽 클릭: 끌어서 놓기|r\n|cffff4444Shift + 오른쪽 클릭: Raidus 풀에서 제거|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "항상 획득: 아이템 추가",
913
["loot.item.remove"] = "항상 획득: 아이템 제거",

Locales/MultiBotAceLocale-ruRU.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local ruRUValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "Удалить %s из пула Raidus?\n\nБудет удалена только сохранённая запись MultiBot. Персонаж на сервере не удаляется.",
9+
["tips.raidus.pool.interactions"] = "|cffffffffЛКМ: перетащить|r\n|cffff4444Shift + ПКМ: удалить из пула Raidus|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "Всегда собирать: добавить предмет",
913
["loot.item.remove"] = "Всегда собирать: убрать предмет",

Locales/MultiBotAceLocale-zhCN.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if type(register) ~= "function" then
44
end
55

66
local zhCNValues = {
7+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_BEGIN
8+
["raidus.pool.delete.confirm"] = "从 Raidus 池中移除 %s?\n\n此操作只会删除 MultiBot 保存的条目,不会删除服务器上的角色。",
9+
["tips.raidus.pool.interactions"] = "|cffffffff左键:拖放|r\n|cffff4444Shift + 右键:从 Raidus 池中移除|r",
10+
-- MB_RAIDUS_POOL_DELETE_I18N_V1_END
711
-- MB_LOOT_RULE_ITEM_I18N_V1_BEGIN
812
["loot.item.add"] = "始终拾取:添加物品",
913
["loot.item.remove"] = "始终拾取:移除物品",

0 commit comments

Comments
 (0)