Изменения

Строка 235: Строка 235:  
:# Посмотрите и отредактируйте свойства с помощью графического интерфейса.
 
:# Посмотрите и отредактируйте свойства с помощью графического интерфейса.
   −
===Tile properties===
+
===Свойства тайла===
Tile properties are set on individual map tiles. They can change game behaviour (like whether the player can cross them), or perform actions when the player steps on or clicks the tile. Each property has a name, type (always 'string' in Stardew Valley), and value.
+
Свойства тайла задаются отдельно для каждого тайла. Они могут изменять поведение игры (например, может ли игрок пройти по тайлу), или выполнить действие когда игрок наступает/нажимает на него. У каждого свойства есть имя, тип (в Stardew Valley всегда 'строка'), и значение.
   −
If you're using SMAPI:
+
Если вы используете SMAPI:
 
: <syntaxhighlight lang="C#">
 
: <syntaxhighlight lang="C#">
 
public override void Entry(IModHelper helper)
 
public override void Entry(IModHelper helper)
Строка 247: Строка 247:  
private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
 
private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
 
{
 
{
     // example location & tile coordinate
+
     // например местоположение и координаты плитки
 
     GameLocation location = Game1.currentLocation;
 
     GameLocation location = Game1.currentLocation;
 
     int tileX = 10;
 
     int tileX = 10;
 
     int tileY = 20;
 
     int tileY = 20;
   −
     // get property
+
     // получить свойство
 
     string value = location.doesTileHaveProperty(tileX, tileY, "Diggable", "Back");
 
     string value = location.doesTileHaveProperty(tileX, tileY, "Diggable", "Back");
   −
     // add or set property
+
     // добавить или установить свойство
 
     location.setTileProperty(tileX, tileY, "Back", "Diggable", "T");
 
     location.setTileProperty(tileX, tileY, "Back", "Diggable", "T");
   −
     // remove tile property
+
     // удалить свойство тайла
 
     Layer layer = location.map.GetLayer("Back");
 
     Layer layer = location.map.GetLayer("Back");
 
     Tile tile = layer.PickTile(new xTile.Dimensions.Location(tileX, tileY) * Game1.tileSize, Game1.viewport.Size);
 
     Tile tile = layer.PickTile(new xTile.Dimensions.Location(tileX, tileY) * Game1.tileSize, Game1.viewport.Size);
Строка 266: Строка 266:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
If you're using Tiled:
+
Если вы используете Tiled:
: In Tiled these are represented by two types: ''object properties'' only apply to the selected tile, while ''tile properties'' apply to every instance of that tile. In general you'll always set ''object properties'', so we'll only cover those.
+
: В Tiled свойства тайла представлены двумя типами: ''object properties'' применяется только к выбранному тайлу, в то время как ''tile properties'' применитесь к каждому экземпляру этого тайла. В общем, вы всегда будете устанавливать ''object properties'', так что мы рассмотрим только их.
:# Select the object layer in the ''Layers'' pane.
+
:# Выберите слой объекта на панели ''Layers''.
:# Choose the [[File:Modding - creating an XNB mod - Tiled 'select object' button.png]] ''select object'' tool in the toolbar.
+
:# Выберете инструмент [[File:Modding - creating an XNB mod - Tiled 'select object' button.png]] ''select object'' на панели инструментов.
:# Click the object whose properties you want to view. Objects are represented with a gray selection box on the map:<br />[[File:Modding - creating an XNB mod - map object.png]]
+
:# Нажмите на объект, свойства которого вы хотите просмотреть. Объекты на карте обведены серой рамкой:<br />[[File:Modding - creating an XNB mod - map object.png]]
:# The object properties will be shown in the ''Properties'' pane.<br />[[File:Modding - creating an XNB mod - Tiled tile properties pane.png]]  
+
:# Свойства объекта будут показаны на панели ''Properties''.<br />[[File:Modding - creating an XNB mod - Tiled tile properties pane.png]]  
   −
: To edit properties for an existing object:
+
: Для редактирования свойств существующего объекта:
:* Change a value: click the value field and enter the new value.
+
:* Измените значение: нажмите на поле и введите новое значение.
:* Change a name: select the property and click the [[File:Modding - creating an XNB mod - Tiled 'edit' button.png]] icon.
+
:* Измените наименование: выберите свойство и нажмите на кнопку и иконкой [[File:Modding - creating an XNB mod - Tiled 'edit' button.png]].
:* Add a property: click the [[File:Modding - creating an XNB mod - Tiled 'add' button.png]] icon, enter the property name, make sure the selected type is "string", and click OK.
+
:* Добавьте свойство: нажмите на кнопку с иконкой [[File:Modding - creating an XNB mod - Tiled 'add' button.png]], введите наименование свойства, убедитесь в том, что тип свойства "string", и нажмите OK.
   −
: To add a new object:
+
: Чтобы добавить новый объект:
:# Select the object layer in the ''Layers'' pane.<br />''There should be one object layer for each tile layer. If the object layer is missing, create one with the same name as the right tile layer.''
+
:# Выберите слой объекта на панели ''Layers''.<br />''Для каждого слоя тайлов должен быть один слой объектов. Если слой объекта отсутствует, создайте слой с тем же именем, что и слой тайлов.''
:# Choose the [[File:Modding - creating an XNB mod - Tiled 'insert rectangle' button.png]] ''insert rectangle'' tool from the toolbar.
+
:# Выберете инструмент [[File:Modding - creating an XNB mod - Tiled 'insert rectangle' button.png]] ''insert rectangle'' на панели инструментов.
:# Click and drag the rectangle over the tile you want to edit . Make sure it snaps to the tile grid (see [[#Using Tiled]]), and only one tile is selected.
+
:# Нажмите и перетащите прямоугольник на тайл, которую вы хотите отредактировать. Убедитесь в том, что он привязан к сетке тайла (смотри [[#Использование Tiled]]), и выбран только один тайл.
:# Rename it TileData in <tt>Name</tt>
+
:# Переименуйте TileData в <tt>Name</tt>
:## See previous for how to edit its properties.
+
:## О том, как редактировать его свойства, смотри в предыдущем разделе.
    
===Тайлы===
 
===Тайлы===
602

правки