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

Commit

Permalink
Added button to export avatars to json file.
Browse files Browse the repository at this point in the history
  • Loading branch information
RequiDev committed Jul 26, 2022
1 parent 101a0f2 commit b86f252
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ReModCE/Components/AvatarFavoritesComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ public override void OnUiManagerInitEarly()
Active = AvatarSearchEnabled
};


var exportButton = new ReUiButton("Export Avatars", new Vector2(-400f, 375f), new Vector2(0.75f, 1f), () =>
{
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));
}, parent);

ReModCE.SocialMenuButtons.Add(_searchButton);

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

0 comments on commit b86f252

Please sign in to comment.