diff --git a/build/common.props b/build/common.props index 52c99ada..8d7b13ba 100644 --- a/build/common.props +++ b/build/common.props @@ -2,7 +2,7 @@ - 4.3.2 + 4.3.3 1.4.3 2.0.2 1.0.21 diff --git a/changelog.txt b/changelog.txt index 2e54071f..4c3bd97c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ --------------------------------------------------------------------------------------------------- +Version: 4.3.3 +Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8,e1.5.9 +* Adapted to e1.5.9 +--------------------------------------------------------------------------------------------------- Version: 4.3.2 Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8 * Better ButterLib integration when available diff --git a/src/MCM.UI/GUI/GauntletUI/EditValueGauntletScreen.cs b/src/MCM.UI/GUI/GauntletUI/EditValueGauntletScreen.cs index 72b03570..f50aba82 100644 --- a/src/MCM.UI/GUI/GauntletUI/EditValueGauntletScreen.cs +++ b/src/MCM.UI/GUI/GauntletUI/EditValueGauntletScreen.cs @@ -1,4 +1,6 @@ -using MCM.UI.GUI.ViewModels; +using Bannerlord.ButterLib.Common.Helpers; + +using MCM.UI.GUI.ViewModels; using TaleWorlds.Engine; using TaleWorlds.Engine.GauntletUI; @@ -11,10 +13,13 @@ namespace MCM.UI.GUI.GauntletUI { internal sealed class EditValueGauntletScreen : ScreenBase { + private delegate void ReleaseMovieDelegate(object movie); + private readonly SettingsPropertyVM _settingProperty; private GauntletLayer _gauntletLayer = default!; - private GauntletMovie _gauntletMovie = default!; + private object _gauntletMovie = default!; private EditValueVM _dataSource = default!; + private ReleaseMovieDelegate? _releaseMovie; public EditValueGauntletScreen(SettingsPropertyVM settingProperty) { @@ -26,6 +31,7 @@ protected override void OnInitialize() base.OnInitialize(); _dataSource = new EditValueVM(_settingProperty); _gauntletLayer = new GauntletLayer(4000, "GauntletLayer"); + _releaseMovie = AccessTools2.GetDelegate(typeof(GauntletLayer), "ReleaseMovie"); _gauntletMovie = _gauntletLayer.LoadMovie("EditValueView_MCM", _dataSource); _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("ChatLogHotKeyCategory")); _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); @@ -53,7 +59,7 @@ protected override void OnFinalize() { base.OnFinalize(); RemoveLayer(_gauntletLayer); - _gauntletLayer.ReleaseMovie(_gauntletMovie); + _releaseMovie?.Invoke(_gauntletMovie); _gauntletLayer = null!; _gauntletMovie = null!; _dataSource.SettingProperty = null!; diff --git a/src/MCM.UI/GUI/GauntletUI/ModOptionsGauntletScreen.cs b/src/MCM.UI/GUI/GauntletUI/ModOptionsGauntletScreen.cs index 04552c84..a8b7e916 100644 --- a/src/MCM.UI/GUI/GauntletUI/ModOptionsGauntletScreen.cs +++ b/src/MCM.UI/GUI/GauntletUI/ModOptionsGauntletScreen.cs @@ -1,10 +1,11 @@ -using MCM.UI.GUI.ViewModels; +using Bannerlord.ButterLib.Common.Helpers; + +using MCM.UI.GUI.ViewModels; using Microsoft.Extensions.Logging; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; -using TaleWorlds.GauntletUI.Data; using TaleWorlds.InputSystem; using TaleWorlds.Library; using TaleWorlds.TwoDimension; @@ -16,12 +17,15 @@ namespace MCM.UI.GUI.GauntletUI /// internal sealed class ModOptionsGauntletScreen : ScreenBase, IMCMOptionsScreen { + private delegate void ReleaseMovieDelegate(object movie); + private readonly ILogger _logger; private GauntletLayer _gauntletLayer = default!; - private GauntletMovie _gauntletMovie = default!; + private object _gauntletMovie = default!; private ModOptionsVM _dataSource = default!; private SpriteCategory _spriteCategoryEncyclopedia = default!; + private ReleaseMovieDelegate? _releaseMovie; public ModOptionsGauntletScreen(ILogger logger) { @@ -38,6 +42,7 @@ protected override void OnInitialize() _spriteCategoryEncyclopedia.Load(resourceContext, uiresourceDepot); _dataSource = new ModOptionsVM(); _gauntletLayer = new GauntletLayer(4000, "GauntletLayer"); + _releaseMovie = AccessTools2.GetDelegate(typeof(GauntletLayer), "ReleaseMovie"); _gauntletMovie = _gauntletLayer.LoadMovie("ModOptionsView_MCM", _dataSource); _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory")); _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); @@ -63,7 +68,7 @@ protected override void OnFinalize() // TODO: There was a report that the encyclopedia UI is bugged //_spriteCategoryEncyclopedia.Unload(); RemoveLayer(_gauntletLayer); - _gauntletLayer.ReleaseMovie(_gauntletMovie); + _releaseMovie?.Invoke(_gauntletMovie); _gauntletLayer = null!; _gauntletMovie = null!; _dataSource.ExecuteSelect(null); diff --git a/src/Mod Configuration Menu.sln b/src/Mod Configuration Menu.sln index 05c255a5..62f40b30 100644 --- a/src/Mod Configuration Menu.sln +++ b/src/Mod Configuration Menu.sln @@ -342,7 +342,7 @@ Global {8A92126A-70CA-47BF-B208-E49E47A9E707} = {6DA59EA7-D40B-4C02-B0CC-64875B4064CD} {94DECE01-AE9B-476C-82BE-0DE680E38FA2} = {C08D87A6-8ADC-4600-9CA1-2B18F9BDD133} {01264F42-8EC3-4920-AF18-FB316F5BFB9A} = {87702001-50A1-4159-AF31-4848D018490E} - {560DE987-D9C8-431C-A197-08C925905C24} = {6DA59EA7-D40B-4C02-B0CC-64875B4064CD} + {560DE987-D9C8-431C-A197-08C925905C24} = {8A92126A-70CA-47BF-B208-E49E47A9E707} {FB5D85DA-B398-4820-AD1F-C79D83543921} = {560DE987-D9C8-431C-A197-08C925905C24} {A8BBD326-8B9E-41E4-8219-030B8E42EBBA} = {560DE987-D9C8-431C-A197-08C925905C24} {FFCD62E1-D894-4A2C-AAFD-9CEAF3B47410} = {560DE987-D9C8-431C-A197-08C925905C24}