public static Config Load() { MigrateConfig(FileName); var config = Config.Load <Config>( FileName, out bool isFirstLoad); // チャットページに親オブジェクトを設定する foreach (var overlay in config.ChatOverlaySettings) { foreach (var page in overlay.ChatPages) { page.ParentOverlaySettings = overlay; } } if (isFirstLoad) { config.CharacterProfileList = CreateDefaultCharacterProfile(); config.CharacterProfileList.First().ChannelLinkerList.AddRange( CharacterProfileModel.CreateDefaultChannelLinkers()); config.DiscordBotList = CreateDefaultDiscordBots(); config.DiscordChannelList = CreateDefaultDiscordChannels(); } return(config); }
private void ExecuteAddProfileCommand() { var model = new CharacterProfileModel() { CharacterName = "Your Character", IsEnabled = true, }; model.ChannelLinkerList.AddRange( CharacterProfileModel.CreateDefaultChannelLinkers()); this.Config.CharacterProfileList.Add(model); this.ChangeSelectedPageCallback?.Invoke(model); }