Thread Tools Display Modes
12-28-14, 10:38 AM   #1
samyonair
A Frostmaul Preserver
 
samyonair's Avatar
Join Date: May 2009
Posts: 257
Hello,

a german User (DeaTHCorE) not firm to post this in English has given me some Ideas and a Zipfile with changes,

Tranlated Part:

Hi,

I have following Problem: with the Addon Dugi's Guide, there is added to blizzards list for Positions to track, also a List with teachers for proffessions etc. added, If I want to track a teacher, it comes to failure in Duggi's Guide and after searching hours in the Code cannot find anything that is breaking the code.

The Failure is produced by the function SetMapByID in NXMap.lua in line 230
I have all that is possible tested, also to comment it out, but it helped not, then I have changed the functionname to SetMapByID2 and all Call-ups in the file NxMap.lua changed and in the fuction itself the call-up of blizSetMapByID(Zone,Level) or respectively blizSetMapByID(Zone) changed to SetMapByID(zone,level) or respectively SetMapByID(zone) and commented out the declaration of local blizSetMapByID = SetMapByID. That effects that all Call-Ups for Carbonite are executed and the Error is fixed, could be working for other Addons, too.
Comment by Samyonair: "But that could be reset the working of doubled ZoneNames I think"
"He has send me the files to compare I have added them to this Thread"

I have changed some parts in NxQuest.lua with fixing missing Translation Terms and some variables that not used anymore on load and some constants in the Questdatabase which are initialisized with lvl 90, but we have lvl 100 now, i think this was missed.

Oh well, in the file NxMap.lua i have filled the table NxMapIDtoName (comment is there too), that eliminates the failures with ZoneMonitoring (Minimap right click and in Menu Zone Monitoringcomment:" don't know the term in English locale at the Moment" i think it's right but not sure, the table itself is comment out but the table is used at some parts (in Comment is written in which files)

In Attachment: NxMAp.lua, NxQuest.lua and the german locales files for it (Carbonite/locales/deDE/map.lua and Carbonite.Quests/locales/de.lua

At the end: In file NxUI.lua line 97 is false it has to be changed from
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. (format (msg, ...) or "nil"), 1, 1, 1)
to
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. format(msg, (... or "nil")), 1, 1, 1)
, because otherwise it comes to a failure if no Values are found
greetings David aka DeaTHCorE

end of Translation
________________________________

just for Discussion

greetings Samyonair



http://www.wowinterface.com/forums/a...1&d=1419784663
Attached Files
File Type: zip Carbonite Data david.zip (120.1 KB, 462 views)

Last edited by samyonair : 12-28-14 at 11:15 AM.
  Reply With Quote
12-28-14, 05:58 PM   #2
Rythal
Featured Artist
Featured
Join Date: Aug 2012
Posts: 1,458
Originally Posted by samyonair View Post
Hello,

a german User (DeaTHCorE) not firm to post this in English has given me some Ideas and a Zipfile with changes,

Tranlated Part:

Hi,

I have following Problem: with the Addon Dugi's Guide, there is added to blizzards list for Positions to track, also a List with teachers for proffessions etc. added, If I want to track a teacher, it comes to failure in Duggi's Guide and after searching hours in the Code cannot find anything that is breaking the code.

The Failure is produced by the function SetMapByID in NXMap.lua in line 230
I have all that is possible tested, also to comment it out, but it helped not, then I have changed the functionname to SetMapByID2 and all Call-ups in the file NxMap.lua changed and in the fuction itself the call-up of blizSetMapByID(Zone,Level) or respectively blizSetMapByID(Zone) changed to SetMapByID(zone,level) or respectively SetMapByID(zone) and commented out the declaration of local blizSetMapByID = SetMapByID. That effects that all Call-Ups for Carbonite are executed and the Error is fixed, could be working for other Addons, too.
Comment by Samyonair: "But that could be reset the working of doubled ZoneNames I think"
"He has send me the files to compare I have added them to this Thread"

I have changed some parts in NxQuest.lua with fixing missing Translation Terms and some variables that not used anymore on load and some constants in the Questdatabase which are initialisized with lvl 90, but we have lvl 100 now, i think this was missed.

Oh well, in the file NxMap.lua i have filled the table NxMapIDtoName (comment is there too), that eliminates the failures with ZoneMonitoring (Minimap right click and in Menu Zone Monitoringcomment:" don't know the term in English locale at the Moment" i think it's right but not sure, the table itself is comment out but the table is used at some parts (in Comment is written in which files)

In Attachment: NxMAp.lua, NxQuest.lua and the german locales files for it (Carbonite/locales/deDE/map.lua and Carbonite.Quests/locales/de.lua

At the end: In file NxUI.lua line 97 is false it has to be changed from
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. (format (msg, ...) or "nil"), 1, 1, 1)
to
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. format(msg, (... or "nil")), 1, 1, 1)
, because otherwise it comes to a failure if no Values are found
greetings David aka DeaTHCorE

end of Translation
________________________________

just for Discussion

greetings Samyonair



http://www.wowinterface.com/forums/a...1&d=1419784663
I've known about this bug & fix but left it alone because I prefer it ends up as an lua error (and in bugstaq) if I was trying to print something and it's got an error. Being on a very populated server I easily loose important messages.
  Reply With Quote
12-29-14, 02:41 AM   #3
atl77
A Chromatic Dragonspawn
Join Date: Oct 2014
Posts: 179
Originally Posted by samyonair View Post
At the end: In file NxUI.lua line 97 is false it has to be changed from
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. (format (msg, ...) or "nil"), 1, 1, 1)
to
Lua Code:
  1. f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. format(msg, (... or "nil")), 1, 1, 1)
, because otherwise it comes to a failure if no Values are found
This will only work if msg requires one further argument; it only fixes a small part of the problem by brushing over the original error.

To make this more failsafe, you'd have to redesign the whole thing so the placeholder for missing arguments could be replaced by some verbose string. I'll think about it and probably come up with some solution later.

Update: here's the function:
Lua Code:
  1. function Nx.prt (...)
  2.     local args = {...}
  3.     local i = 1
  4.     -- replace missing/erroneous placeholders
  5.     function replace_placeholders(placeholder, item)       
  6.         i = i + 1
  7.         if (args[i] == nil) then
  8.             return '[missing argument]'
  9.         end
  10.         if item ~= 's' and item ~= 'q' then
  11.             if type(args[i]) == 'string' and string.match(args[i], '^[.0-9]+$') then
  12.                 return placeholder
  13.             elseif type(args[i]) ~= 'number' then
  14.                 return '[not a number]'
  15.             end
  16.         end
  17.         return placeholder
  18.     end
  19.     args[1] = string.gsub((args[1] or 'nil'), '(%%[0-9.]*([cdeEfgGioqsuxX]))', replace_placeholders)
  20.    
  21.     local f = Nx.prtChatFrm or DEFAULT_CHAT_FRAME
  22.     f:AddMessage (Nx.TXTBLUE..L["Carbonite"].." |cffffffff".. format (unpack(args)), 1, 1, 1)
  23. end

Pushed it to github.

Last edited by atl77 : 12-29-14 at 04:23 AM.
  Reply With Quote

WoWInterface » Featured Projects » Carbonite » Carbonite: Dev Talk » Idea from German User translated

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off