DiplomacyTeam / Bannerlord.Diplomacy

Bannerlord mod: War, peace, NAPs, alliances, civil wars, relationships, and interactions.
MIT License
45 stars 14 forks source link

Manually calling ViewModel.RefreshValues is causing issues in other mods #216

Open adwitkow opened 1 year ago

adwitkow commented 1 year ago

https://github.com/DiplomacyTeam/Bannerlord.Diplomacy/blob/9ac4a5cb99ed237537f83fdb136e0b42373453ba/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPageVMMixin.cs#L40

Mods running in the example (in that order):

Diplomacy calling ViewModel.RefreshValues in its mixin constructor: image

Diplomacy not calling ViewModel.RefreshValues in its mixin constructor: image

The issue in reality in this case is caused by BannerKings hacking its way through the mixin (clearing the info section completely, re-applying vanilla values manually, doing weird checks if it's done it already but clearing the values anyway, it's really weird and I don't understand why it's the way it is) and Encyclopedia Extender not doing any checks if it's already applied its values or not, just adding everything when OnRefresh is called (causing it to apply twice). But in reality in my opinion if it's not necessary to call the RefreshValues method then it would be cleaner for everyone to just not call it.

Not sure about granting fiefs, but removing this line didn't break the messenger functionality for me.

DAOWAce commented 7 months ago

This is still an issue today.