Fixed new changes not being saved

This commit is contained in:
Ray 2024-07-21 17:06:07 +01:00
parent 9fc342c6fb
commit 63a356c894

View File

@ -8,6 +8,7 @@ using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models; using RokettoLaunch.Models;
using RokettoLaunch.Windows.Forms;
using RyzStudio; using RyzStudio;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms;
@ -515,7 +516,22 @@ namespace RokettoLaunch
this.CurrentSession.Groups = new List<TileGroupModel>(); this.CurrentSession.Groups = new List<TileGroupModel>();
foreach (var container in flowLayoutPanel1.Controls.OfType<RyzStudio.Windows.TileForms.TileContainer>()) foreach (var container in flowLayoutPanel1.Controls.OfType<RyzStudio.Windows.TileForms.TileContainer>())
{ {
this.CurrentSession.Groups.Add((TileGroupModel)container.Tag); var newTag = (TileGroupModel)container.Tag;
if (newTag == null)
{
continue;
}
newTag.Items = new List<TileModel>();
foreach (var tile in container.Controls.OfType<TilePanel>())
{
tile.ModelInfo.Position = container.GetCoord(tile);
newTag.Items.Add(tile.ModelInfo);
}
this.CurrentSession.Groups.Add(newTag);
} }
var result = GenericResult.Create(); var result = GenericResult.Create();