HelpLib.AddQuestion
From WoWWiki
This article is a part of the documentation of the HelpLib function library
Adds a question to the help database
HelpLib.AddQuestion(QuestionTable)
Parameters
Arguments
- QuestionTable in the format:
QuestionTable={
q="Question",
a="Answer",
hot=true/false, --(false if not provided) (questions with both hot and new come first)(hot ones come second)
new=true/false, --(false if not provided) (new come third)
cat="CategoryName", --("Addons" if not provided)
subcat="SubCategoryName", --(usually the addon name) (Not in a sub category if not provided)
act={ --To add actions
[1]={ --The index of the action (for order)
text="Text", --The text to label the action as
act=function() SomeFunction() end, --The function to call when the action is clicked
},
[2]={ --Same as above
text=variable, --A variable can also be used. Note that it will not change once the question is created
act=loadstring("SomeFunction()") --Another way to get a function.
}
}
Returns
- nil
Example
local ChangeColorQuestion={
q="Can I change the color of my name?",
a="No, it is not currently possible to change the color of your name",
hot=true,
new=false,
cat="Addons",
subcat="TasteTheNaimbow"
}
HelpLib.AddQuestion(ChangeColorQuestion)
Result
A new category called "Addons" will be created if it does not already exist. Under that category, a new subcategory called "TasteTheNaimbow" will be created if it does not already exist. A question will be added here asking "Can I change the color of my name?". If clicked, it will display the answer "No, it is not currently possible to change the color of your name". The question will have the "hot" icon next to it and be near the top (only under questions that are both "hot" and "new"), but will not have the "new" icon.
Details
- Adds a question to the Help database. This question is not searchable under the "all" category", but is searchable under its own.
- Notes
- A question and an answer are required. The rest is optional.
