View Feature Request
extended layout (patch submitted)
Feature #: 4296
File: Neuron
Date: 11-17-10 05:10 PM
By: kouik
Status: Under Review
Hello,

It would be so great to get this patch (or a better version ;) ) integrated into Macaroon core.

It's a hassle to integrate it in new version of macaroons each time you update it ;) and this may be usefull for the community too.

Please find a copy of the forum below :

Hello All,

First, I would like to thanks Maul and all the community users for the quality of the information we can get on this comments pages. Thanks to all for bringing Macaroon to life.

I'm usually a hidden reader, but for once, I would like to discuss about how to add a feature into macaroon for this purpose :
how to match a physical keyboard layout with macaroon

This subject will be (I hope at least) of a high interest for speedpad users (logitech G13, belkin n52te, ...) that want to get a bar that match the physical layout of their speedpad.
The issue is that with macaroon, a bar is linear, circle, and nothing else.
What we would need is to :
1 - add spaces between some buttons
2 - get a different number of columns on different rows.

To reach this goal, I written a small piece of code that should not break macaroon usage (at least it does not appears to) that I pray to get integrated into macaroon.

Maul, if this is not possible, does there is a way to create an external addon that would add this feature into macaroon core at runtime ? (I'm pretty sure this is possible, but I'm pretty new to lua xD)

For now, the files to change are :

Macaroon_Strings.lua

around line 1151, change each language from
enUS = "\n1=Linear\n2=Circle\n3=Circle+One",

to

enUS = "\n1=Linear\n2=Circle\n3=Circle+One\n4=Matrix",

after the BARSHAPE_3 table, around line 3619, add :

BARSHAPE_4 = {
enUS = "Matrix",
deDE = "Matrix",
esES = "Matrix",
esMX = "Matrix",
frFR = "Matrix",
koKR = "Matrix",
nlNL = "Matrix",
ruRU = "Matrix",
zhCN = "Matrix",
zhTW = "Matrix",
},



Macaroon_Bars.lua
around line 467 , before the else, add :


elseif (shape == 4) then
--clear out old arc data
if (bar.config.arcData[state]) then
bar.config.arcData[state] = nil
end

if (not placed) then
placed = 0

-- this matrix handle the placement.
-- "1" a standard placement for button
-- "2" means there will be a larger space between this button and the next one to be use as placeholder
-- to match your physical speedpad layout (non action button, like jump, or page management... whatever
-- the default shape show :
-- 5 buttons on the 2 first lines
-- 3 buttons on the 3rd line, with button 2 and 3 are separated by an empty space.
-- 3 buttons on the 4th line, with a small additionnal space between button 2 and 3

-- feel free to adjust this.
-- keep in mind that with those settings, columns does not get any meaning and that you should not configure for more buttons than indicated in the matrix, or the buttons drawing will loop



matrix = bar.config.matrix

CSmaxY = table.getn(matrix)
CSmaxX = table.getn(matrix[1])

--todo in a clever way, should we process the matrix for the absolute X ?
CSmaxXabsolute = table.getn(matrix[1])

CSx = 1
CSy = 1


else

placed = placed + 1; cAdjust = cAdjust + matrix[CSy][CSx]
CSx = CSx + 1


-- change of row when we reach the end of the current line
if (placed == CSmaxX) then
placed = 0
cAdjust = 0.5
rAdjust = rAdjust + 1
if (rAdjust > CSmaxY ) then
rAdjust = 1
CSy = 1
else
CSy = CSy +1
end
CSx = 1
CSmaxX = table.getn(matrix[rAdjust])


end

end


x = -(width + padH) * (CSmaxXabsolute-cAdjust) / btnScale
y = (height + padV) * (CSmaxY-rAdjust) / btnScale

button:SetPoint("CENTER", anchor, "CENTER", x + xOffset, y + yOffset)




still in
Macaroon_Bars.lua
around line 1232 , in the barDefaults function, after the line shape = 1, add :


matrix = {
{ 1 , 1 , 1 , 1 , 1},
{ 1 , 1 , 1 , 1 , 1},
{ 2 , 1.2 , 1 },
{ 1 , 1.3 , 1 }
},


Now, for the fun part, run Wow and connect to the character you want to customize.

type /mac config, and then right click on the bar you want to change.

In the shape section, choose matrix (4th choice) and set the number of buttons accordingly.

Now, quit wow. This is a really important step to ensure that the settings placeholder is written.

After this feel free to open



[b] WTF/account/accountname/SavedVariables/MacaroonProfiles.lua[b]

locate the profile you want to edit, and jump to the line containing "Matrix"

you should find something like this. This is the place to edit settings until someone find a convenient way to do it from wow xD


["matrix"] = {
{
1, -- [1]
1, -- [2]
1, -- [3]
1, -- [4]
1, -- [5]
}, -- [1]
{
1, -- [1]
1, -- [2]
1, -- [3]
1, -- [4]
1, -- [5]
}, -- [2]
{
2, -- [1]
1.2, -- [2]
1, -- [3]
}, -- [3]
{
1, -- [1]
1.3, -- [2]
1, -- [3]
}, -- [4]
},



Hope this can help some users to tailor their bars the way they like

praying for an integration in macaroon xD