Thanks for the quick answer Phanx, you are awesome, but please don't confuse someone which wants hide its precious code with a guy which only wants to be polite asking about the issue first.
The addon (this) is big, i'm pasting here parts which a think is relevant to the problem.
I apologise in advance, for my bad coding and for few variables isn't being in English :(
This is where the window frame is created (gumps/janela_principal.lua, 2309):
This is the function which makes the setpoints plus the function responsible for creating rows (gumps/janela_principal.lua, 2736):
function _detalhes:SetBarGrowDirection (direction)
if (not direction) then
direction = self.bars_grow_direction
end
self.bars_grow_direction = direction
local x = self.row_info.space.left
if (direction == 1) then --> top to bottom
for index, row in _ipairs (self.barras) do
local y = self.row_height * (index - 1)
y = y * -1
row:ClearAllPoints()
row:SetPoint ("topleft", self.baseframe, "topleft", x, y)
end
elseif (direction == 2) then --> bottom to top
for index, row in _ipairs (self.barras) do
local y = self.row_height * (index - 1)
row:ClearAllPoints()
row:SetPoint ("bottomleft", self.baseframe, "bottomleft", x, y + 2)
end
end
--> update all row width
if (self.bar_mod and self.bar_mod ~= 0) then
for index = 1, #self.barras do
self.barras [index]:SetWidth (self.baseframe:GetWidth() + self.bar_mod)
end
else
for index = 1, #self.barras do
self.barras [index]:SetWidth (self.baseframe:GetWidth()+self.row_info.space.right)
end
end
end
function gump:CriaNovaBarra (instancia, index)
--> instancia = window object, index = row number
local baseframe = instancia.baseframe
local rowframe = instancia.rowframe
--> create the bar with rowframe as parent
local new_row = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, rowframe)
new_row.row_id = index
new_row.instance_id = instancia.meu_id
new_row.animacao_fim = 0
new_row.animacao_fim2 = 0
--> set point, almost irrelevant here, it recalc this on SetBarGrowDirection()
local y = instancia.row_height * (index-1)
if (instancia.bars_grow_direction == 1) then
y = y*-1
new_row:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y)
elseif (instancia.bars_grow_direction == 2) then
new_row:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2)
end
--> row height
new_row:SetHeight (instancia.row_info.height)
new_row:SetWidth (baseframe:GetWidth()+instancia.row_info.space.right)
new_row:SetFrameLevel (baseframe:GetFrameLevel() + 4)
new_row.last_value = 0
new_row.w_mod = 0
new_row:EnableMouse (true)
new_row:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
--> statusbar
new_row.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, new_row)
--> frame for hold the backdrop border
new_row.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, new_row.statusbar)
new_row.border:SetFrameLevel (new_row.statusbar:GetFrameLevel()+1)
new_row.border:SetAllPoints (new_row)
--> create textures and icons
new_row.textura = new_row.statusbar:CreateTexture (nil, "artwork")
new_row.textura:SetHorizTile (false)
new_row.textura:SetVertTile (false)
--> row background texture
new_row.background = new_row:CreateTexture (nil, "background")
new_row.background:SetTexture()
new_row.background:SetAllPoints (new_row)
new_row.statusbar:SetStatusBarColor (0, 0, 0, 0)
new_row.statusbar:SetStatusBarTexture (new_row.textura)
new_row.statusbar:SetMinMaxValues (0, 100)
new_row.statusbar:SetValue (0)
--> class icon
local icone_classe = new_row.statusbar:CreateTexture (nil, "overlay")
icone_classe:SetHeight (instancia.row_info.height)
icone_classe:SetWidth (instancia.row_info.height)
icone_classe:SetTexture (instancia.row_info.icon_file)
icone_classe:SetTexCoord (.75, 1, .75, 1)
new_row.icone_classe = icone_classe
icone_classe:SetPoint ("left", new_row, "left")
new_row.statusbar:SetPoint ("topleft", icone_classe, "topright")
new_row.statusbar:SetPoint ("bottomright", new_row, "bottomright")
--> left text
new_row.texto_esquerdo = new_row.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight")
new_row.texto_esquerdo:SetPoint ("left", new_row.icone_classe, "right", 3, 0)
new_row.texto_esquerdo:SetJustifyH ("left")
new_row.texto_esquerdo:SetNonSpaceWrap (true)
--> right text
new_row.texto_direita = new_row.statusbar:CreateFontString (nil, "overlay", "GameFontHighlight")
new_row.texto_direita:SetPoint ("right", new_row.statusbar, "right")
new_row.texto_direita:SetJustifyH ("right")
--> set the onclick, on enter scripts
barra_scripts (new_row, instancia, index)
--> hide
gump:Fade (new_row, 1)
--> adds the window container
instancia.barras [index] = new_row
--> set the left text
new_row.texto_esquerdo:SetText (Loc ["STRING_NEWROW"])
--> refresh rows
instancia:InstanceRefreshRows()
return new_row
end
Code for change the window position when the profile is load (core/windows.lua, 166):
function _detalhes:RestoreMainWindowPosition (pre_defined)
local _scale = self.baseframe:GetEffectiveScale()
local _UIscale = _UIParent:GetScale()
local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale
local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale
if (pre_defined) then --> overwrite
novo_x = pre_defined.x*_UIscale/_scale
novo_y = pre_defined.y*_UIscale/_scale
self.posicao[self.mostrando].w = pre_defined.largura
self.posicao[self.mostrando].h = pre_defined.altura
end
self.baseframe:SetWidth (self.posicao[self.mostrando].w)
self.baseframe:SetHeight (self.posicao[self.mostrando].h)
self.baseframe:ClearAllPoints()
self.baseframe:SetPoint ("CENTER", _UIParent, "CENTER", novo_x, novo_y)
self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espaço para o final da janela
end
function _detalhes:SaveMainWindowPosition (instance)
if (instance) then
self = instance
end
local mostrando = self.mostrando
--> get sizes
local baseframe_width = self.baseframe:GetWidth()
local baseframe_height = self.baseframe:GetHeight()
if (not baseframe_width) then
return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self)
end
--> calc position
local xOfs, yOfs = self.baseframe:GetCenter()
if (not xOfs) then
return _detalhes:ScheduleTimer ("SaveMainWindowPosition", 1, self)
end
local _scale = self.baseframe:GetEffectiveScale()
local _UIscale = _UIParent:GetScale()
--
xOfs = xOfs*_scale - _GetScreenWidth()*_UIscale/2
yOfs = yOfs*_scale - _GetScreenHeight()*_UIscale/2
--> save the position
local _w = baseframe_width
local _h = baseframe_height
local _x = xOfs/_UIscale
local _y = yOfs/_UIscale
self.posicao[mostrando].x = _x
self.posicao[mostrando].y = _y
self.posicao[mostrando].w = _w
self.posicao[mostrando].h = _h
--> update the 4 points for window groups
local metade_largura = _w/2
local metade_altura = _h/2
local statusbar_y_mod = 0
if (not self.show_statusbar) then
statusbar_y_mod = 14
end
self.ponto1 = {x = _x - metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topleft
self.ponto2 = {x = _x - metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomleft
self.ponto3 = {x = _x + metade_largura, y = _y - metade_altura + statusbar_y_mod} --bottomright
self.ponto4 = {x = _x + metade_largura, y = _y + metade_altura + (statusbar_y_mod*-1)} --topright
self.baseframe.BoxBarrasAltura = self.baseframe:GetHeight() - end_window_spacement --> espaço para o final da janela
return {altura = self.baseframe:GetHeight(), largura = self.baseframe:GetWidth(), x = xOfs/_UIscale, y = yOfs/_UIscale}
end
So, i got rid of this textures and replaced for normal buttons textures, also all interface part of the addon is done and i can back to focus in this complicated issue (at least for me eheheheh).
This video shows a issue with backdrop border, when i change its size some bars show the border correctly, others show a thin border, many bars don't even show.
At 0:21 seconds when turned borders off, rows 4 and 5 have no gap between them.
Before i start freaking out :confused: and flood you guys with tons of code, let me ask, those issues are caused by screen's pixels too?
Make sure everything is positioned exactly according to the screen's pixels. If the border is placed x.5 pixels from the edge for example, that will cause a blur. This is common when you're dealing with stuff with dimensions of odd numbers and/or using CENTER for anchoring.
Not sure if i get it the part of positioning according with the screen's pixels, i mean, how can i know that a frame is correctly positioned and how i fix if doesn't.
btw, thanks for the answer, gave me some hope :)
I just realize that this issue can't be fixed.
The image below have two buttons, #1 and #2 using the same texture, size, texcoord and still are different. The right side border of #2 isn't solid black as #1 :(
And the worst part, i moved both windows containing the buttons to a random location and did /reload, the result:
If anyone want test this, the image used is this: http://i.imgur.com/hABA7qr.png and texcoords: 0.0185546875, 0.04736328125, 0.4833984375, 0.49853515625
As i need precision for this skin file, i wondering if splitting into lots of small individual files could be correct approach.
Sorry, guys, i think i was tired late night and didn't explained well the issue, my bad.
I'm aware about the division, i did used SetTexCoord (75/256, 165/256, 68/256, 158/256) coordinates from the second image, but the issue as shown on the first image is that the top red line have some white mixed within the red and the bottom red line is a little darker. Is this normal or i'm getting wrong coordinates?
I'm having difficult with texcoords and i not sure if i'm getting the correct cords. I'm using a method which i did read on wowwiki, but it's weird, the texture showing ingame stay slightly different.
For instance, what image coords should be used to show only the square with red border in the center of this image? I'm using top left: 75 68 bottom right: 165 158.
Also, another reason why you should be using the dependency system correctly is that addons are not loaded alphabetically on all file systems, so while starting your addon name with an exclamation point will make it load first for many users, it won't work for all users.
By contrast, specifying it as a dependency will make it load first for all users, regardless of file system, OS, etc.
Thanks for this tip, i did not know that, i thing this is a game change eheheh.
If i assign Details as dependent of NickTag and someone download Details through his curse page (http://www.curse.com/addons/wow/details) NickTag will not come in the zip bundle right? Only if the user download through curse client NickTag will be installed automatically.
So, guys, is correct i just use everything mentioned before, like this?
Sorry for the lack of information and thanks for the quick answer.
What i'm doing is actually is a library with saved variables, in my searches through the forum i've notice that this is not possible, so what i did (i'm noob with addons, if i'm doing something stupid, please let me know) is a library with .toc file in root directory and with the name beginning with ! exclamation for load before all others addons.
So, i had problem when sending the commit with exclamation (!) on .pkgmeta (see the quote on my first post):
remote: added 2 changesets with 2 changes to 1 files
remote: error: Invalid .pkgmeta file
remote: error: could not determine a constructor for the tag '!NickTag'
remote: error: in "<string>", line 15, column 30:
remote: error: Details/plugins/NickTag: !NickTag
remote: error: ^
remote: transaction abort!
remote: rollback completed
remote: abort: pretxnchangegroup.validate_pkgmeta hook failed
[command returned code 1 Wed Aug 28 00:46:09 2013]
Also, let me explain why i need a library with saved variables: this library "nicktag" allow the player to set a nickname and avatar. This nickname is passed to others guild members through Ace-Comm, and i believe that its better create a cache and sent revision number instead of sending all nick name and avatar table every time the player enter in the game.
Also, i thing this need to be a library for others addons can embed and use.
Hi folks, this is a fast question, which i'm stuck and google isn't helping me in this one. What i need is .pkgmeta download another addon and move it to root directory, like this:
- Is this possible? i mean let the packpager download and after move the file.
- There is any way to use exclamation inside a YAML file? all the ways which i found on google doesn't seems to work here.
Thank you for reading this, if someone can help-me i appreciate.
0
Mercurial users are getting "HTTP Error: 500 (Internal Server Error)".
0
0
The addon (this) is big, i'm pasting here parts which a think is relevant to the problem.
I apologise in advance, for my bad coding and for few variables isn't being in English :(
This is where the window frame is created (gumps/janela_principal.lua, 2309):
This is the function which makes the setpoints plus the function responsible for creating rows (gumps/janela_principal.lua, 2736):
Code for change the window position when the profile is load (core/windows.lua, 166):
download the addon.
0
This video shows a issue with backdrop border, when i change its size some bars show the border correctly, others show a thin border, many bars don't even show.
At 0:21 seconds when turned borders off, rows 4 and 5 have no gap between them.
Before i start freaking out :confused: and flood you guys with tons of code, let me ask, those issues are caused by screen's pixels too?
https://www.youtube.com/watch?v=5pMkTyMoOFA
0
Not sure if i get it the part of positioning according with the screen's pixels, i mean, how can i know that a frame is correctly positioned and how i fix if doesn't.
btw, thanks for the answer, gave me some hope :)
0
The image below have two buttons, #1 and #2 using the same texture, size, texcoord and still are different. The right side border of #2 isn't solid black as #1 :(
And the worst part, i moved both windows containing the buttons to a random location and did /reload, the result:
If anyone want test this, the image used is this: http://i.imgur.com/hABA7qr.png and texcoords: 0.0185546875, 0.04736328125, 0.4833984375, 0.49853515625
As i need precision for this skin file, i wondering if splitting into lots of small individual files could be correct approach.
0
0
I'm aware about the division, i did used SetTexCoord (75/256, 165/256, 68/256, 158/256) coordinates from the second image, but the issue as shown on the first image is that the top red line have some white mixed within the red and the bottom red line is a little darker. Is this normal or i'm getting wrong coordinates?
Thanks again and sorry about the mess.
0
For instance, what image coords should be used to show only the square with red border in the center of this image? I'm using top left: 75 68 bottom right: 165 158.
Thank you for reading.
0
Concluding this topic, there is any way, a trick or else to a embed library save data when user logoff?
0
Thanks for this tip, i did not know that, i thing this is a game change eheheh.
About Masque example, i did download this "masque add" http://www.curse.com/addons/wow/masque-renaitre and i realize that the main addon Masque did not come inside the zip file.
If i assign Details as dependent of NickTag and someone download Details through his curse page (http://www.curse.com/addons/wow/details) NickTag will not come in the zip bundle right? Only if the user download through curse client NickTag will be installed automatically.
So, guys, is correct i just use everything mentioned before, like this?
This method nicktag will be placed inside the zip and also will be a dependence loading before the Details it self.
And again, thaks for reading and helping in this issue.
0
Thank you very much, this solve my problem and packpager are accepting ! (exclamation) with this method.
0
What i'm doing is actually is a library with saved variables, in my searches through the forum i've notice that this is not possible, so what i did (i'm noob with addons, if i'm doing something stupid, please let me know) is a library with .toc file in root directory and with the name beginning with ! exclamation for load before all others addons.
So, i had problem when sending the commit with exclamation (!) on .pkgmeta (see the quote on my first post):
Project links (perhaps might help you with something):
main addon: http://wow.curseforge.com/addons/details/
library: http://wow.curseforge.com/addons/nicktag/
Also, let me explain why i need a library with saved variables: this library "nicktag" allow the player to set a nickname and avatar. This nickname is passed to others guild members through Ace-Comm, and i believe that its better create a cache and sent revision number instead of sending all nick name and avatar table every time the player enter in the game.
Also, i thing this need to be a library for others addons can embed and use.
Thanks for reading.
0
- Is this possible? i mean let the packpager download and after move the file.
- There is any way to use exclamation inside a YAML file? all the ways which i found on google doesn't seems to work here.
Thank you for reading this, if someone can help-me i appreciate.