Changes

Jump to navigation Jump to search
→‎Custom shops: update for build 23313 (added ClosedMessage and renamed Utility.OpenShop)
Line 5,996: Line 5,996:  
|-
 
|-
 
| <samp>Owners</samp>
 
| <samp>Owners</samp>
| ''(Optional)'' The portrait and dialogue to show in the shop menu UI.
+
| ''(Optional)'' The portrait and dialogue to show in the shop menu UI, ''or'' the message to show indicating that the shop is close if <samp>ClosedMessage</samp> is set.
    
When the [[#Map/tile property changes|<samp>Action OpenShop</samp> tile property]] specifies {{o|owner tile area}}, the first NPC within the tile area which matches an owner entry is used; if no NPCs match, the shop isn't opened. If <samp>Owners</samp> is omitted, the shop is opened regardless of whether an NPC is present, and no portrait or dialogue is shown.
 
When the [[#Map/tile property changes|<samp>Action OpenShop</samp> tile property]] specifies {{o|owner tile area}}, the first NPC within the tile area which matches an owner entry is used; if no NPCs match, the shop isn't opened. If <samp>Owners</samp> is omitted, the shop is opened regardless of whether an NPC is present, and no portrait or dialogue is shown.
Line 6,054: Line 6,054:     
This can be set to an empty list (<code>"Dialogues": []</code>) to disable the dialogue text entirely. If omitted, defaults to a generic "''Have a look at my wares''" text.
 
This can be set to an empty list (<code>"Dialogues": []</code>) to disable the dialogue text entirely. If omitted, defaults to a generic "''Have a look at my wares''" text.
 +
|-
 +
| <samp>ClosedMessage</samp>
 +
| ''(Optional)'' If set, a [[#Tokenizable string format|tokenizable string]] for a 'shop is closed'-style message to show instead of opening the shop.
 
|-
 
|-
 
| <samp>RandomizeDialogueOnOpen</samp>
 
| <samp>RandomizeDialogueOnOpen</samp>
Line 6,157: Line 6,160:  
You can place an [[#Map/tile property changes|<samp>Action OpenShop</samp> tile property]] on the map, which will open the given shop ID when the player clicks it.
 
You can place an [[#Map/tile property changes|<samp>Action OpenShop</samp> tile property]] on the map, which will open the given shop ID when the player clicks it.
   −
In C# code, you can get the inventory for a custom shop using <code>Utility.GetShopStock("shop id here")</code>, open a shop menu using <code>Utility.OpenShopMenu("shop id", …)</code>, and add temporary items to an open menu using <code>shopMenu.AddForSale(…)</code>. The ID of the opened shop is stored in the shop menu's <samp>storeContext</samp> field.
+
In C# code, you can get the inventory for a custom shop using <code>Utility.GetShopStock("shop id here")</code>, open a shop menu using <code>Utility.TryOpenShopMenu("shop id", …)</code>, and add temporary items to an open menu using <code>shopMenu.AddForSale(…)</code>. The ID of the opened shop is stored in the shop menu's <samp>storeContext</samp> field.
    
====Examples====
 
====Examples====
translators
8,456

edits

Navigation menu