第91行: |
第91行: |
| 角色(Character) 的位置(Position) 表示他在当前地点(Location) 的坐标。 | | 角色(Character) 的位置(Position) 表示他在当前地点(Location) 的坐标。 |
| ====相对于地图 (Map)==== | | ====相对于地图 (Map)==== |
− | 每个地点(location) 都有一个对应的xTile地图(map)。如果以像素(pixel) 为单位,地图左上角坐标代表''(0, 0)'',坐下角则代表<tt>(location.Map.DisplayWidth, location.Map.DisplayHeight)</tt>。 | + | 每个地点(location) 都有一个对应的xTile地图(map)。如果以像素(pixel) 为单位,地图左上角坐标代表''(0, 0)'',坐下角则代表<samp>(location.Map.DisplayWidth, location.Map.DisplayHeight)</samp>。 |
| 角色在当前地点的位置有两种表达方式: | | 角色在当前地点的位置有两种表达方式: |
| * 以像素(pixel) 为单位的绝对(absoulte) 坐标:<code>Position.X</code>与<code>Position.Y</code>。 | | * 以像素(pixel) 为单位的绝对(absoulte) 坐标:<code>Position.X</code>与<code>Position.Y</code>。 |
第125行: |
第125行: |
| | | |
| 格式: '''''具体操作''''':'''''(往)目标文件夹或文件名''''' | | 格式: '''''具体操作''''':'''''(往)目标文件夹或文件名''''' |
− | * 添加新文件:<tt>Characters\Dialogue\<文件名></tt> | + | * 添加新文件:<samp>Characters\Dialogue\<文件名></samp> |
− | * 添加新文件:<tt>Characters\schedules\<文件名></tt> | + | * 添加新文件:<samp>Characters\schedules\<文件名></samp> |
− | * 添加新文件:<tt>Portraits\<文件名></tt> | + | * 添加新文件:<samp>Portraits\<文件名></samp> |
− | * 添加新文件:<tt>Characters\<文件名></tt> | + | * 添加新文件:<samp>Characters\<文件名></samp> |
− | * 在已有文件中添加新的条目:<tt>Data\EngagementDialogue</tt>(可结婚NPC) | + | * 在已有文件中添加新的条目:<samp>Data\EngagementDialogue</samp>(可结婚NPC) |
− | * 在已有文件中添加新的条目:<tt>Data\NPCDispositions</tt> | + | * 在已有文件中添加新的条目:<samp>Data\NPCDispositions</samp> |
− | * 在已有文件中添加新的条目:<tt>Data\NPCGiftTastes</tt> | + | * 在已有文件中添加新的条目:<samp>Data\NPCGiftTastes</samp> |
− | * 在已有文件中添加新的条目:<tt>Characters\Dialogue\rainy</tt> | + | * 在已有文件中添加新的条目:<samp>Characters\Dialogue\rainy</samp> |
− | * 在已有文件中添加新的条目:<tt>Data\animationDescriptions</tt>(在行程(schedule) 中增加自定义的动画) | + | * 在已有文件中添加新的条目:<samp>Data\animationDescriptions</samp>(在行程(schedule) 中增加自定义的动画) |
| | | |
| 以上所有的操作都可以通过<code>IAssetLoaders</code>/<code>IAssetEditors</code>或者<code>Content Patcher</code>做到。 | | 以上所有的操作都可以通过<code>IAssetLoaders</code>/<code>IAssetEditors</code>或者<code>Content Patcher</code>做到。 |
第220行: |
第220行: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | 如果你想要自定义菜单,请继承自<tt>IClickableMenu</tt>,将对象分配给<tt>Game1.activeClickableMenu</tt>。 | + | 如果你想要自定义菜单,请继承自<samp>IClickableMenu</samp>,将对象分配给<samp>Game1.activeClickableMenu</samp>。 |
− | 一个菜单基本上重写了一些方法,如<tt>draw</tt>、<tt>receiveLeftClick </tt>等等。 | + | 一个菜单基本上重写了一些方法,如<samp>draw</samp>、<samp>receiveLeftClick </samp>等等。 |
− | <tt>draw</tt>方法绘制屏幕上的元素;<tt>receiveLeftClick </tt>方法处理左键点击事件。 | + | <samp>draw</samp>方法绘制屏幕上的元素;<samp>receiveLeftClick </samp>方法处理左键点击事件。 |
− | 你通常可以使用一些游戏封装好的类作为菜单元素,如<tt>ClickableTextureButton</tt>。 | + | 你通常可以使用一些游戏封装好的类作为菜单元素,如<samp>ClickableTextureButton</samp>。 |
| | | |
| 这里提供了一个[https://github.com/janavarro95/Stardew_Valley_Mods/blob/master/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs 简单的例子],这是[https://www.nexusmods.com/stardewvalley/mods/520 Birthday Mod]的菜单。 | | 这里提供了一个[https://github.com/janavarro95/Stardew_Valley_Mods/blob/master/GeneralMods/HappyBirthday/Framework/BirthdayMenu.cs 简单的例子],这是[https://www.nexusmods.com/stardewvalley/mods/520 Birthday Mod]的菜单。 |
第274行: |
第274行: |
| | | |
| // "MyModMail1" is referred to as the mail Id. It is how you will uniquely identify and reference your mail. | | // "MyModMail1" is referred to as the mail Id. It is how you will uniquely identify and reference your mail. |
− | // The @ will be replaced with the player's name. Other items do not seem to work (i.e. %pet or %farm) | + | // The @ will be replaced with the player's name. Other items do not seem to work (''i.e.,'' %pet or %farm) |
| // %item object 388 50 %% - this adds 50 pieces of wood when added to the end of a letter. | | // %item object 388 50 %% - this adds 50 pieces of wood when added to the end of a letter. |
| // %item money 250 601 %% - this sends a random amount of gold from 250 to 601 inclusive. | | // %item money 250 601 %% - this sends a random amount of gold from 250 to 601 inclusive. |
第427行: |
第427行: |
| location.temporarySprites.Add(new TemporaryAnimatedSprite(...)); | | location.temporarySprites.Add(new TemporaryAnimatedSprite(...)); |
| </syntaxhighlight> | | </syntaxhighlight> |
− | 详见<tt>TemporaryAnimatedSprite</tt>类。 | + | 详见<samp>TemporaryAnimatedSprite</samp>类。 |
| | | |
| ===播放一段声音=== | | ===播放一段声音=== |