Comments on changesets
That is because you are creating it when the file loads. At that point the localization library is not yet available. This is mainly an issue in when localizing GHM. You should be able to fix it with the following alternative:
local loc;
local frame = CreateFrame("Frame");
frame:RegisterEvent("VARIABLES_LOADED");
frame:SetScript("OnEvent",function()
loc = GHI_Loc();
end
By Aurorablade (changeset: 723) May 06, 2012 @ 02:47am UTC
I get an error that i can't acess GHI_Loc though.
Instead of currentPos, you need to find the position that are determined by the input. When you have added the input it will look something like:
local targetPos = {
x = dyn.GetInput("x"),
y = dyn.GetInput("y"),
continent = dyn.GetInput("continent"),
}
In pairs({GetProfessions()}) all the arguments of GetProfessions are put into a table (the { } part). Then this table is given to the pairs operation.
That means that in the "for _,prof in pairs({GetProfessions()}) do" prof will first be the index for prof1, then prof2 in next loop, then archaeology and so on.
That means that in the "for _,prof in pairs({GetProfessions()}) do" prof will first be the index for prof1, then prof2 in next loop, then archaeology and so on.
By Aurorablade (changeset: 605) Jan 20, 2012 @ 02:05pm UTC
when i didn't change it i was in a 'wait do i need this part of code' mindset..will change in a bit there.
and i am not sure the code would work as it works like this
http://wowprogramming.com/docs/api/GetProfessions
prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions()
Returns:
prof1 - The index of the first profession; nil if first profession is missing (number)
prof2 - The index of the second profession; nil if second profession is missing (number)
archaeology - The index of Archeology; nil if Archeology is missing (number)
fishing - The index of Fishing; nil if Fishing is missing (number)
cooking - The index of Cooking; nil if Cooking is missing (number)
firstAid - The index of First Aid; nil if First Aid is missing (number)
the indexes you then pass to
http://wowprogramming.com/docs/api/GetProfessionInfo
name, texture, rank, maxRank, numSpells, spelloffset, skillLine, rankModifier = GetProfessionInfo(index)
Arguments:
index - The index of the profession (can be found with GetProfessions()) (number)
Returns:
name - Localized name of the skill (string)
texture - Path to the icon texture of the skill (string)
rank - The current skill level. This does not change when rankModifier is greater than 0 (number)
maxRank - The current skill cap (number)
numSpells - The number of abilities/icons listed. These are the icons you put on your action bars (number)
spelloffset - (number)
skillLine - The constant value of the skill (e.g. Archeology is 794, Cooking is 185). These constants can be found in the enum that includes other constants, such as talent spec, race, language, pet type, and mount type (number)
rankModifier - Additional modifiers to your profession levels (e.g. Lures for Fishing). (number)
though it might work and i might need more coffee at this point in time.
and i am not sure the code would work as it works like this
http://wowprogramming.com/docs/api/GetProfessions
prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions()
Returns:
prof1 - The index of the first profession; nil if first profession is missing (number)
prof2 - The index of the second profession; nil if second profession is missing (number)
archaeology - The index of Archeology; nil if Archeology is missing (number)
fishing - The index of Fishing; nil if Fishing is missing (number)
cooking - The index of Cooking; nil if Cooking is missing (number)
firstAid - The index of First Aid; nil if First Aid is missing (number)
the indexes you then pass to
http://wowprogramming.com/docs/api/GetProfessionInfo
name, texture, rank, maxRank, numSpells, spelloffset, skillLine, rankModifier = GetProfessionInfo(index)
Arguments:
index - The index of the profession (can be found with GetProfessions()) (number)
Returns:
name - Localized name of the skill (string)
texture - Path to the icon texture of the skill (string)
rank - The current skill level. This does not change when rankModifier is greater than 0 (number)
maxRank - The current skill cap (number)
numSpells - The number of abilities/icons listed. These are the icons you put on your action bars (number)
spelloffset - (number)
skillLine - The constant value of the skill (e.g. Archeology is 794, Cooking is 185). These constants can be found in the enum that includes other constants, such as talent spec, race, language, pet type, and mount type (number)
rankModifier - Additional modifiers to your profession levels (e.g. Lures for Fishing). (number)
though it might work and i might need more coffee at this point in time.
It looks quite good overall. I can not see any direct errors in them. There is just some minor things (see my commets on some lines).
You can consider making the prof one more effective by doing something like:
You can consider making the prof one more effective by doing something like:
for _,prof in pairs({GetProfessions()}) do
local name = GetProfessions(prof)
if name:lower() == targetProf:lower() then
dyn.TriggerOutPort("hasProf");
end
end