Mod Creation/Sidebar API Reference: Difference between revisions

Fix incorrect IDs for sidebar skills
(Add correct IDs to sidebar reference tutorial)
(Fix incorrect IDs for sidebar skills)
 
(2 intermediate revisions by the same user not shown)
Line 290: Line 290:


  <syntaxhighlight lang="js" line>// Navigate to the Woodcutting page
  <syntaxhighlight lang="js" line>// Navigate to the Woodcutting page
sidebar.category('Non-Combat').item('Woodcutting').click();</syntaxhighlight>
sidebar.category('Non-Combat').item('melvorD:Woodcutting').click();</syntaxhighlight>


=== toggle(force?: boolean): void ===
=== toggle(force?: boolean): void ===
Line 316: Line 316:


  <syntaxhighlight lang="js" line>// Removes the Summoning skill from the sidebar
  <syntaxhighlight lang="js" line>// Removes the Summoning skill from the sidebar
sidebar.category('Non-Combat').item('Summoning').remove();</syntaxhighlight>
sidebar.category('Non-Combat').item('melvorD:Summoning').remove();</syntaxhighlight>


=== subitem(id: string, config?: SubitemConfig, builder?: (subitem: Subitem) => void): Subitem ===
=== subitem(id: string, config?: SubitemConfig, builder?: (subitem: Subitem) => void): Subitem ===
Line 342: Line 342:


// Add a shortcut to Alt. Magic beneath Magic
// Add a shortcut to Alt. Magic beneath Magic
sidebar.category('Combat').item('Magic').subitem('Alt. Magic', {
sidebar.category('Combat').item('melvorD:Magic').subitem('Alt. Magic', {
   onClick() {
   onClick() {
     sidebar.category('Non-Combat').item('Alt. Magic').click();
     sidebar.category('Non-Combat').item('melvorD:Magic').click();
   }
   }
});</syntaxhighlight>
});</syntaxhighlight>