Строка 206: |
Строка 206: |
| :## Нажмите на карту, чтобы разместить тайлы на выбранном слое. | | :## Нажмите на карту, чтобы разместить тайлы на выбранном слое. |
| | | |
− | ===Map properties=== | + | ===Свойства карты=== |
− | Each map can have multiple map properties, which define attributes and behaviour associated with the map like lighting, music, warp points, etc. Each property has a name (which defines the type of property), type (always 'string' in Stardew Valley), and value (which configures the property). See [[#Known properties|known properties]] below.
| + | Каждая карта может иметь несколько свойств карты, которые определяют атрибуты и поведение, связанные с картой, такие как освещение, музыка, точки деформации и т.д. Каждое свойство имеет имя (которое определяет тип свойства), тип (в 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) |
Строка 218: |
Строка 218: |
| private void OnSaveLoaded(object sender, SaveLoadedEventArgs args) | | private void OnSaveLoaded(object sender, SaveLoadedEventArgs args) |
| { | | { |
− | // get the 'Music' value | + | // получить значение 'Music' |
| string currentMusic = Game1.currentLocation.map.Properties.TryGetValue("Music", out PropertyValue rawMusic) | | string currentMusic = Game1.currentLocation.map.Properties.TryGetValue("Music", out PropertyValue rawMusic) |
| ? rawMusic.ToString() | | ? rawMusic.ToString() |
| : null; | | : null; |
| | | |
− | // add or set the 'Music' value | + | // добавить или установить значение 'Music' |
| Game1.currentLocation.map.Properties["Music"] = "MarlonsTheme"; | | Game1.currentLocation.map.Properties["Music"] = "MarlonsTheme"; |
| | | |
− | // remove the 'Music' value | + | // удалить значение 'Music' |
| Game1.currentLocation.map.Properties.Remove("Music"); | | Game1.currentLocation.map.Properties.Remove("Music"); |
| } | | } |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | If you're using Tiled:
| + | Если вы используете Tiled: |
− | :# Click ''Map'' on the toolbar and choose ''Map Properties''. | + | :# Нажмите ''Map'' на панели инструментов и выберете ''Map Properties''. |
− | :# View and edit properties using the GUI. | + | :# Посмотрите и отредактируйте свойства с помощью графического интерфейса. |
| | | |
| ===Tile properties=== | | ===Tile properties=== |