Skip to content
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
3 changes: 2 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ globals = {
"IsShiftKeyDown", "RAID_CLASS_COLORS", "ITEM", "UISpecialFrames", "IsControlKeyDown", "IsShiftKeyDown", "INV_SLOT_MAINHAND", "LoadAddOn", "ShowUIPanel", "HandleModifiedItemClick",
"ChatFontNormal", "UnitIsDead", "ShowPrompt", "GameFontHighlightSmall", "GameFontNormalSmall", "SEARCH", "UnitIsUnit", "MB_INVENTORY_LABEL", "INVENTORY_TOOLTIP", "BAGSLOT", "GetItemInfoInstant",
"sendInventoryItemCommand", "LE_ITEM_CLASS_QUESTITEM", "ITEMS", "LOADING", "QUEST_LOG", "INSPECT", "SPELLBOOK", "MB_TAB_TITLE_DEFAULT", "ensureHiddenTooltip", "IsInGuild", "GetGuildInfo", "GetGuildRosterShowOffline",
"SetGuildRosterShowOffline", "PLAYER","Ambiguate", "ChatFrame_AddMessageEventFilter", "ChatTypeInfo", "x", "y"
"SetGuildRosterShowOffline", "PLAYER","Ambiguate", "ChatFrame_AddMessageEventFilter", "ChatTypeInfo", "x", "y", "CLASS_ICON_TCOORDS", "GetLootSlotLink", "GetLootSlotInfo", "GetLootMethod", "GetMasterLootCandidate",
"LOCALIZED_CLASS_NAMES_MALE", "LOCALIZED_CLASS_NAMES_FEMALE", "date", "LootSlotIsCoin", "LootSlotIsItem", "classColor", "GetNumLootItems", "GetItemQualityColor", "GiveMasterLoot", "GetLootThreshold"

}

Expand Down
29 changes: 29 additions & 0 deletions Core/MultiBot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,35 @@ function MultiBot.SetMainUIVisibleConfig(value)
return visible
end

local LOOT_MASTER_UI_ENABLED_DEFAULT = true

function MultiBot.GetLootMasterUIEnabled()
local value = MultiBot.Store and MultiBot.Store.GetUIValue and MultiBot.Store.GetUIValue("lootMasterUIEnabled")
if type(value) == "boolean" then
return value
end

local save = ensureSavedVariables()
if type(save.LootMasterUIEnabled) == "boolean" then
return save.LootMasterUIEnabled
end

return LOOT_MASTER_UI_ENABLED_DEFAULT
end

function MultiBot.SetLootMasterUIEnabled(value)
local enabled = not not value

if MultiBot.Store and MultiBot.Store.SetUIValue then
MultiBot.Store.SetUIValue("lootMasterUIEnabled", enabled)
else
local save = ensureSavedVariables()
save.LootMasterUIEnabled = enabled
end

return enabled
end

local function getLegacyCharacterStateRoot(createIfMissing)
local saved = _G.MultiBotSaved
if type(saved) ~= "table" then
Expand Down
95 changes: 94 additions & 1 deletion Core/MultiBotComm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ local function ensureBridgeState()
state.roster = state.roster or {}
state.states = state.states or {}
state.details = state.details or {}
state.professions = state.professions or {}
state.pvpStats = state.pvpStats or {}
state.stats = state.stats or {}
state.quests = state.quests or {}
Expand Down Expand Up @@ -577,6 +578,33 @@ local function parseBridgeDetailPayload(payload)
}
end

local function parseBridgeProfessionPayload(payload)
local name, professionPayload = splitOnce(payload or "", "~")

name = trim(urlDecodeField(name))
if name == "" then
return nil
end

local professions = {}
for token in string.gmatch(professionPayload or "", "([^;]+)") do
token = trim(urlDecodeField(token))

local profession, value = splitOnce(token, ":")
profession = string.lower(trim(profession or ""))

if profession ~= "" then
professions[profession] = value ~= "" and value or true
end
end

return {
name = name,
professions = professions,
lastUpdateAt = safeNow(),
}
end

local function parseRosterEntry(entry)
local fields = {}
for value in string.gmatch(entry or "", "([^,]+)") do
Expand Down Expand Up @@ -667,7 +695,19 @@ function Comm.ApplyBotDetailPayload(payload)
return nil
end

state.details[string.lower(detail.name)] = detail
local key = string.lower(detail.name)
local existing = state.details[key]
local professionEntry = state.professions[key]

if type(existing) == "table" and type(existing.professions) == "table" then
detail.professions = existing.professions
end

if type(professionEntry) == "table" and type(professionEntry.professions) == "table" then
detail.professions = professionEntry.professions
end

state.details[key] = detail

if MultiBot.ApplyBridgeBotDetail then
MultiBot.ApplyBridgeBotDetail(detail)
Expand All @@ -677,6 +717,45 @@ function Comm.ApplyBotDetailPayload(payload)
return detail
end

function Comm.ApplyBotProfessionPayload(payload)
local state = ensureBridgeState()
local entry = parseBridgeProfessionPayload(payload)
if not entry then
return nil
end

local key = string.lower(entry.name)
state.professions[key] = entry

local detail = state.details[key]
if type(detail) == "table" then
detail.professions = entry.professions
detail.lastProfessionUpdateAt = entry.lastUpdateAt
end

if MultiBot.ApplyBridgeBotProfession then
MultiBot.ApplyBridgeBotProfession(entry.name, entry.professions)
end

debugPrint("ADDON:RX", "PROFESSION", entry.name)
return entry
end

function Comm.ApplyBotProfessionsPayload(payload)
local applied = 0

if type(payload) == "string" and payload ~= "" then
for entryPayload in string.gmatch(payload, "([^|]+)") do
if Comm.ApplyBotProfessionPayload(entryPayload) then
applied = applied + 1
end
end
end

debugPrint("ADDON:RX", "PROFESSIONS", tostring(applied))
return applied
end

function Comm.ApplyBotDetailsPayload(payload)
local applied = 0

Expand Down Expand Up @@ -1453,6 +1532,20 @@ function Comm.HandleAddonMessage(prefix, message, distribution, sender)
return true
end

if opcode == "PROFESSION" then
state.connected = true
state.lastError = nil
Comm.ApplyBotProfessionPayload(payload)
return true
end

if opcode == "PROFESSIONS" then
state.connected = true
state.lastError = nil
Comm.ApplyBotProfessionsPayload(payload)
return true
end

if opcode == "TALENT_SPEC_BEGIN" then
state.connected = true
state.lastError = nil
Expand Down
37 changes: 37 additions & 0 deletions Locales/MultiBotAceLocale-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ if type(register) ~= "function" then
end

local deDEValues = {
["lootmaster.title"] = "MultiBot Plündermeister",
["lootmaster.refresh"] = "Aktualisieren",
["lootmaster.assign_to"] = "Zuweisen an:",
["lootmaster.unknown_item"] = "Unbekannter Gegenstand",
["lootmaster.unknown_candidate"] = "unbekannt",
["lootmaster.status.ready"] = "Wähle den Empfänger des Gegenstands aus.",
["lootmaster.status.not_master"] = "Die Beute ist nicht auf Plündermeister eingestellt, oder du bist nicht der Plündermeister.",
["lootmaster.status.no_loot"] = "Keine Beute verfügbar.",
["lootmaster.status.no_candidates"] = "Keine Beutekandidaten für die aktuelle Beute gefunden.",
["lootmaster.error.not_master"] = "Du bist nicht der Plündermeister.",
["lootmaster.error.invalid_candidate"] = "Ungültiger Beutekandidat.",
["lootmaster.assigned"] = "%s wurde %s zugewiesen.",
["lootmaster.no_candidates_for_item"] = "Keine Kandidaten für diesen Gegenstand.",
["lootmaster.assign"] = "Zuweisen",
["lootmaster.select_bot"] = "Bot auswählen",
["lootmaster.inventory_unavailable"] = "Inventar nicht verfügbar.",
["lootmaster.priority_score"] = "Priorität:",
["lootmaster.inventory_hint"] = "Rechtsklick: Inventar/Ausrüstung öffnen.",
["lootmaster.history_title"] = "Kürzliche Beute",
["lootmaster.history_empty"] = "Noch keine Beute zugewiesen.",
["lootmaster.preference_hint"] = "Rechtsklick: speichern. Umschalt+Rechtsklick: löschen.",
["lootmaster.preference_saved"] = "Präferenz gespeichert: ähnliche Gegenstände -> %s.",
["lootmaster.preference_cleared"] = "Präferenz für ähnliche Gegenstände gelöscht.",
["lootmaster.preference_missing"] = "Keine gespeicherte Präferenz für diesen Gegenstand.",
["options.lootmaster.enable"] = "Beutefenster aktivieren",
["options.lootmaster.enable_desc"] = "Zeigt das MultiBot-Plündermeisterfenster beim Plündern automatisch an.",
["lootmaster.profession.jewelcrafting"] = "Juwelenschleifen",
["lootmaster.profession_known"] = "Beruf: %s",
["lootmaster.profession_missing"] = "Erforderlicher Beruf: %s (nicht bekannt)",
["lootmaster.profession_unknown"] = "Erforderlicher Beruf: %s (unbekannt)",
["lootmaster.professions"] = "Berufe: %s",
["lootmaster.professions_unknown"] = "Berufe: unbekannt",
["lootmaster.profession.engineering"] = "Ingenieurskunst",
["lootmaster.profession.cooking"] = "Kochkunst",
["lootmaster.profession.fishing"] = "Angeln",
["lootmaster.profession.firstaid"] = "Erste Hilfe",
["lootmaster.gear_score"] = "GearScore: %d",
["tips.units.rti"] = "RTI",
["tips.disperse.main"] = "Disperse",
["tips.disperse.set"] = "Disperse-Distanz setzen",
Expand Down
37 changes: 37 additions & 0 deletions Locales/MultiBotAceLocale-enGB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ if type(register) ~= "function" then
end

local enGBValues = {
["lootmaster.title"] = "MultiBot Loot Master",
["lootmaster.refresh"] = "Refresh",
["lootmaster.assign_to"] = "Assign to:",
["lootmaster.unknown_item"] = "Unknown item",
["lootmaster.unknown_candidate"] = "unknown",
["lootmaster.status.ready"] = "Select the item recipient.",
["lootmaster.status.not_master"] = "Loot is not set to Master Looter, or you are not the loot master.",
["lootmaster.status.no_loot"] = "No loot available.",
["lootmaster.status.no_candidates"] = "No loot candidates found for the current loot.",
["lootmaster.error.not_master"] = "You are not the loot master.",
["lootmaster.error.invalid_candidate"] = "Invalid loot candidate.",
["lootmaster.assigned"] = "%s assigned to %s.",
["lootmaster.no_candidates_for_item"] = "No candidates for this item.",
["lootmaster.assign"] = "Assign",
["lootmaster.select_bot"] = "Select a bot",
["lootmaster.inventory_unavailable"] = "Inventory unavailable.",
["lootmaster.priority_score"] = "Priority:",
["lootmaster.inventory_hint"] = "Right-click: open inventory/equipment.",
["lootmaster.history_title"] = "Recent Loot",
["lootmaster.history_empty"] = "No loot assigned yet.",
["lootmaster.preference_hint"] = "Right-click: save. Shift-right-click: clear.",
["lootmaster.preference_saved"] = "Preference saved: similar items -> %s.",
["lootmaster.preference_cleared"] = "Preference cleared for similar items.",
["lootmaster.preference_missing"] = "No saved preference for this item.",
["options.lootmaster.enable"] = "Enable loot window",
["options.lootmaster.enable_desc"] = "Automatically shows the MultiBot loot master window during looting.",
["lootmaster.profession.jewelcrafting"] = "Jewelcrafting",
["lootmaster.profession_known"] = "Profession: %s",
["lootmaster.profession_missing"] = "Required profession: %s (not known)",
["lootmaster.profession_unknown"] = "Required profession: %s (unknown)",
["lootmaster.professions"] = "Professions: %s",
["lootmaster.professions_unknown"] = "Professions: unknown",
["lootmaster.profession.engineering"] = "Engineering",
["lootmaster.profession.cooking"] = "Cooking",
["lootmaster.profession.fishing"] = "Fishing",
["lootmaster.profession.firstaid"] = "First Aid",
["lootmaster.gear_score"] = "GearScore: %d",
["tips.units.rti"] = "RTI",
["tips.disperse.main"] = "Disperse",
["tips.disperse.set"] = "Set disperse distance",
Expand Down
37 changes: 37 additions & 0 deletions Locales/MultiBotAceLocale-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ if type(register) ~= "function" then
end

local enUSValues = {
["lootmaster.title"] = "MultiBot Loot Master",
["lootmaster.refresh"] = "Refresh",
["lootmaster.assign_to"] = "Assign to:",
["lootmaster.unknown_item"] = "Unknown item",
["lootmaster.unknown_candidate"] = "unknown",
["lootmaster.status.ready"] = "Select the item recipient.",
["lootmaster.status.not_master"] = "Loot is not set to Master Looter, or you are not the loot master.",
["lootmaster.status.no_loot"] = "No loot available.",
["lootmaster.status.no_candidates"] = "No loot candidates found for the current loot.",
["lootmaster.error.not_master"] = "You are not the loot master.",
["lootmaster.error.invalid_candidate"] = "Invalid loot candidate.",
["lootmaster.assigned"] = "%s assigned to %s.",
["lootmaster.no_candidates_for_item"] = "No candidates for this item.",
["lootmaster.assign"] = "Assign",
["lootmaster.select_bot"] = "Select a bot",
["lootmaster.inventory_unavailable"] = "Inventory unavailable.",
["lootmaster.priority_score"] = "Priority:",
["lootmaster.inventory_hint"] = "Right-click: open inventory/equipment.",
["lootmaster.history_title"] = "Recent Loot",
["lootmaster.history_empty"] = "No loot assigned yet.",
["lootmaster.preference_hint"] = "Right-click: save. Shift-right-click: clear.",
["lootmaster.preference_saved"] = "Preference saved: similar items -> %s.",
["lootmaster.preference_cleared"] = "Preference cleared for similar items.",
["lootmaster.preference_missing"] = "No saved preference for this item.",
["options.lootmaster.enable"] = "Enable loot window",
["options.lootmaster.enable_desc"] = "Automatically shows the MultiBot loot master window during looting.",
["lootmaster.profession.jewelcrafting"] = "Jewelcrafting",
["lootmaster.profession_known"] = "Profession: %s",
["lootmaster.profession_missing"] = "Required profession: %s (not known)",
["lootmaster.profession_unknown"] = "Required profession: %s (unknown)",
["lootmaster.professions"] = "Professions: %s",
["lootmaster.professions_unknown"] = "Professions: unknown",
["lootmaster.profession.engineering"] = "Engineering",
["lootmaster.profession.cooking"] = "Cooking",
["lootmaster.profession.fishing"] = "Fishing",
["lootmaster.profession.firstaid"] = "First Aid",
["lootmaster.gear_score"] = "GearScore: %d",
["tips.units.rti"] = "RTI",
["tips.disperse.main"] = "Disperse",
["tips.disperse.set"] = "Set disperse distance",
Expand Down
37 changes: 37 additions & 0 deletions Locales/MultiBotAceLocale-esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ if type(register) ~= "function" then
end

local esESValues = {
["lootmaster.title"] = "MultiBot Maestro despojador",
["lootmaster.refresh"] = "Actualizar",
["lootmaster.assign_to"] = "Asignar a:",
["lootmaster.unknown_item"] = "Objeto desconocido",
["lootmaster.unknown_candidate"] = "desconocido",
["lootmaster.status.ready"] = "Selecciona el destinatario del objeto.",
["lootmaster.status.not_master"] = "El botín no está configurado como Maestro despojador, o no eres el maestro despojador.",
["lootmaster.status.no_loot"] = "No hay botín disponible.",
["lootmaster.status.no_candidates"] = "No se encontraron candidatos de botín para el botín actual.",
["lootmaster.error.not_master"] = "No eres el maestro despojador.",
["lootmaster.error.invalid_candidate"] = "Candidato de botín no válido.",
["lootmaster.assigned"] = "%s asignado a %s.",
["lootmaster.no_candidates_for_item"] = "No hay candidatos para este objeto.",
["lootmaster.assign"] = "Asignar",
["lootmaster.select_bot"] = "Seleccionar un bot",
["lootmaster.inventory_unavailable"] = "Inventario no disponible.",
["lootmaster.priority_score"] = "Prioridad:",
["lootmaster.inventory_hint"] = "Clic derecho: abrir inventario/equipo.",
["lootmaster.history_title"] = "Botín reciente",
["lootmaster.history_empty"] = "Aún no se ha asignado botín.",
["lootmaster.preference_hint"] = "Clic derecho: guardar. Mayús+clic derecho: borrar.",
["lootmaster.preference_saved"] = "Preferencia guardada: objetos similares -> %s.",
["lootmaster.preference_cleared"] = "Preferencia borrada para objetos similares.",
["lootmaster.preference_missing"] = "No hay ninguna preferencia guardada para este objeto.",
["options.lootmaster.enable"] = "Activar ventana de botín",
["options.lootmaster.enable_desc"] = "Muestra automáticamente la ventana de maestro despojador de MultiBot durante el despojo.",
["lootmaster.profession.jewelcrafting"] = "Joyería",
["lootmaster.profession_known"] = "Profesión: %s",
["lootmaster.profession_missing"] = "Profesión requerida: %s (no conocida)",
["lootmaster.profession_unknown"] = "Profesión requerida: %s (desconocida)",
["lootmaster.professions"] = "Profesiones: %s",
["lootmaster.professions_unknown"] = "Profesiones: desconocidas",
["lootmaster.profession.engineering"] = "Ingeniería",
["lootmaster.profession.cooking"] = "Cocina",
["lootmaster.profession.fishing"] = "Pesca",
["lootmaster.profession.firstaid"] = "Primeros auxilios",
["lootmaster.gear_score"] = "GearScore: %d",
["tips.units.rti"] = "RTI",
["tips.disperse.main"] = "Dispersar",
["tips.disperse.set"] = "Definir distancia de dispersión",
Expand Down
37 changes: 37 additions & 0 deletions Locales/MultiBotAceLocale-frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ if type(register) ~= "function" then
end

local frFRValues = {
["lootmaster.title"] = "MultiBot Responsable du butin",
["lootmaster.refresh"] = "Rafraîchir",
["lootmaster.assign_to"] = "Attribuer à :",
["lootmaster.unknown_item"] = "Objet inconnu",
["lootmaster.unknown_candidate"] = "inconnu",
["lootmaster.status.ready"] = "Sélectionne le destinataire de l'objet.",
["lootmaster.status.not_master"] = "Le butin n'est pas en responsable du butin, ou tu n'es pas le responsable.",
["lootmaster.status.no_loot"] = "Aucun butin disponible.",
["lootmaster.status.no_candidates"] = "Aucun candidat de butin trouvé pour le loot actuel.",
["lootmaster.error.not_master"] = "Tu n'es pas le responsable du butin.",
["lootmaster.error.invalid_candidate"] = "Candidat de butin invalide.",
["lootmaster.assigned"] = "%s attribué à %s.",
["lootmaster.no_candidates_for_item"] = "Aucun candidat pour cet objet.",
["lootmaster.assign"] = "Attribuer",
["lootmaster.select_bot"] = "Choisir un bot",
["lootmaster.inventory_unavailable"] = "Inventaire indisponible.",
["lootmaster.priority_score"] = "Priorite:",
["lootmaster.inventory_hint"] = "Click-droit: ouvre inventaire/équipment.",
["lootmaster.history_title"] = "Loots Récents",
["lootmaster.history_empty"] = "Pas de Loots Encore Attribués.",
["lootmaster.preference_hint"] = "Click-Droit: sauvegarder. Shift-click-droit: Effacer.",
["lootmaster.preference_saved"] = "Preference sauvegardée: items simmilaires -> %s.",
["lootmaster.preference_cleared"] = "Preference effacée pour items similaires.",
["lootmaster.preference_missing"] = "Pas de préférence sauvegardée pour cet item.",
["options.lootmaster.enable"] = "Activer la fenêtre de loot",
["options.lootmaster.enable_desc"] = "Affiche automatiquement la fenêtre MultiBot de responsable du butin pendant les loots.",
["lootmaster.profession.jewelcrafting"] = "Joaillerie",
["lootmaster.profession_known"] = "Metier : %s",
["lootmaster.profession_missing"] = "Metier requis : %s (non connu)",
["lootmaster.profession_unknown"] = "Metier requis : %s (inconnu)",
["lootmaster.professions"] = "Metiers : %s",
["lootmaster.professions_unknown"] = "Metiers : inconnus",
["lootmaster.profession.engineering"] = "Ingénierie",
["lootmaster.profession.cooking"] = "Cuisine",
["lootmaster.profession.fishing"] = "Pêche",
["lootmaster.profession.firstaid"] = "Secourisme",
["lootmaster.gear_score"] = "GearScore : %d",
["tips.units.rti"] = "RTI",
["tips.disperse.main"] = "Disperse",
["tips.disperse.set"] = "Définir la distance de disperse",
Expand Down
Loading
Loading