− | The list of root locations is stored in <tt>Game1.locations</tt>, but constructed building interiors aren't included. This method provides all locations in the game for the main player: | + | The list of root locations is stored in <samp>Game1.locations</samp>, but constructed building interiors aren't included. This method provides all locations in the game for the main player: |
− | Note that farmhands in multiplayer can't see all locations; see [[Modding:Modder Guide/APIs/Multiplayer#GetActiveLocations|<tt>GetActiveLocations</tt>]] instead. | + | Note that farmhands in multiplayer can't see all locations; see [[Modding:Modder Guide/APIs/Multiplayer#GetActiveLocations|<samp>GetActiveLocations</samp>]] instead. |
− | To create a custom menu, you need to create a subclass of <tt>IClickableMenu</tt> and assign it to <tt>Game1.activeClickableMenu</tt>. At its most basic, a menu is basically just a few methods you override (usually <tt>draw</tt> and <tt>receiveLeftClick</tt> at a minimum). When <tt>draw</tt> is called, you draw whatever you want to the screen; when <tt>receiveLeftClick</tt> is called, you check if it's within one of the clickable areas and handle it. Normally you'd use some convenience classes like <tt>ClickableTextureButton</tt> (which has a texture and position, and simplifies checking if they were clicked), though that's not strictly necessary. Here's [https://github.com/janavarro95/Stardew_Valley_Mods/blob/master/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs a simple menu] you can use as an example, which draws the birthday menu for {{nexus mod|520|Birthday Mod}}. | + | To create a custom menu, you need to create a subclass of <samp>IClickableMenu</samp> and assign it to <samp>Game1.activeClickableMenu</samp>. At its most basic, a menu is basically just a few methods you override (usually <samp>draw</samp> and <samp>receiveLeftClick</samp> at a minimum). When <samp>draw</samp> is called, you draw whatever you want to the screen; when <samp>receiveLeftClick</samp> is called, you check if it's within one of the clickable areas and handle it. Normally you'd use some convenience classes like <samp>ClickableTextureButton</samp> (which has a texture and position, and simplifies checking if they were clicked), though that's not strictly necessary. Here's [https://github.com/janavarro95/Stardew_Valley_Mods/blob/master/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs a simple menu] you can use as an example, which draws the birthday menu for {{nexus mod|520|Birthday Mod}}. |