comparison ReagentMaker.lua @ 33:218e1dd1b821

Hide external frame when selecting a recipe which doesn't need this reagent
author contrebasse
date Fri, 29 Apr 2011 00:14:25 +0200
parents 22fa64c9b2de
children aa2f6965c0f6
comparison
equal deleted inserted replaced
32:416c307fd00b 33:218e1dd1b821
120 120
121 -- If only one recipe is known for the reagent, use it 121 -- If only one recipe is known for the reagent, use it
122 if #(A.data[reagentID]) == 1 and not A.data[reagentID].spell then 122 if #(A.data[reagentID]) == 1 and not A.data[reagentID].spell then
123 local numMakable, reagentIndex = A.numMakable(reagentID) 123 local numMakable, reagentIndex = A.numMakable(reagentID)
124 if not numMakable then 124 if not numMakable then
125 print("Sorry, i can't determine the number of makables reagents...") 125 print("Sorry, I can't determine the number of makables reagents...")
126 return 126 return
127 end 127 end
128 if numMakable>0 then 128 if numMakable>0 then
129 A.craft(reagentID,reagentRecipeIndex,reagentIndex,numMakable,chooseNumberToCraft) 129 A.craft(reagentID,reagentRecipeIndex,reagentIndex,numMakable,chooseNumberToCraft)
130 return 130 return
131 end 131 end
132
132 -- If we can make the item needed to make the reagent, open a window to make it 133 -- If we can make the item needed to make the reagent, open a window to make it
133 -- one step recursion, enables to mill to create an ink 134 -- one step recursion, enables to mill to create an ink
134 if A.data[A.data[reagentID][1][1]] then 135 if A.data[A.data[reagentID][1][1]] then
135 A.externalCraftWindow(A.data[reagentID][1][1]) 136 A.externalCraftWindow(A.data[reagentID][1][1],reagentID)
136 else 137 else
137 print("Sorry, couldn't make reagent...") 138 print("Sorry, couldn't make reagent...")
138 end 139 end
139 else 140 else
140 A.externalCraftWindow(reagentID) 141 A.externalCraftWindow(reagentID)