Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit b86f252

Browse files
committed
Added button to export avatars to json file.
1 parent 101a0f2 commit b86f252

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ReModCE/Components/AvatarFavoritesComponent.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ public override void OnUiManagerInitEarly()
156156
Active = AvatarSearchEnabled
157157
};
158158

159+
160+
var exportButton = new ReUiButton("Export Avatars", new Vector2(-400f, 375f), new Vector2(0.75f, 1f), () =>
161+
{
162+
File.WriteAllText($"UserData/ReModCE/avatars_export.json", JsonConvert.SerializeObject(_savedAvatars.Select(a => new { a.Id, a.AvatarName, a.ImageUrl, a.ThumbnailUrl, a.AuthorName, a.AuthorId, a.Description }).OrderBy(a => a.AvatarName).ToArray(), Formatting.Indented));
163+
}, parent);
164+
159165
ReModCE.SocialMenuButtons.Add(_searchButton);
160166

161167
var changeButton = GameObject.Find("UserInterface/MenuContent/Screens/Avatar/Change Button");

0 commit comments

Comments
 (0)