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
4 changes: 2 additions & 2 deletions UI/MultiBotAttackUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local ATTACK_BUTTONS = {

local ATTACK_ICON = "Interface\\AddOns\\MultiBot\\Icons\\attack.blp"
local ATTACK_FRAME_NAME = "Attack"
local ATTACK_MAIN_X = -136
local ATTACK_FRAME_X = -138
local ATTACK_MAIN_X = -204
local ATTACK_FRAME_X = -206
local ATTACK_FRAME_Y = 34
local ATTACK_CELL_HEIGHT = 30

Expand Down
4 changes: 2 additions & 2 deletions UI/MultiBotDisperseUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function MultiBot.BuildDisperseUI(tLeft)

local lastDistance = "10"
local button
local menu = tLeft.addFrame("DisperseMenu", -238, 34, 24, 56, 96).doHide()
local menu = tLeft.addFrame("DisperseMenu", -34, 34, 24, 56, 96).doHide()
local menuOpen = false
menu._mbDropdownManaged = true
menu:SetWidth(56)
Expand Down Expand Up @@ -146,7 +146,7 @@ function MultiBot.BuildDisperseUI(tLeft)

MultiBot.frames.disperseMenu = menu

button = tLeft.addButton("Disperse", -238, 0, "spell_nature_wispsplode", L("tips.disperse.main", "Disperse")).setDisable()
button = tLeft.addButton("Disperse", -34, 0, "spell_nature_wispsplode", L("tips.disperse.main", "Disperse")).setDisable()
button.doLeft = function()
if menuOpen then
hideDisperseMenu()
Expand Down
4 changes: 2 additions & 2 deletions UI/MultiBotFleeUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ local FLEE_BUTTONS = {

local FLEE_ICON = "Interface\\AddOns\\MultiBot\\Icons\\flee.blp"
local FLEE_FRAME_NAME = "Flee"
local FLEE_MAIN_X = -34
local FLEE_FRAME_X = -36
local FLEE_MAIN_X = -102
local FLEE_FRAME_X = -104
local FLEE_FRAME_Y = 34
local FLEE_CELL_HEIGHT = 30

Expand Down
16 changes: 8 additions & 8 deletions UI/MultiBotLeftCoreUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if not MultiBot then return end
local MODE_FRAME_NAME = "Mode"
local MODE_BUTTON_NAME = "Mode"
local MODE_BUTTON_ICON = "Interface\\AddOns\\MultiBot\\Icons\\mode_passive.blp"
local MODE_FRAME_X = -104
local MODE_FRAME_X = -172
local MODE_FRAME_Y = 34

local function bindModeToggleAction(modeButton, enableCommand, disableCommand)
Expand All @@ -17,7 +17,7 @@ local function bindModeToggleAction(modeButton, enableCommand, disableCommand)
end

local function createModeUI(tLeft)
local modeButton = tLeft.addButton(MODE_BUTTON_NAME, -102, 0, MODE_BUTTON_ICON, MultiBot.L("tips.mode.master")).setDisable()
local modeButton = tLeft.addButton(MODE_BUTTON_NAME, -170, 0, MODE_BUTTON_ICON, MultiBot.L("tips.mode.master")).setDisable()

modeButton.doRight = function(button)
MultiBot.ShowHideSwitch(button.parent.frames[MODE_FRAME_NAME])
Expand Down Expand Up @@ -48,7 +48,7 @@ local function createModeUI(tLeft)
end

local function createStayFollowUI(tLeft)
tLeft.addButton("Stay", -68, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_follow.blp", MultiBot.L("tips.stallow.stay")).doLeft = function(button)
tLeft.addButton("Stay", -136, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_follow.blp", MultiBot.L("tips.stallow.stay")).doLeft = function(button)
if MultiBot.ActionToGroup("stay") then
button.parent.buttons["Follow"].doShow()
button.parent.buttons["ExpandFollow"].setDisable()
Expand All @@ -57,7 +57,7 @@ local function createStayFollowUI(tLeft)
end
end

tLeft.addButton("Follow", -68, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_stay.blp", MultiBot.L("tips.stallow.follow")).doHide().doLeft = function(button)
tLeft.addButton("Follow", -136, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_stay.blp", MultiBot.L("tips.stallow.follow")).doHide().doLeft = function(button)
if MultiBot.ActionToGroup("follow") then
button.parent.buttons["Stay"].doShow()
button.parent.buttons["ExpandFollow"].setEnable()
Expand All @@ -66,13 +66,13 @@ local function createStayFollowUI(tLeft)
end
end

tLeft.addButton("ExpandStay", -68, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_stay.blp", MultiBot.tips.expand.stay).doHide().setDisable().doLeft = function(button)
tLeft.addButton("ExpandStay", -136, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_stay.blp", MultiBot.tips.expand.stay).doHide().setDisable().doLeft = function(button)
MultiBot.ActionToGroup("stay")
button.parent.buttons["ExpandFollow"].setDisable()
button.setEnable()
end

tLeft.addButton("ExpandFollow", -102, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_follow.blp", MultiBot.tips.expand.follow).doHide().doLeft = function(button)
tLeft.addButton("ExpandFollow", -170, 0, "Interface\\AddOns\\MultiBot\\Icons\\command_follow.blp", MultiBot.tips.expand.follow).doHide().doLeft = function(button)
MultiBot.ActionToGroup("follow")
button.parent.buttons["ExpandStay"].setDisable()
button.setEnable()
Expand All @@ -85,7 +85,7 @@ function MultiBot.InitializeLeftCoreUI(tLeft)
end

if MultiBot.BuildBotRTIActionUI then
MultiBot.BuildBotRTIActionUI(tLeft, -238, 0)
MultiBot.BuildBotRTIActionUI(tLeft, -306, 0)
end

if MultiBot.BuildDisperseUI then
Expand All @@ -96,7 +96,7 @@ function MultiBot.InitializeLeftCoreUI(tLeft)
MultiBot.BuildLootUI(tLeft)
end

tLeft.addButton("Tanker", -170, 0, "ability_warrior_shieldbash", MultiBot.L("tips.tanker.master")).doLeft = function()
tLeft.addButton("Tanker", -238, 0, "ability_warrior_shieldbash", MultiBot.L("tips.tanker.master")).doLeft = function()
if MultiBot.isTarget() then
MultiBot.ActionToGroup("@tank do attack my target")
end
Expand Down
4 changes: 2 additions & 2 deletions UI/MultiBotLootUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function MultiBot.BuildLootUI(tLeft)
end

local button
local menu = tLeft.addFrame("LootMenu", -277, 34, 24, 24, 170).doHide()
local menu = tLeft.addFrame("LootMenu", -73, 34, 24, 24, 170).doHide()
local menuOpen = false
local menuButtons = {}
local menuButtonsByKey = {}
Expand Down Expand Up @@ -158,7 +158,7 @@ function MultiBot.BuildLootUI(tLeft)

MultiBot.frames.lootMenu = menu

button = tLeft.addButton("Loot", -272, 0, "inv_misc_bag_10", L("tips.loot.main", "Loot rules")).setDisable()
button = tLeft.addButton("Loot", -68, 0, "inv_misc_bag_10", L("tips.loot.main", "Loot rules")).setDisable()
button.doLeft = function()
if menuOpen then
hideLootMenu()
Expand Down
22 changes: 18 additions & 4 deletions UI/MultiBotMainUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ local MAINBAR_AUTOHIDE_HOTSPOT_SIZE = 42
local MAINBAR_AUTOHIDE_UPDATE_INTERVAL = 0.2

local LEFT_LAYOUT_NAMES = {
"BotRTI",
"Disperse",
"Loot",
"Tanker",
"Attack",
"Mode",
Expand All @@ -25,6 +28,12 @@ local LEFT_LAYOUT_NAMES = {
"Beast",
}

local LEFT_LAYOUT_FRAME_NAMES = {
BotRTI = "BotRTIAction",
Disperse = "DisperseMenu",
Loot = "LootMenu",
}

local leftLayoutBase = nil

local function withLeftRoot(callback)
Expand Down Expand Up @@ -60,9 +69,10 @@ local function captureLeftLayoutBase(leftRoot)
leftLayoutBase.buttons[name] = { x = button.x, y = button.y }
end

local frame = leftRoot.frames and leftRoot.frames[name]
local frameName = LEFT_LAYOUT_FRAME_NAMES[name] or name
local frame = leftRoot.frames and leftRoot.frames[frameName]
if frame then
leftLayoutBase.frames[name] = { x = frame.x, y = frame.y }
leftLayoutBase.frames[frameName] = { x = frame.x, y = frame.y }
end
end
end
Expand All @@ -73,10 +83,11 @@ local function setLeftElementX(leftRoot, name, x)
button.setPoint(x, button.y)
end

local frame = leftRoot.frames and leftRoot.frames[name]
local frameName = LEFT_LAYOUT_FRAME_NAMES[name] or name
local frame = leftRoot.frames and leftRoot.frames[frameName]
if frame then
local baseButton = leftLayoutBase and leftLayoutBase.buttons and leftLayoutBase.buttons[name]
local baseFrame = leftLayoutBase and leftLayoutBase.frames and leftLayoutBase.frames[name]
local baseFrame = leftLayoutBase and leftLayoutBase.frames and leftLayoutBase.frames[frameName]
local frameOffset = -2
if baseButton and baseFrame then
frameOffset = baseFrame.x - baseButton.x
Expand Down Expand Up @@ -124,6 +135,7 @@ local function refreshLeftLayout()
heavyShift = heavyShift - LEFT_LAYOUT_SHIFT
end

setLeftElementX(leftRoot, "BotRTI", getLeftBaseX(leftRoot, "BotRTI") + heavyShift)
setLeftElementX(leftRoot, "Tanker", getLeftBaseX(leftRoot, "Tanker") + heavyShift)
setLeftElementX(leftRoot, "Attack", getLeftBaseX(leftRoot, "Attack") + heavyShift)
setLeftElementX(leftRoot, "Mode", getLeftBaseX(leftRoot, "Mode") + heavyShift)
Expand All @@ -133,6 +145,8 @@ local function refreshLeftLayout()
setLeftElementX(leftRoot, "ExpandStay", getLeftBaseX(leftRoot, "ExpandStay") + commonShift)
setLeftElementX(leftRoot, "ExpandFollow", getLeftBaseX(leftRoot, "ExpandFollow") + commonShift)
setLeftElementX(leftRoot, "Flee", getLeftBaseX(leftRoot, "Flee") + commonShift)
setLeftElementX(leftRoot, "Loot", getLeftBaseX(leftRoot, "Loot") + commonShift)
setLeftElementX(leftRoot, "Disperse", getLeftBaseX(leftRoot, "Disperse") + commonShift)
setLeftElementX(leftRoot, "Format", getLeftBaseX(leftRoot, "Format") + commonShift)

setLeftElementX(leftRoot, "Beast", getLeftBaseX(leftRoot, "Beast") + (creatorEnabled and -LEFT_LAYOUT_SHIFT or 0))
Expand Down
4 changes: 2 additions & 2 deletions UI/MultiBotRTIUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,12 @@ function MultiBot.RunStoredBotRTISelections(command)
return true
end

function MultiBot.BuildBotRTIActionUI(tLeft)
function MultiBot.BuildBotRTIActionUI(tLeft, x, y)
if not tLeft or not tLeft.addButton or not tLeft.addFrame then
return nil
end

local buttonX = x or -238
local buttonX = x or -306
local buttonY = y or 0

local button = tLeft.addButton(
Expand Down
Loading