Gaming
 

HelpLib

From WoWWiki

Contents

Summary

  • Library for adding questions and answers to the default Help frame under special categories.
  • Note: If more than one addon has this library embedded (or this library exists as a standalone), only the newest version will be loaded.
  • Note: While the search function will work, it will not work with the "All" category selected
  • Note: You cannot add questions to the default categories


Download

Features

  • Embeddable library
  • Allows you to add questions to the default Help frame.

Examples

Question 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)

Basic question Example

  local BasicQuestion={
    q="What is an addon?",
    a="An addon is generally a modification or addition to the user interface (UI)",
 }
 HelpLib.AddQuestion(BasicQuestion)

Complex Example

 if HelpLib_Loaded then
 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=HelpLib.CategoryExists("Cosmos") and "Cosmos" or "Addons",
  subcat="TasteTheNaimbow",
 }
 HelpLib.AddQuestion(ChangeColorQuestion)
 end

Action Example

 local HowToShowCloak={
   q="How do I hide my cloak?",
   a=[[To hide your cloak, go to Esc->Interface Options and check "Hide Cloak". Alternatively, you can use the Action bar to do it from here.]],
   hot=true,
   new=true,
   cat="Tests",
   act={
       [1]={
           text="Hide Cloak",
           act=function() ShowCloak(0) end,
           },
       [2]={
           text="Show Cloak",
           act=function() ShowCloak(1) end,
           },
       }
   }
 HelpLib.AddQuestion(HowToShowCloak)

User Functions

Embedding

To embed HelpLib in your addon:

  • Option 1 (Good for if you use multiple libraries
1) Drop the HelpLibrary folder in your Libs folder
2) Either add the following to your xml file:
<Include file="Libs\HelpLibrary\HelpLibrary.lua"/>
Or add this line to your toc file:
Libs\HelpLibrary\HelpLibrary.lua
  • Option 2 (Good if you use few libraries)
1) Drop the HelpLibrary folder in your addon folder
2) Either add the following to your xml file:
<Include file="HelpLibrary\HelpLibrary.lua"/>
Or add this line to your toc file:
HelpLibrary\HelpLibrary.lua