Quote:
|
If french (frFR) didn't exists then
Code:
tinsert(data, {item.announce[GetLocale()], item.icon, item.name}) Code:
tinsert(data, {item.announce["frFR"], item.icon, item.name}) Code:
tinsert(data, {nil, item.icon, item.name}) You could use something like the following that will test if the users locale announce field is in addon.db and if not, default to using the enUS text. Lua Code:
This assumes there will be a enUS field in EVERY announce table. You could of course, if you prefer, default to .frFR or .deDE whichever locale oocures in every entry. |
Quote:
Lua Code:
|
Code:
/run print(format("%s %s %s", "Replace", "with", text")) |
Quote:
Lua Code:
I tried this but it didn't work |
This makes it a bit more complicated as you're getting mutiple items for each row so you have to have them all cached before you can do the format().
I have to head out so I'll look at it in the morning. |
Quote:
Lua Code:
And an additional question. - https://www.wowinterface.com/forums/...t=59795&page=2 In the last topic you helped me make a timer. I plan to make another addon in the future that also uses this timer. The problem is that if a player installs 2 of these addons, the timer will not work correctly. I thought it was enough to fix ZAMROTimer to ZAMRO1Timer, but it looks like something else needs to be done? |
Double check that you have no common non local functions or variables. These would overwrite each other and thus cause one to not work properly.
If you can't see anything like this in both addons then, perhaps you can describe what you are seeing happen ? And if you don't have bugsack or buggrabber installed to catch any errors it might be worth doing to help pinpoint where it's breaking. Looking at the last code block Fizzle posted in that thread, just changing the frame name should be enough to make it work. |
Quote:
|
Did you make sure that each display has it's own location ?
You will need to adjust the anchor if you want them both displayed at the same time. If you notice in Fizzle's example code: Lua Code:
If both addons have the same anchor point their information will overlay each other on the screen. If you notice there is a frame_x and frame_y value there. If you are using the same code for your addon you can have each addon have different frame_x/frame_y values so that the frame will not overlay each other. |
Quote:
Lua Code:
|
Assuming you have the same file in each of the addons. Simply changing the frame name on line 8 as well as setting f to be local not global ( that would mess things up there ) and the frame_x and frame_y values on lines 6 and 7 might be all you need to do. Assuming the rest of the code does what the addon was designed to do.
So.. Addon 1 Lua Code:
Addon 2 Lua Code:
Although I see you have the frame dragging code set up to re-arrange as needed. So, the above should work well enough to make both frames separate and accessible and not overidden by the other one. I think having the f - CreateFrame line not be local was the main issue. |
Probably best to make separate threads for each question as the code is getting pretty messy even for just one (hopefully Xrystal has answered your timer question).
Having multiple item links and locales in your addon.db texts complicates things because the order you want the links to display might be different in german to the order displayed in french and might be different again for english. This requires identifying the order each link needs to be in for every locale text. With that in mind, the structure of addon.db needs to change so this is one way you could do it (my german in non-existant so it didn't even try): NOTE: the number if items in each itemOrder should be the same as the number of %s tokens that are in the corresponding text field. (This is probably overkill as it's replacing all the locale texts and you probably only need the ones that will be actually be used but that depends on what the end addon requires so...) Lua Code:
|
Quote:
Lua Code:
|
At some point along the line the addon .db table go messed up and the name field in the first first entry became a table instead of a string.
The 2 files data (addon.db) Lua Code:
Code (everything else) Lua Code:
|
Yes it works. Thank you very much. And the last question (with your help I have already figured out a lot)
I replaced Lua Code:
Lua Code:
|
Because the original table wasn't set up with localised names, we were just dealing with the announce texts.
To add localise names you woud have to convert ALL the name entried to tables: Data Lua Code:
And change the tinsert line in the updateData() function to reflect the change Code Lua Code:
|
Quote:
|
Missing commas, mayube this time.
Lua Code:
Lua Code:
|
Quote:
Lua Code:
|
All times are GMT -6. The time now is 12:19 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI