Go to Page... |
Compatibility: | Firesong (8.2.5) Lost Depths (8.1.5) High Isle (8.0.0) Ascending Tide (7.3.5) Deadlands (7.2.5) Waking Flame (7.1.5) Blackwood (7.0.5) Greymoor (6.0.5) |
Updated: | 10/29/22 12:42 AM |
Created: | 07/31/21 06:50 AM |
Monthly downloads: | 1,522 |
Total downloads: | 61,139 |
Favorites: | 4 |
MD5: |
local tutorialArray = { ["hudbrief"] = { --ID must be at least (string) 5 characters or > (number) 9999 title = "", --(string) No title displayed nor needed for this Tutorial Type text = "Example Description", --(string) tutorialType = LIB_TUTORIAL_TYPE_HUD_BRIEF, --LibTutorial Global displayPriority = nil, --Not used for this Tutorial Type }, ["hudinfo"] = { --ID must be at least (string) 5 characters or > (number) 9999 title = "Example Title", --(string) text = "Example Description", --(string) tutorialType = LIB_TUTORIAL_TYPE_HUD_INFO, --LibTutorial Global displayPriority = 1, --(number) Determines priority when inserted into the queue }, }
LIB_TUTORIAL_TYPE_HUD_BRIEF --Brief Hud Tutorial LIB_TUTORIAL_TYPE_HUD_INFO --Hud Info Tutorial LIB_TUTORIAL_TYPE_UI_INFO_BOX --UI Info Box Tutorial LIB_TUTORIAL_TYPE_POINTER_BOX --Pointer Box Tutorial
LIB_TUTORIAL_EXAMPLE = LibTutorialSetup.New(tutorialArray)
LIB_TUTORIAL_EXAMPLE:DisplayTutorial(tutorialId) --This is the main function you'd use to display your tutorial. It returns true if the tutorial successfully displays.
local function SetTutorialSeen(tutorialId, seen) AddOnSavedVars.tutorialSeen[tutorialId] = seen end function ExampleNamespace.GetTutorialSeen(tutorialId) return AddOnSavedVars.tutorialSeen[tutorialId] end function ExampleNamespace.DoDisplayStuff(tutorialId) if not ExampleNamespace.GetTutorialSeen(tutorialId) then if LIB_TUTORIAL_EXAMPLE:DisplayTutorial(tutorialId) then SetTutorialSeen(tutorialId, true) end end end
LibTutorialSetSubMenuContainerIsOpen(control, open)
local LAM = LibAddonMenu2 tutorialStepsExample = { options = { showStepNumInTitle = true, --(boolean) Format title as "Title (#/n)" tutorialType = LIB_TUTORIAL_TYPE_POINTER_BOX, --LibTutorial Global (must be LIB_TUTORIAL_TYPE_UI_INFO_BOX for Steps/Sequence) isLAMPanel = true, --(boolean) If the sequence is for your LAM Panel, (automatically sets fragment and scrollCtr) }, [1] = { id = "libtutpb", --ID must be at least (string) 5 characters or > (number) 9999 title = "Test Tutorial Sequence", --(string) text = "Test <LibTutorialDescriptionCtrl> Text!", --(string) anchorToControlData = {LEFT, "LibTutorialDescriptionCtrl", RIGHT, 0}, --(myPoint, anchorTargetControl, anchorControlsPoint, offsetX, offsetY) --scrollCtrl = GetControl("ScrollControl") --(optional) The container of the scrollCtrl if required (this requires an attribute of scrollCtrl.scroll). Value is automatically set if isLAMPanel is true --fragment = LAM:GetAddonSettingsFragment(), --(optional) Fragment to which to attach the tutorial. If used, the tutorial will hide with the fragment. Value is automatically set if isLAMPanel is true --Callback that triggers just -before- the tutorial is displayed --Used here to open the SubMenu as the tutorial is displayed iniCustomCallback = function() local control = GetControl("LibTutorialDescriptionCtrl") LibTutorialSetSubMenuContainerIsOpen(control, true) --This control isn't a submenu or in a submenu, this call is just here to show it does what it should (nothing) if there is no submenu to be found end, --Callback that triggers when a user left-clicks on the tutorial popup --Displaying the next tutorial in sequence is handled by LibTutorial, but you can do other stuff here if you want --(It will be called -before- the next tutorialStep is shown) nextCustomCallback = function(nextTutStepId) local control = GetControl("LibTutorialDescriptionCtrl") end, --Callback that triggers when a user right-clicks on the tutorial pointer box exitCustomCallback = function(currTutStepId) d(zo_strformat("ID: <<1>>, exitCustomCallback", currTutStepId)) end, }, [2] = { id = "libtutpbtwo", title = "Test Tutorial Sequence", text = "Test <LibTutorialCheckBoxCtrl> Text!", anchorToControlData = "LibTutorialCheckBoxCtrl6", iniCustomCallback = function() -- end, --nextCustomCallback = function(nextTutStepId) end, --exitCustomCallback = function(currTutStepId) end, }, [3] = { id = "libtutpbthree", title = "Test Tutorial Sequence", text = "Test <LibTutorialHeaderCtrl> Text!", anchorToControlData = "LibTutorialEditBox2", iniCustomCallback = function() -- end, --nextCustomCallback = function(nextTutStepId) end, --exitCustomCallback = function(currTutStepId) end, }, [4] = { id = "libtutpbfour", title = "Test Tutorial Sequence", text = "Test <LibTutorialEditBox> Text!", anchorToControlData = "LibTutorialEditBox3", iniCustomCallback = function() -- end, --nextCustomCallback = function(nextTutStepId) end, --exitCustomCallback = function(currTutStepId) end, }, [5] = { id = "libtutpbfive", title = "Test Tutorial Sequence", text = "Test <LibTutorialEditBox> Text!", anchorToControlData = "LibTutorialCheckBoxCtrl7", iniCustomCallback = function() local control = GetControl("LibTutorialCheckBoxCtrl7") LibTutorialSetSubMenuContainerIsOpen(control, true) end, --This callback won't fire because it's the last in the sequence, there is no "next" nextCustomCallback = function(nextTutStepId) local control = GetControl("LibTutorialCheckBoxCtrl7") LibTutorialSetSubMenuContainerIsOpen(control, false) end, exitCustomCallback = function(nextTutStepId) local control = GetControl("LibTutorialCheckBoxCtrl7") LibTutorialSetSubMenuContainerIsOpen(control, false) end, }, }
--Example Tutorial Sequence Function (Triggered with the button in the LibTutorial LAM Panel) LIB_TUTORIAL_EXAMPLE:StartTutorialSequence(tutorialStepsExample) --This is the main function you'd use to display a tutorial route
File Name |
Version |
Size |
Uploader |
Date |
1.13 |
16kB |
Alianym |
09/26/22 12:55 AM |
|
1.12 |
16kB |
Alianym |
05/30/22 09:21 AM |
|
1.11 |
16kB |
Alianym |
05/30/22 08:11 AM |
|
1.10 |
16kB |
Alianym |
05/22/22 03:24 AM |
|
1.02 |
8kB |
Alianym |
02/08/22 05:45 AM |
|
1.01 |
8kB |
Alianym |
02/07/22 08:03 AM |
|
1.0 |
8kB |
Alianym |
02/07/22 07:05 AM |
|
0.2 |
8kB |
07/31/21 06:50 AM |
Comment Options |
Alianym |
View Public Profile |
Send a private message to Alianym |
Find More Posts by Alianym |
Add Alianym to Your Buddy List |
02/07/22, 08:44 PM | ||
|
Also, for anyone following along on this page: there's currently a bug with HudInfo-type tutorials I noticed when messing around with it earlier. I'll aim to fix this shortly, but if anyone is already using this and comes across a bug, this may be it. But feel free to post if you get a bug anyway. |
|
|
Alianym |
View Public Profile |
Send a private message to Alianym |
Find More Posts by Alianym |
Add Alianym to Your Buddy List |
02/07/22, 08:06 AM | |||
|
Btw 1 question:
Is the ID used for the tutorial global for all addons, so do I need to use something like "MyAddonName_Tut1" as ID? or is it just registered per addon using the lib? I saw it can be a number too so using the same ID number, e.g. 1, will overwrite other addons tutorials then? Edit: As info: Seems the index will be saved internally for each created object of that lib so as long as no addon is reusing the object of another addon, and creates it's own object to use, it should be internally split by addons.
Last edited by Baertram : 02/07/22 at 11:54 AM.
|
||
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
02/07/22, 08:01 AM | ||
|
Fixing it now. |
|
|
Alianym |
View Public Profile |
Send a private message to Alianym |
Find More Posts by Alianym |
Add Alianym to Your Buddy List |
02/07/22, 07:53 AM | |
|
Thanks for the lib.
Your APIversion is outdated 3 patches ## APIVersion: 100035 Current: ## APIVersion: 101032 |
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |