Changes

Jump to navigation Jump to search
no edit summary
Line 200: Line 200:  
==Menus==
 
==Menus==
 
//todo describe section
 
//todo describe section
===Set 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.
 +
 
 +
Here is an example for getting the MapPage:
 +
<source lang="c#">
 +
GameMenu menu = (GameMenu)Game1.activeClickableMenu;
 +
List<IClickableMenu> menuPages = (List<IClickableMenu>)typeof(GameMenu).GetField("pages", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu);
 +
MapPage mapPage = (MapPage)menuPages[menu.currentTab];
 +
</source>
 +
===Set the Active Menu===
 
Game1.activeClickableMenu = <Menu>
 
Game1.activeClickableMenu = <Menu>
 
===Simple Menu===
 
===Simple Menu===
17

edits

Navigation menu