Changes

Jump to navigation Jump to search
no edit summary
Line 201: Line 201:  
//todo describe section
 
//todo describe section
 
===Get the Active Menu===
 
===Get the Active Menu===
You can use ''Reflection'' to get the current active ''GameMenu''. The ''GameMenu'' contains the Inventory, Skills, Social, Map, Crafting, Collections, and Options pages in this respective order, accessed by the tab index with ''inventoryTab'' at 0.
+
You can use ''Reflection'' to get the current active menu in ''GameMenu''. The ''GameMenu'' contains the Inventory, Skills, Social, Map, Crafting, Collections, and Options pages in this respective order, accessed by the tab index with ''inventoryTab'' at 0.
    
<source lang="c#">
 
<source lang="c#">
Line 207: Line 207:  
   IList<IClickableMenu> pages = this.Helper.Reflection.GetField<List<IClickableMenu>>(menu, "pages").GetValue();
 
   IList<IClickableMenu> pages = this.Helper.Reflection.GetField<List<IClickableMenu>>(menu, "pages").GetValue();
 
   IClickableMenu page = pages[menu.currentTab];
 
   IClickableMenu page = pages[menu.currentTab];
 +
 +
  // Example for getting the MapPage
 +
  MapPage mapPage = (MapPage) pages[menu.currentTab];
 +
}
 
</source>
 
</source>
  
17

edits

Navigation menu