- Home
- Downloads
-
Addons & Mods
Featured
World of Warcraft
6,109 Addons
-
Popular Downloads
- Top World of Warcraft Addons
- Top Minecraft Server Mods
- Top Rift Addons
- Top Skyrim Mods
- Top World of Tanks Skins
- Top StarCraft II Maps
- Top Terraria Maps
- Top Runes of Magic Addons
- Top Warhammer Online Addons
- Top The Secret World Mods
- Top Age of Conan Addons
-
- Curse Client
- Premium
- News
- Giveaways
- Forums
- Store
CustomTutorials-2.0
- 0 Likes
- World of Warcraft
- 5 Monthly Downloads
- Supports: 4.0.3a
- 1,090 Total Downloads
- Updated 01/30/2011
- Created 02/28/2010
- 1 Favorites
- Project Site
- Release Type: Release
- License: All Rights Reserved
- Newest File: 5
About CustomTutorials-2.0
This library makes easy the creation of custom tutorials for your addons. It provides the following API:
- .RegisterTutorials(id, data)
- .TriggerTutorial(id, index, force)
- .ResetTutorials(id)
- .GetTutorials(id)
Accessing
The easiest way to access CustomTutorials methods is to embed them into your addon object:
local Tutorials = LibStub("CustomTutorials-2.0") Tutorials:Embed(MyObject)
But you may also set CustomTutorials as a local variable and call the methods directly.
Tutorials.RegisterTutorials("MyTutorial", { -- data goes here })
Registering
First of all, you must register the new tutorials for you addon:
MyAddon:RegisterTutorials({ savedvariable = "MyAddon_TutorialsSavedVariable", title = "MyAddons", { -- This is tutorial #1 text = "Hello", image = "SomeImage", }, { -- Tutorial #2 text = "Bye", } })
Currently, these are the arguments supported for the registering table (General) and for each tutorial (all of them are optional):
| General Arguments | |
|---|---|
| savedvariable | If set, CustomTutorials will memorize which tutorials the user has already seen between sessions and manage which to show for you |
| title | If set, it is used as the default title when not provided for the tutorial itself |
| Tutorial Arguments | |
|---|---|
| title | |
| text | |
| textX, textY | |
| image | |
| imageX, imageY | |
| shine | The frame to anchor the flashing "look at me!" glow |
| shineTop, shineBottom, shineLeft, shineRight | |
| height | CustomTutorials should be able to manage the window height most cases for you, but you can set it yourself. |
| anchor | Which frame to anchor the tutorial window (defaults to UIParent) |
| point | Which point to anchor the tutorial with (defaults to Center) |
| relPoint | Which point to anchor the tutorial to (if not provided, will use point instead) |
| x, y |
Triggering
Finally, you need to tell CustomTutorials when you want the tutorials to be shown. If you provided the savedvariable argument, you won't have to worry about which ones the user has already seen neither to save that information. CustomTutorials will handle that for you:
-- Shows up to tutorial #3 if the user has not seen it already MyAddon:TriggerTutorial(3)
-- Shows tutorial #3. Yeah, you forced it. MyAddon:TriggerTutorial(3, true)
Example
This example registers 3 tutorials; shows tutorial #1 when the user loads the addon for the first time; shows tutorials #2 and #3 when MyAddon_OnSomeEvent is called for the first time; and allows the user to see the tutorials again when MyAddon_OnHelpRequest is called.
MyAddon:RegisterTutorials( { savedvariable = "MyAddon_TutorialsState", { text = "Welcome to MyAddon", shine = MyAddon, }, { text = "This is helpfull", }, { text = "I hope you enjoyed this tutorial example.", image = 'ByeImage', }, }) function MyAddon_OnInitialize() -- Show welcome MyAddon:TriggerTutorial(1) end function MyAddon_OnSomeEvent() -- Show #2 and unlock #3 MyAddon:TriggerTutorial(3) end function MyAddon_OnHelpRequest() -- Show tutorials again when the user asks MyAddon:TriggerTutorial(1, true) end
Version 5
- Added .ResetTutorials method
- Changed the behavior of TriggerTutorial
- Bug fixes
Version 4
- Suuports new argument: relPoint
Version 3
- Supports new argument: anchor
- Now the internal methods used by the library are not embedded by EmbedHandler
Version 2
- Replaced shineX and shineY by shineTop, shineBottom,... etc
Version 1
- Completely changed how it behaves. It no longer hacks Blizzard's code. Much safer now.
- Updated for 4.0.1
- Initial release
Top Downloads
-
- Deadly Boss Mods
- Combat, PvP, and Boss Encounters
- 1,172,613 Monthly Downloads
-
- Bagnon
- Bags & Inventory
- 491,839 Monthly Downloads
-
- AtlasLoot Enhanced
- Map & Minimap, Professions, Arena, and Boss Encounters
- 393,478 Monthly Downloads
-
- Deadly Boss Mods - Burning Crusade and Vanilla mods
- Combat and Boss Encounters
- 350,761 Monthly Downloads
-
- Recount
- Combat
- 329,575 Monthly Downloads
