From 1c34a27612cadb0b1de4c4d14e0c0e0ccecc5837 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Tue, 14 Dec 2021 14:42:28 +0300 Subject: [PATCH 01/41] Adjusted the folder tree and soulution/project items. Added workflows for automation. --- .editorconfig | 73 ++++++++ .github/dependabot.yml | 16 ++ .github/workflows/TestBuild.yml | 10 +- .github/workflows/build.yml | 5 +- .github/workflows/dotnet-format-daily.yml | 18 ++ ...lord.Diplomacy.ImplementationLoader.csproj | 78 -------- .../Directory.Build.props | 6 - build/common.props | 176 ++++++++++-------- build/common.targets | 19 ++ ...lord.Diplomacy.ImplementationLoader.csproj | 60 ++++++ .../ImplementationLoaderSubModule.cs | 0 .../Properties/launchSettings.json | 0 .../Widgets/CriticalThresholdTextWidget.cs | 0 .../Widgets/HoveredBrushWidget.cs | 0 .../KingdomDiplomacyPanelTabControlWidget.cs | 0 .../_Module/SubModule.xml | 0 src/Bannerlord.Diplomacy.csproj | 63 ------- .../Bannerlord.Diplomacy.sln | 44 +++-- .../Bannerlord.Diplomacy.csproj | 59 ++++++ .../CampaignBehaviors/AllianceBehavior.cs | 0 .../CampaignBehaviors/CivilWarBehavior.cs | 0 .../CampaignBehaviors/CooldownBehavior.cs | 0 .../DiplomaticAgreementBehavior.cs | 0 .../CampaignBehaviors/ExpansionismBehavior.cs | 0 .../KeepFiefAfterSiegeBehavior.cs | 0 .../MaintainInfluenceBehavior.cs | 0 .../CampaignBehaviors/MessengerBehavior.cs | 0 .../CampaignBehaviors/UIBehavior.cs | 0 .../WarExhaustionBehavior.cs | 0 .../PlayerCharacterTraitEventExperience.cs | 0 .../Character/PlayerCharacterTraitHelper.cs | 0 src/{ => Bannerlord.Diplomacy}/Cheats.cs | 0 .../Actions/ChangeKingdomBannerAction.cs | 0 .../Actions/ConsolidateKingdomsAction.cs | 0 .../CivilWar/Actions/CreateFactionAction.cs | 0 .../CivilWar/Actions/JoinFactionAction.cs | 0 .../CivilWar/Actions/LeaveFactionAction.cs | 0 .../CivilWar/Actions/StartRebellionAction.cs | 0 .../CivilWar/FactionNameGenerator.cs | 0 .../CivilWar/Factions/AbdicationFaction.cs | 0 .../CivilWar/Factions/RebelDemandType.cs | 0 .../CivilWar/Factions/RebelFaction.cs | 0 .../CivilWar/Factions/SecessionFaction.cs | 0 .../CivilWar/RebelFactionManager.cs | 0 .../CivilWar/Scoring/AbdicationDemandScore.cs | 0 .../AbstractFactionDemandScoringModel.cs | 0 .../Scoring/ChangeRulerFactionScoreBase.cs | 0 .../Scoring/RebelFactionScoringModel.cs | 0 .../CivilWar/Scoring/SecessionDemandScore.cs | 0 src/{ => Bannerlord.Diplomacy}/Compat.cs | 0 .../CooldownManager.cs | 0 .../Costs/DiplomacyCost.cs | 0 .../Costs/DiplomacyCostCalculator.cs | 0 .../Costs/GoldCost.cs | 0 .../Costs/HybridCost.cs | 0 .../Costs/InfluenceCost.cs | 0 .../CustomSavedTypeDefiner.cs | 0 .../AbstractConditionEvaluator.cs | 0 .../DiplomaticAction/AbstractCostCondition.cs | 0 .../AbstractDiplomaticAction.cs | 0 .../DiplomaticAction/AbstractScoringModel.cs | 0 .../Alliance/AllianceEvent.cs | 0 .../Alliance/AllianceScoringModel.cs | 0 .../Alliance/BreakAllianceAction.cs | 0 .../Alliance/BreakAllianceConditions.cs | 0 .../Alliance/Conditions/AlliancesEnabled.cs | 0 .../Conditions/HasEnoughGoldCondition.cs | 0 .../Conditions/HasEnoughInfluenceCondition.cs | 0 .../Conditions/HasEnoughScoreCondition.cs | 0 .../TimeElapsedSinceAllianceFormedDuration.cs | 0 .../TimeElapsedSinceLastWarCondition.cs | 0 .../Alliance/DeclareAllianceAction.cs | 0 .../Alliance/FormAllianceConditions.cs | 0 .../DiplomaticAction/DiplomaticAgreement.cs | 0 .../DiplomaticAgreementManager.cs | 0 .../GenericConditions/AtPeaceCondition.cs | 0 .../HasAuthorityCondition.cs | 0 .../NotInAllianceCondition.cs | 0 .../NotRebelKingdomCondition.cs | 0 .../FormNonAggressionPactAction.cs | 0 .../HasEnoughGoldCondition.cs | 0 .../HasEnoughInfluenceCondition.cs | 0 .../HasEnoughScoreCondition.cs | 0 .../NoNonAggressionPactCondition.cs | 0 .../NonAggressionPactConditions.cs | 0 .../NonAggressionPactScoringModel.cs | 0 .../NonAggressionPactAgreement.cs | 0 .../HasEnoughGoldForPeaceCondition.cs | 0 .../HasEnoughInfluenceForPeaceCondition.cs | 0 .../HasEnoughInfluenceForWarCondition.cs | 0 .../HasEnoughTimeElapsedForPeaceCondition.cs | 0 .../WarPeace/Conditions/NoSiegeCondition.cs | 0 ...tisfiesQuestConditionsForPeaceCondition.cs | 0 .../WarPeace/DeclareWarConditions.cs | 0 .../WarPeace/KingdomPeaceAction.cs | 0 .../WarPeace/MakePeaceConditions.cs | 0 .../WarPeace/WarDeclaredEvent.cs | 0 .../Event/Events.cs | 0 .../Event/WarExhaustionEvent.cs | 0 .../ExpansionismManager.cs | 0 .../Extensions/ClanExtensions.cs | 0 .../Extensions/HeroExtensions.cs | 0 .../Extensions/KingdomExtensions.cs | 0 src/{ => Bannerlord.Diplomacy}/FactionPair.cs | 0 .../FieldAccessHelper.cs | 0 .../DetailWarViewInterface.cs | 0 .../GauntletInterfaces/DonateGoldInterface.cs | 0 .../GauntletInterfaces/GenericInterface.cs | 0 .../GauntletInterfaces/GrantFiefInterface.cs | 0 .../RebelFactionsInterface.cs | 0 .../GrantFief/GrantFiefAction.cs | 0 .../IDiplomacyCondition.cs | 0 src/{ => Bannerlord.Diplomacy}/LogFactory.cs | 0 .../MessageHelper.cs | 0 .../Messengers/Messenger.cs | 0 .../Messengers/MessengerManager.cs | 0 .../PatchTools/PatchClass.cs | 0 .../PatchTools/PatchManager.cs | 0 .../PatchTools/Priority.cs | 0 .../Patches/DeclareWarActionPatch.cs | 0 .../Patches/DefaultClanPoliticsModelPatch.cs | 0 .../DefaultEncyclopediaFactionPagePatch.cs | 0 .../Patches/DiplomaticBartersBehaviorPatch.cs | 0 .../Patches/EncyclopediaDataPatch.cs | 0 .../Patches/FactionManagerPatch.cs | 0 .../Patches/GameMenusCallbacksPatch.cs | 0 .../Patches/GiveGoldToClanActionPatch.cs | 0 .../KingdomDecisionProposalBehaviorPatch.cs | 0 .../Patches/KingdomManagementVMPatch.cs | 0 .../MBBannerEditorGauntletScreenPatch.cs | 0 .../Patches/RebelKingdomPatches.cs | 0 .../Patches/SupportKingdomQuestPatch.cs | 0 .../UrbanCharactersCampaignBehaviorPatch.cs | 0 .../PlayerHelpers.cs | 0 .../Properties/launchSettings.json | 0 src/{ => Bannerlord.Diplomacy}/Reflect.cs | 0 src/{ => Bannerlord.Diplomacy}/Settings.cs | 0 .../StringConstants.cs | 0 src/{ => Bannerlord.Diplomacy}/SubModule.cs | 0 .../ViewModel/DetailWarStatsVM.cs | 0 .../ViewModel/DetailWarVM.cs | 0 .../DiplomacyFactionRelationshipVM.cs | 0 .../ViewModel/DiplomacyPropertiesVM.cs | 0 .../ViewModel/DonateGoldVM.cs | 0 .../EncyclopediaFactionPageVMExtensionVM.cs | 0 .../EncyclopediaHeroPageVMExtensionVM.cs | 0 .../ViewModel/GrantFiefItemVM.cs | 0 .../ViewModel/GrantFiefSortControllerVM.cs | 0 .../ViewModel/GrantFiefVM.cs | 0 .../ViewModel/RebelFactionItemVM.cs | 0 .../ViewModel/RebelFactionParticipantVM.cs | 0 .../ViewModel/RebelFactionsVM.cs | 0 .../ViewModel/WarExhaustionBreakdownVM.cs | 0 .../WarExhaustionMapIndicatorItemVM.cs | 0 .../ViewModel/WarExhaustionMapIndicatorVM.cs | 0 .../DiplomacyPanelPrefabExtension.cs | 0 .../EncyclopediaFactionPagePrefabExtension.cs | 0 .../EncyclopediaHeroPagePrefabExtension.cs | 0 .../ViewModelMixin/KingdomClanVMMixin.cs | 0 .../ViewModelMixin/KingdomDiplomacyVMMixin.cs | 0 .../KingdomManagementPrefabExtension.cs | 0 .../KingdomManagementVMMixin.cs | 0 .../ViewModelMixin/KingdomTruceItemVmMixin.cs | 0 .../ViewModelMixin/KingdomWarItemVMMixin.cs | 0 .../ViewModelMixin/MapNavigationVMMixin.cs | 0 .../ViewModelMixin/PartyNameplateVMMixin.cs | 0 .../SettlementNameplatesVMMixin.cs | 0 .../Views/GauntletWarExhaustionIndicator.cs | 0 .../Views/WarExhaustionIndicatorView.cs | 0 .../WarExhaustionManager.cs | 0 .../_Module/GUI/Brushes/Diplomacy.xml | 0 .../EncyclopediaFactionPageInject.xml | 0 .../EncyclopediaHeroPageInject.xml | 0 .../FactionButtonInject.xml | 0 .../GUI/Prefabs/GrantFief/GrantFief.xml | 0 .../GUI/Prefabs/GrantFief/GrantFiefTuple.xml | 0 .../KingdomManagement/Clan/ClansPanel.xml | 0 .../KingdomManagement/Clan/DonateGold.xml | 0 .../Diplomacy/DiplomacyPanelButtons.xml | 0 .../Diplomacy/DiplomacyPanel_1510.xml | 0 .../Diplomacy/DiplomacyPanel_159.xml | 0 .../Diplomacy/OverviewTab.xml | 0 .../Diplomacy/Relationship.xml | 0 .../KingdomManagement/Diplomacy/StatsTab.xml | 0 .../RebelFactions/RebelFactionDivider.xml | 0 .../RebelFactions/RebelFactionParticipant.xml | 0 .../Prefabs/RebelFactions/RebelFactions.xml | 0 .../RebelFactions/RebelFactionsItem.xml | 0 .../Prefabs/Standard/BasicDiplomacyButton.xml | 0 .../Standard/StaticDiplomacyButton.xml | 0 .../Prefabs/WarExhaustion/DetailWarView.xml | 0 .../WarExhaustionMapIndicator.xml | 0 .../ModuleData/civil_war_strings_xml.xml | 0 .../_Module/ModuleData/faction_names_xml.xml | 0 .../_Module/ModuleData/gt_common.xml | 0 .../_Module/ModuleData/gt_help.xml | 0 .../_Module/ModuleData/help_strings_xml.xml | 0 .../ModuleData/std_module_strings_xml.xml | 0 src/Diplomacy.sln | 31 --- src/Directory.Build.props | 7 +- src/Directory.Build.targets | 3 + 201 files changed, 383 insertions(+), 285 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dotnet-format-daily.yml delete mode 100644 Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj delete mode 100644 Bannerlord.Diplomacy.ImplementationLoader/Directory.Build.props create mode 100644 build/common.targets create mode 100644 src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/ImplementationLoaderSubModule.cs (100%) rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/Properties/launchSettings.json (100%) rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/Widgets/CriticalThresholdTextWidget.cs (100%) rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/Widgets/HoveredBrushWidget.cs (100%) rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/Widgets/KingdomDiplomacyPanelTabControlWidget.cs (100%) rename {Bannerlord.Diplomacy.ImplementationLoader => src/Bannerlord.Diplomacy.ImplementationLoader}/_Module/SubModule.xml (100%) delete mode 100644 src/Bannerlord.Diplomacy.csproj rename Bannerlord.Diplomacy.sln => src/Bannerlord.Diplomacy.sln (65%) mode change 100755 => 100644 create mode 100644 src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/AllianceBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/CivilWarBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/CooldownBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/DiplomaticAgreementBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/ExpansionismBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/MaintainInfluenceBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/MessengerBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/UIBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CampaignBehaviors/WarExhaustionBehavior.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Character/PlayerCharacterTraitEventExperience.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Character/PlayerCharacterTraitHelper.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Cheats.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/ChangeKingdomBannerAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/ConsolidateKingdomsAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/CreateFactionAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/JoinFactionAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/LeaveFactionAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Actions/StartRebellionAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/FactionNameGenerator.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Factions/AbdicationFaction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Factions/RebelDemandType.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Factions/RebelFaction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Factions/SecessionFaction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/RebelFactionManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Scoring/AbdicationDemandScore.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Scoring/RebelFactionScoringModel.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CivilWar/Scoring/SecessionDemandScore.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Compat.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CooldownManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Costs/DiplomacyCost.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Costs/DiplomacyCostCalculator.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Costs/GoldCost.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Costs/HybridCost.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Costs/InfluenceCost.cs (100%) rename src/{ => Bannerlord.Diplomacy}/CustomSavedTypeDefiner.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/AbstractConditionEvaluator.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/AbstractCostCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/AbstractDiplomaticAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/AbstractScoringModel.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/AllianceEvent.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/AllianceScoringModel.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/BreakAllianceAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/BreakAllianceConditions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/AlliancesEnabled.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/HasEnoughGoldCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/HasEnoughInfluenceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/HasEnoughScoreCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceAllianceFormedDuration.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceLastWarCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/DeclareAllianceAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/Alliance/FormAllianceConditions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/DiplomaticAgreement.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/DiplomaticAgreementManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/GenericConditions/AtPeaceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPact/NonAggressionPactScoringModel.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/NonAggressionPactAgreement.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/DeclareWarConditions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/KingdomPeaceAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/MakePeaceConditions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/DiplomaticAction/WarPeace/WarDeclaredEvent.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Event/Events.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Event/WarExhaustionEvent.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ExpansionismManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Extensions/ClanExtensions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Extensions/HeroExtensions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Extensions/KingdomExtensions.cs (100%) rename src/{ => Bannerlord.Diplomacy}/FactionPair.cs (100%) rename src/{ => Bannerlord.Diplomacy}/FieldAccessHelper.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GauntletInterfaces/DetailWarViewInterface.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GauntletInterfaces/DonateGoldInterface.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GauntletInterfaces/GenericInterface.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GauntletInterfaces/GrantFiefInterface.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GauntletInterfaces/RebelFactionsInterface.cs (100%) rename src/{ => Bannerlord.Diplomacy}/GrantFief/GrantFiefAction.cs (100%) rename src/{ => Bannerlord.Diplomacy}/IDiplomacyCondition.cs (100%) rename src/{ => Bannerlord.Diplomacy}/LogFactory.cs (100%) rename src/{ => Bannerlord.Diplomacy}/MessageHelper.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Messengers/Messenger.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Messengers/MessengerManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/PatchTools/PatchClass.cs (100%) rename src/{ => Bannerlord.Diplomacy}/PatchTools/PatchManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/PatchTools/Priority.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/DeclareWarActionPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/DefaultClanPoliticsModelPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/DefaultEncyclopediaFactionPagePatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/DiplomaticBartersBehaviorPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/EncyclopediaDataPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/FactionManagerPatch.cs (100%) mode change 100755 => 100644 rename src/{ => Bannerlord.Diplomacy}/Patches/GameMenusCallbacksPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/GiveGoldToClanActionPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/KingdomDecisionProposalBehaviorPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/KingdomManagementVMPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/MBBannerEditorGauntletScreenPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/RebelKingdomPatches.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/SupportKingdomQuestPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Patches/UrbanCharactersCampaignBehaviorPatch.cs (100%) rename src/{ => Bannerlord.Diplomacy}/PlayerHelpers.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Properties/launchSettings.json (100%) rename src/{ => Bannerlord.Diplomacy}/Reflect.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Settings.cs (100%) rename src/{ => Bannerlord.Diplomacy}/StringConstants.cs (100%) rename src/{ => Bannerlord.Diplomacy}/SubModule.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/DetailWarStatsVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/DetailWarVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/DiplomacyFactionRelationshipVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/DiplomacyPropertiesVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/DonateGoldVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/GrantFiefItemVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/GrantFiefSortControllerVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/GrantFiefVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/RebelFactionItemVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/RebelFactionParticipantVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/RebelFactionsVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/WarExhaustionBreakdownVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/WarExhaustionMapIndicatorItemVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModel/WarExhaustionMapIndicatorVM.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/DiplomacyPanelPrefabExtension.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomClanVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomDiplomacyVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomManagementPrefabExtension.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomManagementVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomTruceItemVmMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/KingdomWarItemVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/MapNavigationVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/PartyNameplateVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/ViewModelMixin/SettlementNameplatesVMMixin.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Views/GauntletWarExhaustionIndicator.cs (100%) rename src/{ => Bannerlord.Diplomacy}/Views/WarExhaustionIndicatorView.cs (100%) rename src/{ => Bannerlord.Diplomacy}/WarExhaustionManager.cs (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Brushes/Diplomacy.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaFactionPageInject.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaHeroPageInject.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/FactionButtonInject.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/GrantFief/GrantFief.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/GrantFief/GrantFiefTuple.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Clan/ClansPanel.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Clan/DonateGold.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanelButtons.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_1510.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_159.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/OverviewTab.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/Relationship.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/StatsTab.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/RebelFactions/RebelFactionDivider.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/RebelFactions/RebelFactionParticipant.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/RebelFactions/RebelFactions.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/RebelFactions/RebelFactionsItem.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/Standard/BasicDiplomacyButton.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/Standard/StaticDiplomacyButton.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/WarExhaustion/DetailWarView.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/GUI/Prefabs/WarExhaustion/WarExhaustionMapIndicator.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/civil_war_strings_xml.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/faction_names_xml.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/gt_common.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/gt_help.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/help_strings_xml.xml (100%) rename src/{ => Bannerlord.Diplomacy}/_Module/ModuleData/std_module_strings_xml.xml (100%) delete mode 100644 src/Diplomacy.sln create mode 100644 src/Directory.Build.targets diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..f0b40750 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,73 @@ +# To learn more about .editorconfig see https://aka.ms/editorconfigdocs +############################### +# Core EditorConfig Options # +############################### + +# All files +[*] +indent_style = space + +# Code files +[*.{cs,vb}] +indent_size = 4 +insert_final_newline = false +charset = utf-8-bom + +# .NET formatting rules +[*.{cs,vb}] +dotnet_sort_system_directives_first = false +dotnet_separate_import_directive_groups = true + + +# CSharp formatting rules: +[*.cs] +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# CSharp formatting rules: +[*.cs] +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = false + +# CSharp formatting rules: +[*.cs] +csharp_space_after_cast = true +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_parentheses = +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true +csharp_space_before_comma = false +csharp_space_after_dot = false +csharp_space_before_dot = false +csharp_space_after_semicolon_in_for_statement = true +csharp_space_before_semicolon_in_for_statement = false +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_square_brackets = false + +# CSharp formatting rules: +[*.cs] +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true + +# 'using' directive preferences +[*.cs] +csharp_using_directive_placement = outside_namespace diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..047864cd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" + ignore: + - dependency-name: "Newtonsoft.Json" + - dependency-name: "Bannerlord.ReferenceAssemblies.*" + - dependency-name: "Lib.Harmony" + - dependency-name: "Microsoft.Extensions.*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index ec4a1772..03a11da4 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -3,7 +3,8 @@ name: TestBuild on: push: branches: - - dev + - '*' + - '!main' env: # Disable the .NET logo in the console output. @@ -27,20 +28,19 @@ jobs: with: dotnet-version: 5.0.x - - name: Build Diplomacy Module + - name: Build Diplomacy Module for testing run: | $impl = $PWD.Path + '/bannerlord-implementations'; $path = $PWD.Path + '/bannerlord'; $final = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/'; - $proj = 'src/Bannerlord.Diplomacy.csproj'; + $proj = 'src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj'; $pdll = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.dll'; $ppdb = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.pdb'; # The folders are required to be created before executing the script New-Item -ItemType directory -Force -Path $impl; New-Item -ItemType directory -Force -Path $path; $gameversions = Get-Content -Path supported-game-versions.txt; - # Get all implementations except the minimal version (last element) - # Last entry is the Minimal version. We will use Bannerlord.Diplomacy.dll from there + # Process all implementations For ($i = 0; $i -le $gameversions.Length - 1; $i++) { $gameversion = $gameversions[$i]; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ef07848..e72aacbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,15 +32,14 @@ jobs: $impl = $PWD.Path + '/bannerlord-implementations'; $path = $PWD.Path + '/bannerlord'; $final = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/'; - $proj = 'src/Bannerlord.Diplomacy.csproj'; + $proj = 'src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj'; $pdll = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.dll'; $ppdb = $path + '/Modules/Bannerlord.Diplomacy/bin/Win64_Shipping_Client/Bannerlord.Diplomacy*.pdb'; # The folders are required to be created before executing the script New-Item -ItemType directory -Force -Path $impl; New-Item -ItemType directory -Force -Path $path; $gameversions = Get-Content -Path supported-game-versions.txt; - # Get all implementations except the minimal version (last element) - # Last entry is the Minimal version. We will use Bannerlord.ButterLib.dll from there + # Process all implementations For ($i = 0; $i -le $gameversions.Length - 1; $i++) { $gameversion = $gameversions[$i]; diff --git a/.github/workflows/dotnet-format-daily.yml b/.github/workflows/dotnet-format-daily.yml new file mode 100644 index 00000000..867e9a8f --- /dev/null +++ b/.github/workflows/dotnet-format-daily.yml @@ -0,0 +1,18 @@ +name: Daily Code Format Check + +on: + schedule: + - cron: 0 0 * * * # Every day at midnight (UTC) + workflow_dispatch: + +jobs: + dotnet-format: + runs-on: ubuntu-latest + steps: + - name: Code Formatting + uses: butr/actions-code-format-setup@v1.5 + with: + workspace: "src/Bannerlord.Diplomacy.sln" + github-token: ${{ secrets.GITHUB_TOKEN }} + assignees: 'artifixer, Katarn2000x, zijistark' + reviewers: 'artifixer, Katarn2000x, zijistark' \ No newline at end of file diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj b/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj deleted file mode 100644 index bd56b881..00000000 --- a/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj +++ /dev/null @@ -1,78 +0,0 @@ - - - - net472 - x64 - 9.0 - enable - Stable_Debug;Stable_Release;Beta_Debug;Beta_Release - $(DisplayName) - - - - Bannerlord.Diplomacy - Diplomacy - $(ModuleName) - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - \$displayname\$ - $(DisplayName) - - - \$mcmversion\$ - $(MCMVersion) - - - \$gameversionflat\$ - $(GameVersionFlat) - - - - - - - diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Directory.Build.props b/Bannerlord.Diplomacy.ImplementationLoader/Directory.Build.props deleted file mode 100644 index ba3f4c92..00000000 --- a/Bannerlord.Diplomacy.ImplementationLoader/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build/common.props b/build/common.props index 617c42d0..645103e0 100644 --- a/build/common.props +++ b/build/common.props @@ -1,90 +1,108 @@ - - 1.1.9 - + + + 1.1.9 + - - - 1.0.0.33 - 1.0.31 - 2.1.1 - 4.3.10 - 2.0.0.10 - 2.1.6 - 1.6.1.61 - - - - true - true - false - true - false - true - + + + + 1.0.0.33 + + 2.1.1 + + 1.0.31 + + 4.3.10 + + 2.1.6 + + 1.6.1.61 + + 2.0.0.10 + - - $([System.IO.File]::ReadAllText($(MSBuildThisFileDirectory)/../supported-game-versions.txt)) - - - - + + net472 + x64 + 9.0 + enable + Bannerlord.Diplomacy + Diplomacy + $(DisplayName) + - - - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`).Length) - $([MSBuild]::Subtract($(SGVLineCount), 1)) - - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[0]) - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[1]) - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[$(SGVLastEntryIndex)]) - - e1.1.0 - - $(GameStableVersion) - $(GameBetaVersion) - - $(GameVersionWithPrefix.Substring(1)) - + + Diplomacy Team + Diplomacy Library mod for Bannerlord + false + Copyright © 2020-2021 Diplomacy Team + Diplomacy system overhaul for Mount & Blade II: Bannerlord + - - $(OverrideGameVersion) - $(GameVersionWithPrefix.Substring(1)) - - - $([System.String]::Copy('$(GameVersionWithPrefix)').Replace('.','')) - + + true + true + false + true + false + true + - - - $([System.String]::Copy('$(GameVersion)').Replace('.','')) - e$(GameVersionFlat) - $(DefineConstants);$(GameVersionConstant) - + + $([System.IO.File]::ReadAllText($(MSBuildThisFileDirectory)/../supported-game-versions.txt)) + + + + - - - - $(BANNERLORD_STABLE_DIR) - $(BANNERLORD_BETA_DIR) - $(BANNERLORD_GAME_DIR) - + + + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`).Length) + $([MSBuild]::Subtract($(SGVLineCount), 1)) + + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[0]) + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[1]) + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[$(SGVLastEntryIndex)]) + + e1.1.0 + $(GameMinimalVersion) + $(GameStableVersion) + $(GameBetaVersion) + + $(GameVersionWithPrefix.Substring(1)) + + + $(OverrideGameVersion) + $(GameVersionWithPrefix.Substring(1)) + - - - - - $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 261550@InstallLocation) - - C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord - - ~/.steam/root/steamapps/common/Mount & Blade II Bannerlord - + + + + $(BANNERLORD_STABLE_DIR) + $(BANNERLORD_BETA_DIR) + $(BANNERLORD_GAME_DIR) + + + + + + + $(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 261550@InstallLocation) + + C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord + + ~/.steam/root/steamapps/common/Mount & Blade II Bannerlord + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + \ No newline at end of file diff --git a/build/common.targets b/build/common.targets new file mode 100644 index 00000000..e520f80a --- /dev/null +++ b/build/common.targets @@ -0,0 +1,19 @@ + + + + + + + + + + + + + <_Parameter1>GameVersion + <_Parameter2>$(GameVersionWithPrefix) + + + + + diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj b/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj new file mode 100644 index 00000000..654b0f28 --- /dev/null +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj @@ -0,0 +1,60 @@ + + + + $(ModuleName) + Minimal_Debug;Minimal_Release + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + \$displayname\$ + $(DisplayName) + + + \$mcmversion\$ + $(MCMVersion) + + + + diff --git a/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs rename to src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json b/src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json rename to src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs rename to src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs rename to src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs diff --git a/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs rename to src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs diff --git a/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml b/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml similarity index 100% rename from Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml rename to src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml diff --git a/src/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy.csproj deleted file mode 100644 index 12173fed..00000000 --- a/src/Bannerlord.Diplomacy.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - $(MSBuildProjectName) - Diplomacy - $(ModuleName).$(GameVersion) - - - - net472 - x64 - 9.0 - enable - Stable_Debug;Stable_Release;Beta_Debug;Beta_Release - $(DisplayName) - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - diff --git a/Bannerlord.Diplomacy.sln b/src/Bannerlord.Diplomacy.sln old mode 100755 new mode 100644 similarity index 65% rename from Bannerlord.Diplomacy.sln rename to src/Bannerlord.Diplomacy.sln index 34b63680..e5e3c52a --- a/Bannerlord.Diplomacy.sln +++ b/src/Bannerlord.Diplomacy.sln @@ -3,32 +3,40 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy", "src\Bannerlord.Diplomacy.csproj", "{AD3695A8-2BDD-44AF-A115-54F839A9EC2A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy", "Bannerlord.Diplomacy\Bannerlord.Diplomacy.csproj", "{AD3695A8-2BDD-44AF-A115-54F839A9EC2A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy.ImplementationLoader", "Bannerlord.Diplomacy.ImplementationLoader\Bannerlord.Diplomacy.ImplementationLoader.csproj", "{F8659754-47D5-472D-8939-666874D8C9B9}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{12CCA2B5-A874-47B3-BB43-799275014D7B}" ProjectSection(SolutionItems) = preProject - changelog.txt = changelog.txt - supported-game-versions.txt = supported-game-versions.txt + ..\changelog.txt = ..\changelog.txt + ..\supported-game-versions.txt = ..\supported-game-versions.txt EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CB20C6C8-2857-4B1E-9C00-265893C094E3}" ProjectSection(SolutionItems) = preProject - build\common.props = build\common.props + ..\build\common.props = ..\build\common.props + ..\build\common.targets = ..\build\common.targets EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{AE56FFC8-0129-4E0F-83C0-D00011A2B127}" + ProjectSection(SolutionItems) = preProject + ..\.github\dependabot.yml = ..\.github\dependabot.yml + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{8CBC023C-EB40-415D-8A78-B6B7F82523E9}" ProjectSection(SolutionItems) = preProject - .github\workflows\build.yml = .github\workflows\build.yml + ..\.github\workflows\build.yml = ..\.github\workflows\build.yml + ..\.github\workflows\dotnet-format-daily.yml = ..\.github\workflows\dotnet-format-daily.yml + ..\.github\workflows\TestBuild.yml = ..\.github\workflows\TestBuild.yml EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Beta_Debug|x64 = Beta_Debug|x64 Beta_Release|x64 = Beta_Release|x64 + Minimal_Debug|x64 = Minimal_Debug|x64 + Minimal_Release|x64 = Minimal_Release|x64 Stable_Debug|x64 = Stable_Debug|x64 Stable_Release|x64 = Stable_Release|x64 EndGlobalSection @@ -37,25 +45,31 @@ Global {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Beta_Debug|x64.Build.0 = Beta_Debug|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Beta_Release|x64.ActiveCfg = Beta_Release|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Beta_Release|x64.Build.0 = Beta_Release|x64 + {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Minimal_Debug|x64.ActiveCfg = Stable_Debug|x64 + {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Minimal_Debug|x64.Build.0 = Stable_Debug|x64 + {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Minimal_Release|x64.ActiveCfg = Stable_Release|x64 + {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Minimal_Release|x64.Build.0 = Stable_Release|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Debug|x64.ActiveCfg = Stable_Debug|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Debug|x64.Build.0 = Stable_Debug|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Release|x64.ActiveCfg = Stable_Release|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Release|x64.Build.0 = Stable_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.ActiveCfg = Beta_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.Build.0 = Beta_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.ActiveCfg = Beta_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.Build.0 = Beta_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.ActiveCfg = Stable_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.Build.0 = Stable_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.ActiveCfg = Stable_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.Build.0 = Stable_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.ActiveCfg = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.Build.0 = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.ActiveCfg = Minimal_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.Build.0 = Minimal_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Debug|x64.ActiveCfg = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Debug|x64.Build.0 = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Release|x64.ActiveCfg = Minimal_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Release|x64.Build.0 = Minimal_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.ActiveCfg = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.Build.0 = Minimal_Debug|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.ActiveCfg = Minimal_Release|x64 + {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.Build.0 = Minimal_Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {CB20C6C8-2857-4B1E-9C00-265893C094E3} = {12CCA2B5-A874-47B3-BB43-799275014D7B} - {AE56FFC8-0129-4E0F-83C0-D00011A2B127} = {12CCA2B5-A874-47B3-BB43-799275014D7B} {8CBC023C-EB40-415D-8A78-B6B7F82523E9} = {AE56FFC8-0129-4E0F-83C0-D00011A2B127} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj new file mode 100644 index 00000000..1b476b5d --- /dev/null +++ b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj @@ -0,0 +1,59 @@ + + + + $(ModuleName).$(GameVersion) + Stable_Debug;Stable_Release;Beta_Debug;Beta_Release + + + + + $([System.String]::Copy('$(GameVersion)').Replace('.','')) + e$(GameVersionFlat) + $(DefineConstants);$(GameVersionConstant) + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/CampaignBehaviors/AllianceBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs similarity index 100% rename from src/CampaignBehaviors/AllianceBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs diff --git a/src/CampaignBehaviors/CivilWarBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs similarity index 100% rename from src/CampaignBehaviors/CivilWarBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs diff --git a/src/CampaignBehaviors/CooldownBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs similarity index 100% rename from src/CampaignBehaviors/CooldownBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs diff --git a/src/CampaignBehaviors/DiplomaticAgreementBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs similarity index 100% rename from src/CampaignBehaviors/DiplomaticAgreementBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs diff --git a/src/CampaignBehaviors/ExpansionismBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs similarity index 100% rename from src/CampaignBehaviors/ExpansionismBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs diff --git a/src/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs similarity index 100% rename from src/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs diff --git a/src/CampaignBehaviors/MaintainInfluenceBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs similarity index 100% rename from src/CampaignBehaviors/MaintainInfluenceBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs diff --git a/src/CampaignBehaviors/MessengerBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs similarity index 100% rename from src/CampaignBehaviors/MessengerBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs diff --git a/src/CampaignBehaviors/UIBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs similarity index 100% rename from src/CampaignBehaviors/UIBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs diff --git a/src/CampaignBehaviors/WarExhaustionBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs similarity index 100% rename from src/CampaignBehaviors/WarExhaustionBehavior.cs rename to src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs diff --git a/src/Character/PlayerCharacterTraitEventExperience.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs similarity index 100% rename from src/Character/PlayerCharacterTraitEventExperience.cs rename to src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs diff --git a/src/Character/PlayerCharacterTraitHelper.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs similarity index 100% rename from src/Character/PlayerCharacterTraitHelper.cs rename to src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs diff --git a/src/Cheats.cs b/src/Bannerlord.Diplomacy/Cheats.cs similarity index 100% rename from src/Cheats.cs rename to src/Bannerlord.Diplomacy/Cheats.cs diff --git a/src/CivilWar/Actions/ChangeKingdomBannerAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs similarity index 100% rename from src/CivilWar/Actions/ChangeKingdomBannerAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs diff --git a/src/CivilWar/Actions/ConsolidateKingdomsAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs similarity index 100% rename from src/CivilWar/Actions/ConsolidateKingdomsAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs diff --git a/src/CivilWar/Actions/CreateFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs similarity index 100% rename from src/CivilWar/Actions/CreateFactionAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs diff --git a/src/CivilWar/Actions/JoinFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs similarity index 100% rename from src/CivilWar/Actions/JoinFactionAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs diff --git a/src/CivilWar/Actions/LeaveFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs similarity index 100% rename from src/CivilWar/Actions/LeaveFactionAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs diff --git a/src/CivilWar/Actions/StartRebellionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs similarity index 100% rename from src/CivilWar/Actions/StartRebellionAction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs diff --git a/src/CivilWar/FactionNameGenerator.cs b/src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs similarity index 100% rename from src/CivilWar/FactionNameGenerator.cs rename to src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs diff --git a/src/CivilWar/Factions/AbdicationFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs similarity index 100% rename from src/CivilWar/Factions/AbdicationFaction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs diff --git a/src/CivilWar/Factions/RebelDemandType.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelDemandType.cs similarity index 100% rename from src/CivilWar/Factions/RebelDemandType.cs rename to src/Bannerlord.Diplomacy/CivilWar/Factions/RebelDemandType.cs diff --git a/src/CivilWar/Factions/RebelFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs similarity index 100% rename from src/CivilWar/Factions/RebelFaction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs diff --git a/src/CivilWar/Factions/SecessionFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs similarity index 100% rename from src/CivilWar/Factions/SecessionFaction.cs rename to src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs diff --git a/src/CivilWar/RebelFactionManager.cs b/src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs similarity index 100% rename from src/CivilWar/RebelFactionManager.cs rename to src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs diff --git a/src/CivilWar/Scoring/AbdicationDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs similarity index 100% rename from src/CivilWar/Scoring/AbdicationDemandScore.cs rename to src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs diff --git a/src/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs similarity index 100% rename from src/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs rename to src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs diff --git a/src/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs similarity index 100% rename from src/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs rename to src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs diff --git a/src/CivilWar/Scoring/RebelFactionScoringModel.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs similarity index 100% rename from src/CivilWar/Scoring/RebelFactionScoringModel.cs rename to src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs diff --git a/src/CivilWar/Scoring/SecessionDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs similarity index 100% rename from src/CivilWar/Scoring/SecessionDemandScore.cs rename to src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs diff --git a/src/Compat.cs b/src/Bannerlord.Diplomacy/Compat.cs similarity index 100% rename from src/Compat.cs rename to src/Bannerlord.Diplomacy/Compat.cs diff --git a/src/CooldownManager.cs b/src/Bannerlord.Diplomacy/CooldownManager.cs similarity index 100% rename from src/CooldownManager.cs rename to src/Bannerlord.Diplomacy/CooldownManager.cs diff --git a/src/Costs/DiplomacyCost.cs b/src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs similarity index 100% rename from src/Costs/DiplomacyCost.cs rename to src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs diff --git a/src/Costs/DiplomacyCostCalculator.cs b/src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs similarity index 100% rename from src/Costs/DiplomacyCostCalculator.cs rename to src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs diff --git a/src/Costs/GoldCost.cs b/src/Bannerlord.Diplomacy/Costs/GoldCost.cs similarity index 100% rename from src/Costs/GoldCost.cs rename to src/Bannerlord.Diplomacy/Costs/GoldCost.cs diff --git a/src/Costs/HybridCost.cs b/src/Bannerlord.Diplomacy/Costs/HybridCost.cs similarity index 100% rename from src/Costs/HybridCost.cs rename to src/Bannerlord.Diplomacy/Costs/HybridCost.cs diff --git a/src/Costs/InfluenceCost.cs b/src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs similarity index 100% rename from src/Costs/InfluenceCost.cs rename to src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs diff --git a/src/CustomSavedTypeDefiner.cs b/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs similarity index 100% rename from src/CustomSavedTypeDefiner.cs rename to src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs diff --git a/src/DiplomaticAction/AbstractConditionEvaluator.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs similarity index 100% rename from src/DiplomaticAction/AbstractConditionEvaluator.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs diff --git a/src/DiplomaticAction/AbstractCostCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs similarity index 100% rename from src/DiplomaticAction/AbstractCostCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs diff --git a/src/DiplomaticAction/AbstractDiplomaticAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs similarity index 100% rename from src/DiplomaticAction/AbstractDiplomaticAction.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs diff --git a/src/DiplomaticAction/AbstractScoringModel.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs similarity index 100% rename from src/DiplomaticAction/AbstractScoringModel.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs diff --git a/src/DiplomaticAction/Alliance/AllianceEvent.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs similarity index 100% rename from src/DiplomaticAction/Alliance/AllianceEvent.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs diff --git a/src/DiplomaticAction/Alliance/AllianceScoringModel.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs similarity index 100% rename from src/DiplomaticAction/Alliance/AllianceScoringModel.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs diff --git a/src/DiplomaticAction/Alliance/BreakAllianceAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs similarity index 100% rename from src/DiplomaticAction/Alliance/BreakAllianceAction.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs diff --git a/src/DiplomaticAction/Alliance/BreakAllianceConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs similarity index 100% rename from src/DiplomaticAction/Alliance/BreakAllianceConditions.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/AlliancesEnabled.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/AlliancesEnabled.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/AlliancesEnabled.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/AlliancesEnabled.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/HasEnoughGoldCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughGoldCondition.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/HasEnoughGoldCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughGoldCondition.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/HasEnoughInfluenceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughInfluenceCondition.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/HasEnoughInfluenceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughInfluenceCondition.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/HasEnoughScoreCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughScoreCondition.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/HasEnoughScoreCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/HasEnoughScoreCondition.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceAllianceFormedDuration.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceAllianceFormedDuration.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceAllianceFormedDuration.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceAllianceFormedDuration.cs diff --git a/src/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceLastWarCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceLastWarCondition.cs similarity index 100% rename from src/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceLastWarCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/Conditions/TimeElapsedSinceLastWarCondition.cs diff --git a/src/DiplomaticAction/Alliance/DeclareAllianceAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/DeclareAllianceAction.cs similarity index 100% rename from src/DiplomaticAction/Alliance/DeclareAllianceAction.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/DeclareAllianceAction.cs diff --git a/src/DiplomaticAction/Alliance/FormAllianceConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/FormAllianceConditions.cs similarity index 100% rename from src/DiplomaticAction/Alliance/FormAllianceConditions.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/FormAllianceConditions.cs diff --git a/src/DiplomaticAction/DiplomaticAgreement.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/DiplomaticAgreement.cs similarity index 100% rename from src/DiplomaticAction/DiplomaticAgreement.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/DiplomaticAgreement.cs diff --git a/src/DiplomaticAction/DiplomaticAgreementManager.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/DiplomaticAgreementManager.cs similarity index 100% rename from src/DiplomaticAction/DiplomaticAgreementManager.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/DiplomaticAgreementManager.cs diff --git a/src/DiplomaticAction/GenericConditions/AtPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs similarity index 100% rename from src/DiplomaticAction/GenericConditions/AtPeaceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs diff --git a/src/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs similarity index 100% rename from src/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs diff --git a/src/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs similarity index 100% rename from src/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs diff --git a/src/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs similarity index 100% rename from src/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs diff --git a/src/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs diff --git a/src/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs diff --git a/src/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs diff --git a/src/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs diff --git a/src/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs diff --git a/src/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs diff --git a/src/DiplomaticAction/NonAggressionPact/NonAggressionPactScoringModel.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactScoringModel.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPact/NonAggressionPactScoringModel.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactScoringModel.cs diff --git a/src/DiplomaticAction/NonAggressionPactAgreement.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs similarity index 100% rename from src/DiplomaticAction/NonAggressionPactAgreement.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs diff --git a/src/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs diff --git a/src/DiplomaticAction/WarPeace/DeclareWarConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/DeclareWarConditions.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs diff --git a/src/DiplomaticAction/WarPeace/KingdomPeaceAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/KingdomPeaceAction.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/KingdomPeaceAction.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/KingdomPeaceAction.cs diff --git a/src/DiplomaticAction/WarPeace/MakePeaceConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/MakePeaceConditions.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs diff --git a/src/DiplomaticAction/WarPeace/WarDeclaredEvent.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs similarity index 100% rename from src/DiplomaticAction/WarPeace/WarDeclaredEvent.cs rename to src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs diff --git a/src/Event/Events.cs b/src/Bannerlord.Diplomacy/Event/Events.cs similarity index 100% rename from src/Event/Events.cs rename to src/Bannerlord.Diplomacy/Event/Events.cs diff --git a/src/Event/WarExhaustionEvent.cs b/src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs similarity index 100% rename from src/Event/WarExhaustionEvent.cs rename to src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs diff --git a/src/ExpansionismManager.cs b/src/Bannerlord.Diplomacy/ExpansionismManager.cs similarity index 100% rename from src/ExpansionismManager.cs rename to src/Bannerlord.Diplomacy/ExpansionismManager.cs diff --git a/src/Extensions/ClanExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs similarity index 100% rename from src/Extensions/ClanExtensions.cs rename to src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs diff --git a/src/Extensions/HeroExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs similarity index 100% rename from src/Extensions/HeroExtensions.cs rename to src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs diff --git a/src/Extensions/KingdomExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs similarity index 100% rename from src/Extensions/KingdomExtensions.cs rename to src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs diff --git a/src/FactionPair.cs b/src/Bannerlord.Diplomacy/FactionPair.cs similarity index 100% rename from src/FactionPair.cs rename to src/Bannerlord.Diplomacy/FactionPair.cs diff --git a/src/FieldAccessHelper.cs b/src/Bannerlord.Diplomacy/FieldAccessHelper.cs similarity index 100% rename from src/FieldAccessHelper.cs rename to src/Bannerlord.Diplomacy/FieldAccessHelper.cs diff --git a/src/GauntletInterfaces/DetailWarViewInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs similarity index 100% rename from src/GauntletInterfaces/DetailWarViewInterface.cs rename to src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs diff --git a/src/GauntletInterfaces/DonateGoldInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs similarity index 100% rename from src/GauntletInterfaces/DonateGoldInterface.cs rename to src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs diff --git a/src/GauntletInterfaces/GenericInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs similarity index 100% rename from src/GauntletInterfaces/GenericInterface.cs rename to src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs diff --git a/src/GauntletInterfaces/GrantFiefInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs similarity index 100% rename from src/GauntletInterfaces/GrantFiefInterface.cs rename to src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs diff --git a/src/GauntletInterfaces/RebelFactionsInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs similarity index 100% rename from src/GauntletInterfaces/RebelFactionsInterface.cs rename to src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs diff --git a/src/GrantFief/GrantFiefAction.cs b/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs similarity index 100% rename from src/GrantFief/GrantFiefAction.cs rename to src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs diff --git a/src/IDiplomacyCondition.cs b/src/Bannerlord.Diplomacy/IDiplomacyCondition.cs similarity index 100% rename from src/IDiplomacyCondition.cs rename to src/Bannerlord.Diplomacy/IDiplomacyCondition.cs diff --git a/src/LogFactory.cs b/src/Bannerlord.Diplomacy/LogFactory.cs similarity index 100% rename from src/LogFactory.cs rename to src/Bannerlord.Diplomacy/LogFactory.cs diff --git a/src/MessageHelper.cs b/src/Bannerlord.Diplomacy/MessageHelper.cs similarity index 100% rename from src/MessageHelper.cs rename to src/Bannerlord.Diplomacy/MessageHelper.cs diff --git a/src/Messengers/Messenger.cs b/src/Bannerlord.Diplomacy/Messengers/Messenger.cs similarity index 100% rename from src/Messengers/Messenger.cs rename to src/Bannerlord.Diplomacy/Messengers/Messenger.cs diff --git a/src/Messengers/MessengerManager.cs b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs similarity index 100% rename from src/Messengers/MessengerManager.cs rename to src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs diff --git a/src/PatchTools/PatchClass.cs b/src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs similarity index 100% rename from src/PatchTools/PatchClass.cs rename to src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs diff --git a/src/PatchTools/PatchManager.cs b/src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs similarity index 100% rename from src/PatchTools/PatchManager.cs rename to src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs diff --git a/src/PatchTools/Priority.cs b/src/Bannerlord.Diplomacy/PatchTools/Priority.cs similarity index 100% rename from src/PatchTools/Priority.cs rename to src/Bannerlord.Diplomacy/PatchTools/Priority.cs diff --git a/src/Patches/DeclareWarActionPatch.cs b/src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs similarity index 100% rename from src/Patches/DeclareWarActionPatch.cs rename to src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs diff --git a/src/Patches/DefaultClanPoliticsModelPatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs similarity index 100% rename from src/Patches/DefaultClanPoliticsModelPatch.cs rename to src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs diff --git a/src/Patches/DefaultEncyclopediaFactionPagePatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs similarity index 100% rename from src/Patches/DefaultEncyclopediaFactionPagePatch.cs rename to src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs diff --git a/src/Patches/DiplomaticBartersBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs similarity index 100% rename from src/Patches/DiplomaticBartersBehaviorPatch.cs rename to src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs diff --git a/src/Patches/EncyclopediaDataPatch.cs b/src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs similarity index 100% rename from src/Patches/EncyclopediaDataPatch.cs rename to src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs diff --git a/src/Patches/FactionManagerPatch.cs b/src/Bannerlord.Diplomacy/Patches/FactionManagerPatch.cs old mode 100755 new mode 100644 similarity index 100% rename from src/Patches/FactionManagerPatch.cs rename to src/Bannerlord.Diplomacy/Patches/FactionManagerPatch.cs diff --git a/src/Patches/GameMenusCallbacksPatch.cs b/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs similarity index 100% rename from src/Patches/GameMenusCallbacksPatch.cs rename to src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs diff --git a/src/Patches/GiveGoldToClanActionPatch.cs b/src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs similarity index 100% rename from src/Patches/GiveGoldToClanActionPatch.cs rename to src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs diff --git a/src/Patches/KingdomDecisionProposalBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs similarity index 100% rename from src/Patches/KingdomDecisionProposalBehaviorPatch.cs rename to src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs diff --git a/src/Patches/KingdomManagementVMPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs similarity index 100% rename from src/Patches/KingdomManagementVMPatch.cs rename to src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs diff --git a/src/Patches/MBBannerEditorGauntletScreenPatch.cs b/src/Bannerlord.Diplomacy/Patches/MBBannerEditorGauntletScreenPatch.cs similarity index 100% rename from src/Patches/MBBannerEditorGauntletScreenPatch.cs rename to src/Bannerlord.Diplomacy/Patches/MBBannerEditorGauntletScreenPatch.cs diff --git a/src/Patches/RebelKingdomPatches.cs b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs similarity index 100% rename from src/Patches/RebelKingdomPatches.cs rename to src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs diff --git a/src/Patches/SupportKingdomQuestPatch.cs b/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs similarity index 100% rename from src/Patches/SupportKingdomQuestPatch.cs rename to src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs diff --git a/src/Patches/UrbanCharactersCampaignBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs similarity index 100% rename from src/Patches/UrbanCharactersCampaignBehaviorPatch.cs rename to src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs diff --git a/src/PlayerHelpers.cs b/src/Bannerlord.Diplomacy/PlayerHelpers.cs similarity index 100% rename from src/PlayerHelpers.cs rename to src/Bannerlord.Diplomacy/PlayerHelpers.cs diff --git a/src/Properties/launchSettings.json b/src/Bannerlord.Diplomacy/Properties/launchSettings.json similarity index 100% rename from src/Properties/launchSettings.json rename to src/Bannerlord.Diplomacy/Properties/launchSettings.json diff --git a/src/Reflect.cs b/src/Bannerlord.Diplomacy/Reflect.cs similarity index 100% rename from src/Reflect.cs rename to src/Bannerlord.Diplomacy/Reflect.cs diff --git a/src/Settings.cs b/src/Bannerlord.Diplomacy/Settings.cs similarity index 100% rename from src/Settings.cs rename to src/Bannerlord.Diplomacy/Settings.cs diff --git a/src/StringConstants.cs b/src/Bannerlord.Diplomacy/StringConstants.cs similarity index 100% rename from src/StringConstants.cs rename to src/Bannerlord.Diplomacy/StringConstants.cs diff --git a/src/SubModule.cs b/src/Bannerlord.Diplomacy/SubModule.cs similarity index 100% rename from src/SubModule.cs rename to src/Bannerlord.Diplomacy/SubModule.cs diff --git a/src/ViewModel/DetailWarStatsVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs similarity index 100% rename from src/ViewModel/DetailWarStatsVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs diff --git a/src/ViewModel/DetailWarVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs similarity index 100% rename from src/ViewModel/DetailWarVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs diff --git a/src/ViewModel/DiplomacyFactionRelationshipVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs similarity index 100% rename from src/ViewModel/DiplomacyFactionRelationshipVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs diff --git a/src/ViewModel/DiplomacyPropertiesVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs similarity index 100% rename from src/ViewModel/DiplomacyPropertiesVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs diff --git a/src/ViewModel/DonateGoldVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs similarity index 100% rename from src/ViewModel/DonateGoldVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs diff --git a/src/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs similarity index 100% rename from src/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs diff --git a/src/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs similarity index 100% rename from src/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs diff --git a/src/ViewModel/GrantFiefItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs similarity index 100% rename from src/ViewModel/GrantFiefItemVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs diff --git a/src/ViewModel/GrantFiefSortControllerVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs similarity index 100% rename from src/ViewModel/GrantFiefSortControllerVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs diff --git a/src/ViewModel/GrantFiefVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs similarity index 100% rename from src/ViewModel/GrantFiefVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs diff --git a/src/ViewModel/RebelFactionItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs similarity index 100% rename from src/ViewModel/RebelFactionItemVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs diff --git a/src/ViewModel/RebelFactionParticipantVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs similarity index 100% rename from src/ViewModel/RebelFactionParticipantVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs diff --git a/src/ViewModel/RebelFactionsVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs similarity index 100% rename from src/ViewModel/RebelFactionsVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs diff --git a/src/ViewModel/WarExhaustionBreakdownVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs similarity index 100% rename from src/ViewModel/WarExhaustionBreakdownVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs diff --git a/src/ViewModel/WarExhaustionMapIndicatorItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs similarity index 100% rename from src/ViewModel/WarExhaustionMapIndicatorItemVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs diff --git a/src/ViewModel/WarExhaustionMapIndicatorVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs similarity index 100% rename from src/ViewModel/WarExhaustionMapIndicatorVM.cs rename to src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs diff --git a/src/ViewModelMixin/DiplomacyPanelPrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs similarity index 100% rename from src/ViewModelMixin/DiplomacyPanelPrefabExtension.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs diff --git a/src/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs similarity index 100% rename from src/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs diff --git a/src/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs similarity index 100% rename from src/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs diff --git a/src/ViewModelMixin/KingdomClanVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs similarity index 100% rename from src/ViewModelMixin/KingdomClanVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs diff --git a/src/ViewModelMixin/KingdomDiplomacyVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs similarity index 100% rename from src/ViewModelMixin/KingdomDiplomacyVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs diff --git a/src/ViewModelMixin/KingdomManagementPrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs similarity index 100% rename from src/ViewModelMixin/KingdomManagementPrefabExtension.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs diff --git a/src/ViewModelMixin/KingdomManagementVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs similarity index 100% rename from src/ViewModelMixin/KingdomManagementVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs diff --git a/src/ViewModelMixin/KingdomTruceItemVmMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs similarity index 100% rename from src/ViewModelMixin/KingdomTruceItemVmMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs diff --git a/src/ViewModelMixin/KingdomWarItemVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs similarity index 100% rename from src/ViewModelMixin/KingdomWarItemVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs diff --git a/src/ViewModelMixin/MapNavigationVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs similarity index 100% rename from src/ViewModelMixin/MapNavigationVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs diff --git a/src/ViewModelMixin/PartyNameplateVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs similarity index 100% rename from src/ViewModelMixin/PartyNameplateVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs diff --git a/src/ViewModelMixin/SettlementNameplatesVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs similarity index 100% rename from src/ViewModelMixin/SettlementNameplatesVMMixin.cs rename to src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs diff --git a/src/Views/GauntletWarExhaustionIndicator.cs b/src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs similarity index 100% rename from src/Views/GauntletWarExhaustionIndicator.cs rename to src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs diff --git a/src/Views/WarExhaustionIndicatorView.cs b/src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs similarity index 100% rename from src/Views/WarExhaustionIndicatorView.cs rename to src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs diff --git a/src/WarExhaustionManager.cs b/src/Bannerlord.Diplomacy/WarExhaustionManager.cs similarity index 100% rename from src/WarExhaustionManager.cs rename to src/Bannerlord.Diplomacy/WarExhaustionManager.cs diff --git a/src/_Module/GUI/Brushes/Diplomacy.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Brushes/Diplomacy.xml similarity index 100% rename from src/_Module/GUI/Brushes/Diplomacy.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Brushes/Diplomacy.xml diff --git a/src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaFactionPageInject.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaFactionPageInject.xml similarity index 100% rename from src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaFactionPageInject.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaFactionPageInject.xml diff --git a/src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaHeroPageInject.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaHeroPageInject.xml similarity index 100% rename from src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaHeroPageInject.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/EncyclopediaHeroPageInject.xml diff --git a/src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/FactionButtonInject.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/FactionButtonInject.xml similarity index 100% rename from src/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/FactionButtonInject.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Encyclopedia/EncyclopediaSubPages/FactionButtonInject.xml diff --git a/src/_Module/GUI/Prefabs/GrantFief/GrantFief.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/GrantFief/GrantFief.xml similarity index 100% rename from src/_Module/GUI/Prefabs/GrantFief/GrantFief.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/GrantFief/GrantFief.xml diff --git a/src/_Module/GUI/Prefabs/GrantFief/GrantFiefTuple.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/GrantFief/GrantFiefTuple.xml similarity index 100% rename from src/_Module/GUI/Prefabs/GrantFief/GrantFiefTuple.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/GrantFief/GrantFiefTuple.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Clan/ClansPanel.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Clan/ClansPanel.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Clan/ClansPanel.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Clan/ClansPanel.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Clan/DonateGold.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Clan/DonateGold.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Clan/DonateGold.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Clan/DonateGold.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanelButtons.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanelButtons.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanelButtons.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanelButtons.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_1510.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_1510.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_1510.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_1510.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_159.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_159.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_159.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/DiplomacyPanel_159.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/OverviewTab.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/OverviewTab.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/OverviewTab.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/OverviewTab.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/Relationship.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/Relationship.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/Relationship.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/Relationship.xml diff --git a/src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/StatsTab.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/StatsTab.xml similarity index 100% rename from src/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/StatsTab.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/KingdomManagement/Diplomacy/StatsTab.xml diff --git a/src/_Module/GUI/Prefabs/RebelFactions/RebelFactionDivider.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionDivider.xml similarity index 100% rename from src/_Module/GUI/Prefabs/RebelFactions/RebelFactionDivider.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionDivider.xml diff --git a/src/_Module/GUI/Prefabs/RebelFactions/RebelFactionParticipant.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionParticipant.xml similarity index 100% rename from src/_Module/GUI/Prefabs/RebelFactions/RebelFactionParticipant.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionParticipant.xml diff --git a/src/_Module/GUI/Prefabs/RebelFactions/RebelFactions.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactions.xml similarity index 100% rename from src/_Module/GUI/Prefabs/RebelFactions/RebelFactions.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactions.xml diff --git a/src/_Module/GUI/Prefabs/RebelFactions/RebelFactionsItem.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionsItem.xml similarity index 100% rename from src/_Module/GUI/Prefabs/RebelFactions/RebelFactionsItem.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/RebelFactions/RebelFactionsItem.xml diff --git a/src/_Module/GUI/Prefabs/Standard/BasicDiplomacyButton.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Standard/BasicDiplomacyButton.xml similarity index 100% rename from src/_Module/GUI/Prefabs/Standard/BasicDiplomacyButton.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Standard/BasicDiplomacyButton.xml diff --git a/src/_Module/GUI/Prefabs/Standard/StaticDiplomacyButton.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Standard/StaticDiplomacyButton.xml similarity index 100% rename from src/_Module/GUI/Prefabs/Standard/StaticDiplomacyButton.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/Standard/StaticDiplomacyButton.xml diff --git a/src/_Module/GUI/Prefabs/WarExhaustion/DetailWarView.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/WarExhaustion/DetailWarView.xml similarity index 100% rename from src/_Module/GUI/Prefabs/WarExhaustion/DetailWarView.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/WarExhaustion/DetailWarView.xml diff --git a/src/_Module/GUI/Prefabs/WarExhaustion/WarExhaustionMapIndicator.xml b/src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/WarExhaustion/WarExhaustionMapIndicator.xml similarity index 100% rename from src/_Module/GUI/Prefabs/WarExhaustion/WarExhaustionMapIndicator.xml rename to src/Bannerlord.Diplomacy/_Module/GUI/Prefabs/WarExhaustion/WarExhaustionMapIndicator.xml diff --git a/src/_Module/ModuleData/civil_war_strings_xml.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/civil_war_strings_xml.xml similarity index 100% rename from src/_Module/ModuleData/civil_war_strings_xml.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/civil_war_strings_xml.xml diff --git a/src/_Module/ModuleData/faction_names_xml.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/faction_names_xml.xml similarity index 100% rename from src/_Module/ModuleData/faction_names_xml.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/faction_names_xml.xml diff --git a/src/_Module/ModuleData/gt_common.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/gt_common.xml similarity index 100% rename from src/_Module/ModuleData/gt_common.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/gt_common.xml diff --git a/src/_Module/ModuleData/gt_help.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/gt_help.xml similarity index 100% rename from src/_Module/ModuleData/gt_help.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/gt_help.xml diff --git a/src/_Module/ModuleData/help_strings_xml.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/help_strings_xml.xml similarity index 100% rename from src/_Module/ModuleData/help_strings_xml.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/help_strings_xml.xml diff --git a/src/_Module/ModuleData/std_module_strings_xml.xml b/src/Bannerlord.Diplomacy/_Module/ModuleData/std_module_strings_xml.xml similarity index 100% rename from src/_Module/ModuleData/std_module_strings_xml.xml rename to src/Bannerlord.Diplomacy/_Module/ModuleData/std_module_strings_xml.xml diff --git a/src/Diplomacy.sln b/src/Diplomacy.sln deleted file mode 100644 index e9a4ecc7..00000000 --- a/src/Diplomacy.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Diplomacy", "Diplomacy.csproj", "{23764F91-DA63-4FDF-BF3E-1434878066E6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Beta_Debug|x64 = Beta_Debug|x64 - Beta_Release|x64 = Beta_Release|x64 - Stable_Debug|x64 = Stable_Debug|x64 - Stable_Release|x64 = Stable_Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Beta_Debug|x64.ActiveCfg = Beta_Debug|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Beta_Debug|x64.Build.0 = Beta_Debug|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Beta_Release|x64.ActiveCfg = Beta_Release|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Beta_Release|x64.Build.0 = Beta_Release|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Stable_Debug|x64.ActiveCfg = Stable_Debug|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Stable_Debug|x64.Build.0 = Stable_Debug|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Stable_Release|x64.ActiveCfg = Stable_Release|x64 - {23764F91-DA63-4FDF-BF3E-1434878066E6}.Stable_Release|x64.Build.0 = Stable_Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2BE25DC4-AE62-4753-BD96-C6DC6D35537F} - EndGlobalSection -EndGlobal diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ba3f4c92..c00df63b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,3 @@ - - - - - \ No newline at end of file + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..1ff7af51 --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,3 @@ + + + From 53daa16887f06878f640ee30d5f235574518b902 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:43:07 +0000 Subject: [PATCH 02/41] Bump IsExternalInit from 1.0.0 to 1.0.2 Bumps [IsExternalInit](https://github.com/manuelroemer/IsExternalInit) from 1.0.0 to 1.0.2. - [Release notes](https://github.com/manuelroemer/IsExternalInit/releases) - [Changelog](https://github.com/manuelroemer/IsExternalInit/blob/master/CHANGELOG.md) - [Commits](https://github.com/manuelroemer/IsExternalInit/commits) --- updated-dependencies: - dependency-name: IsExternalInit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Bannerlord.Diplomacy.ImplementationLoader.csproj | 2 +- src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj b/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj index 654b0f28..d04d5e3e 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj @@ -26,7 +26,7 @@ and we need to reference that old version instead of the latest. --> - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj index 1b476b5d..e0734dee 100644 --- a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj +++ b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj @@ -33,7 +33,7 @@ and we need to reference that old version instead of the latest. --> - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 63edd94f382487db15e23aadce673e3085ab7ce0 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Tue, 14 Dec 2021 14:48:57 +0300 Subject: [PATCH 03/41] Update TestBuild.yml --- .github/workflows/TestBuild.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index 03a11da4..0cf8e2bb 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -5,6 +5,10 @@ on: branches: - '*' - '!main' + pull_request: + branches: + - main + - dev env: # Disable the .NET logo in the console output. From 2be50205ceb9e834e33cee45b06bb08bac0bc994 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:52:52 +0000 Subject: [PATCH 04/41] Automated dotnet-format update --- .../ImplementationLoaderSubModule.cs | 71 ++++++++-------- .../Widgets/CriticalThresholdTextWidget.cs | 3 +- .../Widgets/HoveredBrushWidget.cs | 1 + .../KingdomDiplomacyPanelTabControlWidget.cs | 3 +- .../CampaignBehaviors/AllianceBehavior.cs | 2 +- .../CampaignBehaviors/CivilWarBehavior.cs | 10 ++- .../CampaignBehaviors/CooldownBehavior.cs | 6 +- .../DiplomaticAgreementBehavior.cs | 2 +- .../CampaignBehaviors/ExpansionismBehavior.cs | 2 +- .../KeepFiefAfterSiegeBehavior.cs | 2 +- .../MaintainInfluenceBehavior.cs | 8 +- .../CampaignBehaviors/MessengerBehavior.cs | 2 +- .../CampaignBehaviors/UIBehavior.cs | 6 +- .../WarExhaustionBehavior.cs | 4 +- .../PlayerCharacterTraitEventExperience.cs | 5 +- .../Character/PlayerCharacterTraitHelper.cs | 6 +- src/Bannerlord.Diplomacy/Cheats.cs | 11 ++- .../Actions/ChangeKingdomBannerAction.cs | 18 ++-- .../Actions/ConsolidateKingdomsAction.cs | 8 +- .../CivilWar/Actions/CreateFactionAction.cs | 12 +-- .../CivilWar/Actions/JoinFactionAction.cs | 14 ++-- .../CivilWar/Actions/LeaveFactionAction.cs | 3 +- .../CivilWar/Actions/StartRebellionAction.cs | 6 +- .../CivilWar/FactionNameGenerator.cs | 61 +++++++++----- .../CivilWar/Factions/AbdicationFaction.cs | 8 +- .../CivilWar/Factions/RebelFaction.cs | 25 +++--- .../CivilWar/Factions/SecessionFaction.cs | 6 +- .../CivilWar/RebelFactionManager.cs | 18 ++-- .../CivilWar/Scoring/AbdicationDemandScore.cs | 8 +- .../AbstractFactionDemandScoringModel.cs | 8 +- .../Scoring/ChangeRulerFactionScoreBase.cs | 6 +- .../Scoring/RebelFactionScoringModel.cs | 8 +- .../CivilWar/Scoring/SecessionDemandScore.cs | 12 +-- src/Bannerlord.Diplomacy/Compat.cs | 2 +- src/Bannerlord.Diplomacy/CooldownManager.cs | 19 +++-- .../Costs/DiplomacyCost.cs | 2 +- .../Costs/DiplomacyCostCalculator.cs | 13 +-- src/Bannerlord.Diplomacy/Costs/GoldCost.cs | 8 +- src/Bannerlord.Diplomacy/Costs/HybridCost.cs | 2 +- .../Costs/InfluenceCost.cs | 2 +- .../CustomSavedTypeDefiner.cs | 6 +- .../AbstractConditionEvaluator.cs | 4 +- .../DiplomaticAction/AbstractCostCondition.cs | 2 +- .../AbstractDiplomaticAction.cs | 3 +- .../DiplomaticAction/AbstractScoringModel.cs | 4 +- .../Alliance/AllianceEvent.cs | 2 +- .../Alliance/AllianceScoringModel.cs | 2 +- .../Alliance/BreakAllianceAction.cs | 2 +- .../Alliance/BreakAllianceConditions.cs | 3 +- .../Alliance/Conditions/AlliancesEnabled.cs | 2 +- .../Conditions/HasEnoughGoldCondition.cs | 3 +- .../Conditions/HasEnoughInfluenceCondition.cs | 3 +- .../Conditions/HasEnoughScoreCondition.cs | 2 +- .../TimeElapsedSinceAllianceFormedDuration.cs | 5 +- .../TimeElapsedSinceLastWarCondition.cs | 7 +- .../Alliance/DeclareAllianceAction.cs | 4 +- .../Alliance/FormAllianceConditions.cs | 3 +- .../DiplomaticAction/DiplomaticAgreement.cs | 2 +- .../DiplomaticAgreementManager.cs | 11 ++- .../GenericConditions/AtPeaceCondition.cs | 2 +- .../HasAuthorityCondition.cs | 2 +- .../NotInAllianceCondition.cs | 4 +- .../NotRebelKingdomCondition.cs | 1 + .../FormNonAggressionPactAction.cs | 4 +- .../HasEnoughGoldCondition.cs | 3 +- .../HasEnoughInfluenceCondition.cs | 3 +- .../HasEnoughScoreCondition.cs | 2 +- .../NoNonAggressionPactCondition.cs | 2 +- .../NonAggressionPactConditions.cs | 3 +- .../NonAggressionPactScoringModel.cs | 2 +- .../NonAggressionPactAgreement.cs | 2 +- .../HasEnoughGoldForPeaceCondition.cs | 3 +- .../HasEnoughInfluenceForPeaceCondition.cs | 3 +- .../HasEnoughInfluenceForWarCondition.cs | 3 +- .../HasEnoughTimeElapsedForPeaceCondition.cs | 5 +- .../WarPeace/Conditions/NoSiegeCondition.cs | 2 +- ...tisfiesQuestConditionsForPeaceCondition.cs | 2 +- .../WarPeace/DeclareWarConditions.cs | 2 +- .../WarPeace/KingdomPeaceAction.cs | 6 +- .../WarPeace/MakePeaceConditions.cs | 3 +- .../WarPeace/WarDeclaredEvent.cs | 4 +- src/Bannerlord.Diplomacy/Event/Events.cs | 6 +- .../Event/WarExhaustionEvent.cs | 2 +- .../ExpansionismManager.cs | 9 +- .../Extensions/ClanExtensions.cs | 8 +- .../Extensions/HeroExtensions.cs | 3 +- .../Extensions/KingdomExtensions.cs | 6 +- src/Bannerlord.Diplomacy/FactionPair.cs | 2 +- src/Bannerlord.Diplomacy/FieldAccessHelper.cs | 2 +- .../DetailWarViewInterface.cs | 2 + .../GauntletInterfaces/DonateGoldInterface.cs | 1 + .../GauntletInterfaces/GenericInterface.cs | 1 + .../GauntletInterfaces/GrantFiefInterface.cs | 6 +- .../RebelFactionsInterface.cs | 1 + .../GrantFief/GrantFiefAction.cs | 8 +- .../IDiplomacyCondition.cs | 2 +- src/Bannerlord.Diplomacy/LogFactory.cs | 2 +- src/Bannerlord.Diplomacy/MessageHelper.cs | 3 +- .../Messengers/Messenger.cs | 1 + .../Messengers/MessengerManager.cs | 13 +-- .../PatchTools/PatchClass.cs | 2 +- .../PatchTools/PatchManager.cs | 4 +- .../PatchTools/Priority.cs | 82 +++++++++---------- .../Patches/DeclareWarActionPatch.cs | 4 +- .../Patches/DefaultClanPoliticsModelPatch.cs | 4 +- .../DefaultEncyclopediaFactionPagePatch.cs | 6 +- .../Patches/DiplomaticBartersBehaviorPatch.cs | 2 +- .../Patches/EncyclopediaDataPatch.cs | 8 +- .../Patches/FactionManagerPatch.cs | 8 +- .../Patches/GameMenusCallbacksPatch.cs | 2 +- .../Patches/GiveGoldToClanActionPatch.cs | 2 +- .../KingdomDecisionProposalBehaviorPatch.cs | 2 +- .../Patches/KingdomManagementVMPatch.cs | 2 +- .../Patches/RebelKingdomPatches.cs | 2 +- .../Patches/SupportKingdomQuestPatch.cs | 8 +- .../UrbanCharactersCampaignBehaviorPatch.cs | 10 +-- src/Bannerlord.Diplomacy/PlayerHelpers.cs | 2 +- src/Bannerlord.Diplomacy/Reflect.cs | 16 ++-- src/Bannerlord.Diplomacy/Settings.cs | 6 +- src/Bannerlord.Diplomacy/StringConstants.cs | 2 +- src/Bannerlord.Diplomacy/SubModule.cs | 16 ++-- .../ViewModel/DetailWarStatsVM.cs | 3 +- .../ViewModel/DetailWarVM.cs | 7 +- .../DiplomacyFactionRelationshipVM.cs | 10 ++- .../ViewModel/DiplomacyPropertiesVM.cs | 16 ++-- .../ViewModel/DonateGoldVM.cs | 10 ++- .../EncyclopediaFactionPageVMExtensionVM.cs | 13 +-- .../EncyclopediaHeroPageVMExtensionVM.cs | 8 +- .../ViewModel/GrantFiefItemVM.cs | 11 ++- .../ViewModel/GrantFiefSortControllerVM.cs | 13 +-- .../ViewModel/GrantFiefVM.cs | 9 +- .../ViewModel/RebelFactionItemVM.cs | 7 +- .../ViewModel/RebelFactionParticipantVM.cs | 9 +- .../ViewModel/RebelFactionsVM.cs | 11 ++- .../ViewModel/WarExhaustionBreakdownVM.cs | 1 + .../WarExhaustionMapIndicatorItemVM.cs | 4 +- .../ViewModel/WarExhaustionMapIndicatorVM.cs | 1 + .../DiplomacyPanelPrefabExtension.cs | 7 +- .../EncyclopediaFactionPagePrefabExtension.cs | 6 +- .../EncyclopediaHeroPagePrefabExtension.cs | 6 +- .../ViewModelMixin/KingdomClanVMMixin.cs | 5 +- .../ViewModelMixin/KingdomDiplomacyVMMixin.cs | 15 ++-- .../KingdomManagementPrefabExtension.cs | 6 +- .../KingdomManagementVMMixin.cs | 5 +- .../ViewModelMixin/KingdomTruceItemVmMixin.cs | 10 ++- .../ViewModelMixin/KingdomWarItemVMMixin.cs | 8 +- .../ViewModelMixin/MapNavigationVMMixin.cs | 5 +- .../ViewModelMixin/PartyNameplateVMMixin.cs | 6 +- .../SettlementNameplatesVMMixin.cs | 6 +- .../Views/GauntletWarExhaustionIndicator.cs | 3 + .../Views/WarExhaustionIndicatorView.cs | 2 +- .../WarExhaustionManager.cs | 2 + 152 files changed, 612 insertions(+), 427 deletions(-) diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs index ea641549..e06692ab 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -using Bannerlord.BUTR.Shared.Helpers; - +using Bannerlord.BUTR.Shared.Helpers; using Bannerlord.ButterLib.Common.Extensions; using Bannerlord.ButterLib.Common.Helpers; using Bannerlord.ButterLib.SubModuleWrappers; @@ -16,6 +7,14 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Reflection.Metadata; +using System.Reflection.PortableExecutable; + using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.MountAndBlade; @@ -82,39 +81,39 @@ private static IEnumerable LoadAllImplementations(ILogger? logg switch (implementationsForGameVersion.Count) { case > 1: - { - logger?.LogInformation("Found multiple matching implementations:"); - foreach (var (implementation1, version1) in implementationsForGameVersion) - logger?.LogInformation("Implementation {name} for game {gameVersion}.", implementation1.Name, version1); + { + logger?.LogInformation("Found multiple matching implementations:"); + foreach (var (implementation1, version1) in implementationsForGameVersion) + logger?.LogInformation("Implementation {name} for game {gameVersion}.", implementation1.Name, version1); - logger?.LogInformation("Loading the latest available."); + logger?.LogInformation("Loading the latest available."); - var (implementation, version) = ImplementationLatest(implementationsForGameVersion); - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } + var (implementation, version) = ImplementationLatest(implementationsForGameVersion); + logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); + implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); + break; + } case 1: - { - logger?.LogInformation("Found matching implementation. Loading it."); + { + logger?.LogInformation("Found matching implementation. Loading it."); - var (implementation, version) = implementationsForGameVersion[0]; - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } + var (implementation, version) = implementationsForGameVersion[0]; + logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); + implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); + break; + } case 0: - { - logger?.LogInformation("Found no matching implementations. Loading the latest available."); + { + logger?.LogInformation("Found no matching implementations. Loading the latest available."); - var (implementation, version) = ImplementationLatest(implementationsWithVersions); - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } + var (implementation, version) = ImplementationLatest(implementationsWithVersions); + logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); + implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); + break; + } } var subModules = implementationAssemblies.SelectMany(a => @@ -171,8 +170,8 @@ private static IEnumerable LoadAllImplementations(ILogger? logg var ctorHandle = attr.Constructor; if (ctorHandle.Kind != HandleKind.MemberReference) continue; - var container = mdReader.GetMemberReference((MemberReferenceHandle)ctorHandle).Parent; - var name = mdReader.GetTypeReference((TypeReferenceHandle)container).Name; + var container = mdReader.GetMemberReference((MemberReferenceHandle) ctorHandle).Parent; + var name = mdReader.GetTypeReference((TypeReferenceHandle) container).Name; if (!string.Equals(mdReader.GetString(name), "AssemblyMetadataAttribute")) continue; var attributeReader = mdReader.GetBlobReader(attr.Value); diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs index db31d4d3..feac9dfc 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs @@ -1,4 +1,5 @@ using JetBrains.Annotations; + using TaleWorlds.GauntletUI; namespace Diplomacy.Widgets @@ -33,4 +34,4 @@ public bool IsCritical } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs index b4f52559..21507d9b 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs @@ -1,4 +1,5 @@ using JetBrains.Annotations; + using TaleWorlds.GauntletUI; namespace Diplomacy.Widgets diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs index b673fdd0..010b098f 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs @@ -1,4 +1,5 @@ using JetBrains.Annotations; + using TaleWorlds.GauntletUI; namespace Diplomacy.Widgets @@ -78,4 +79,4 @@ public Widget StatsPanel } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs index 022a1d08..a07dd990 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/AllianceBehavior.cs @@ -135,4 +135,4 @@ private static void BreakAllAlliances(Clan clan) BreakAllianceAction.Apply(kingdom, alliedKingdom); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs index bc61b87b..b9d904c2 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/CivilWarBehavior.cs @@ -1,13 +1,15 @@  -using System; -using System.Collections.Generic; -using System.Linq; using Diplomacy.CivilWar; using Diplomacy.CivilWar.Actions; using Diplomacy.CivilWar.Factions; using Diplomacy.CivilWar.Scoring; using Diplomacy.DiplomaticAction.WarPeace; using Diplomacy.Extensions; + +using System; +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Election; using TaleWorlds.Core; @@ -216,4 +218,4 @@ public override void SyncData(IDataStore dataStore) } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs index 05b8037f..da0c22ac 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/CooldownBehavior.cs @@ -3,7 +3,9 @@ using Diplomacy.DiplomaticAction.NonAggressionPact; using Diplomacy.Event; using Diplomacy.Extensions; + using Microsoft.Extensions.Logging; + using TaleWorlds.CampaignSystem; namespace Diplomacy.CampaignBehaviors @@ -55,7 +57,7 @@ private void RegisterPeaceProposalCooldown(Kingdom kingdom) { LogFactory.Get() .LogTrace($"[{CampaignTime.Now}] {kingdom.Name} sent a peace proposal."); - + _cooldownManager.UpdateLastPeaceProposalTime(kingdom, CampaignTime.Now); } @@ -70,4 +72,4 @@ public override void SyncData(IDataStore dataStore) } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs index d0c64d1e..45ef5b67 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs @@ -86,4 +86,4 @@ public override void SyncData(IDataStore dataStore) } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs index e2a899d9..da554fff 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs @@ -47,4 +47,4 @@ private void OnSettlementOwnerChanged(Settlement settlement, } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs index 94a412f8..ffea4d70 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs @@ -58,4 +58,4 @@ private TextObject GetKeepFiefText(Settlement settlement) return txt; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs index c9969eca..b7cb02ca 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs @@ -1,6 +1,8 @@ using Diplomacy.Extensions; + using System; using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Barterables; @@ -45,7 +47,7 @@ private void ReduceCorruption(Clan clan) if (settlementToTrade is null) return default; - var targetClan = ((Kingdom)ownerClan.MapFaction).Clans + var targetClan = ((Kingdom) ownerClan.MapFaction).Clans .Where(c => c != ownerClan && !c.HasMaximumFiefs() && !c.IsUnderMercenaryService && c != Clan.PlayerClan) .OrderByDescending(c => GetGoldValueForFief(c, settlementToTrade)) .FirstOrDefault(); @@ -60,8 +62,8 @@ private void ReduceCorruption(Clan clan) private static int GetGoldValueForFief(Clan buyerClan, Settlement settlement) { - return (int)Math.Min(Campaign.Current.Models.SettlementValueModel.CalculateValueForFaction(settlement, buyerClan), + return (int) Math.Min(Campaign.Current.Models.SettlementValueModel.CalculateValueForFaction(settlement, buyerClan), buyerClan.Gold * 0.8); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs index 5015e671..55386d6f 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs @@ -44,4 +44,4 @@ public void OnAfterSessionLaunched(CampaignGameStarter game) CampaignEvents.TickEvent.AddNonSerializedListener(_messengerManager, _messengerManager.CleanUpAfterLoad); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs index f8201fd7..de499d74 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs @@ -1,5 +1,7 @@ using Diplomacy.Views; + using SandBox.View.Map; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; @@ -18,7 +20,7 @@ private void AddUIElements(float obj) if (!Settings.Instance!.EnableWarExhaustion) { CampaignEvents.TickEvent.ClearListeners(this); - } + } else if (Game.Current.GameStateManager.ActiveState is MapState) { MapScreen.Instance.AddMapView(); @@ -30,4 +32,4 @@ public override void SyncData(IDataStore dataStore) { } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs index 516ff61e..ab5f3c31 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs @@ -151,7 +151,7 @@ private bool IsValidQuestState(Kingdom kingdom1, Kingdom kingdom2) if (currentStoryMode == null) { return true; - } + } var isValidQuestState = true; var opposingKingdom = PlayerHelpers.GetOpposingKingdomIfPlayerKingdomProvided(kingdom1, kingdom2); @@ -165,4 +165,4 @@ private bool IsValidQuestState(Kingdom kingdom1, Kingdom kingdom2) return isValidQuestState; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs index 630269e9..135c9202 100644 --- a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs +++ b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs @@ -1,4 +1,5 @@ using System; + using TaleWorlds.CampaignSystem; namespace Diplomacy.Character @@ -19,10 +20,10 @@ public void Apply() PlayerCharacterTraitHelper.UpdateTrait(this); } - private static readonly Func Create = (a,b) => new PlayerCharacterTraitEventExperience(a, b); + private static readonly Func Create = (a, b) => new PlayerCharacterTraitEventExperience(a, b); public static readonly PlayerCharacterTraitEventExperience FiefGranted = Create(50, DefaultTraits.Generosity); public static readonly PlayerCharacterTraitEventExperience FiefClaimed = Create(-50, DefaultTraits.Generosity); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs index 81682831..71b65de9 100644 --- a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs +++ b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs @@ -1,11 +1,13 @@ using HarmonyLib; + using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.CharacterDevelopment.Managers; namespace Diplomacy.Character { - + internal class PlayerCharacterTraitHelper { private static readonly Action AddPlayerTraitXPAndLogEntry = @@ -21,4 +23,4 @@ public static void UpdateTrait(PlayerCharacterTraitEventExperience eventExperien UpdateTrait(eventExperience.Trait, eventExperience.Experience); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Cheats.cs b/src/Bannerlord.Diplomacy/Cheats.cs index 582b8501..e725ade6 100644 --- a/src/Bannerlord.Diplomacy/Cheats.cs +++ b/src/Bannerlord.Diplomacy/Cheats.cs @@ -1,8 +1,11 @@ -using System.Collections.Generic; -using Diplomacy.CivilWar.Actions; +using Diplomacy.CivilWar.Actions; using Diplomacy.DiplomaticAction.Alliance; using Diplomacy.Extensions; + using JetBrains.Annotations; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Library; @@ -93,7 +96,7 @@ private static string SetWarExhaustion(List strings) var current = WarExhaustionManager.Instance.GetWarExhaustion(kingdom1, kingdom2); var toAdd = (warExhaustion - current) / Settings.Instance!.WarExhaustionPerCasualty; - WarExhaustionManager.Instance.AddCasualtyWarExhaustion(kingdom1, kingdom2, (int)toAdd); + WarExhaustionManager.Instance.AddCasualtyWarExhaustion(kingdom1, kingdom2, (int) toAdd); return "done!"; } @@ -139,4 +142,4 @@ public static string ReloadUI(List strings) return "Reloaded"; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs index dc38d247..0c578348 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs @@ -1,11 +1,15 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using ColorMine.ColorSpaces; +using ColorMine.ColorSpaces; using ColorMine.ColorSpaces.Comparisons; + using Diplomacy.Event; using Diplomacy.Extensions; + using HarmonyLib; + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; @@ -89,7 +93,7 @@ public static void Apply(Kingdom kingdom, bool isRebelKingdom = false) else { // choose random unused color from the palette - List currentBackgroundColors = Kingdom.All.Where(x => !x.IsEliminated).Select(x => (uint)PrimaryBannerColorProp.GetValue(x)).ToList(); + List currentBackgroundColors = Kingdom.All.Where(x => !x.IsEliminated).Select(x => (uint) PrimaryBannerColorProp.GetValue(x)).ToList(); backgroundColor = BannerManager.ColorPalette.Where(x => !currentBackgroundColors.Contains(x.Value.Color)).GetRandomElementInefficiently().Value.Color; sigilColor = GetUniqueSigilColor(backgroundColor); } @@ -105,7 +109,7 @@ private static uint GetUniqueSigilColor(uint backgroundColor) uint selectedColor = BannerManager.ColorPalette.Where(x => background.Compare(GetRgb(x.Value.Color), new Cie1976Comparison()) > 40).GetRandomElementInefficiently().Value.Color; if (backgroundColor == RebelBackgroundColor) { - List currentSigilColors = Kingdom.All.Where(x => !x.IsEliminated && x.IsRebelKingdom()).Select(x => (uint)SecondaryBannerColorProp.GetValue(x)).ToList(); + List currentSigilColors = Kingdom.All.Where(x => !x.IsEliminated && x.IsRebelKingdom()).Select(x => (uint) SecondaryBannerColorProp.GetValue(x)).ToList(); var colors = BannerManager.ColorPalette.Select(x => x.Value.Color) .Where(x => background.Compare(GetRgb(x), new Cie1976Comparison()) > 40) .Where(x => !currentSigilColors.Contains(x)) @@ -128,4 +132,4 @@ private static Rgb GetRgb(uint color) return rgb; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs index 7ff6f24a..faea2b41 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; @@ -47,4 +49,4 @@ public static void Apply(RebelFaction rebelFaction) } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs index 8c4ac625..8c1264f9 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/CreateFactionAction.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System.Linq; - -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; using Diplomacy.CivilWar.Scoring; using Diplomacy.Costs; using Diplomacy.Extensions; +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; @@ -74,7 +74,7 @@ public static IEnumerable CanApply(Clan clan, RebelDemandType? deman { yield return new TextObject("{=luvsD6Zn}Cannot create a faction in a rebel kingdom."); } - + // ruling clan can't create factions if (clan == clan.Kingdom!.RulingClan) { @@ -137,4 +137,4 @@ public static IEnumerable CanApply(Clan clan, RebelDemandType? deman } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs index d5590c3e..3e19ffb3 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/JoinFactionAction.cs @@ -1,8 +1,10 @@ -using System.Collections.Generic; -using System.Linq; -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; using Diplomacy.CivilWar.Scoring; using Diplomacy.Extensions; + +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -10,12 +12,12 @@ namespace Diplomacy.CivilWar.Actions { public class JoinFactionAction { - public static void Apply(Clan clan, RebelFaction rebelFaction) + public static void Apply(Clan clan, RebelFaction rebelFaction) { rebelFaction.AddClan(clan); } - public static bool ShouldApply(Clan clan, RebelFaction rebelFaction) + public static bool ShouldApply(Clan clan, RebelFaction rebelFaction) { if (!CanApply(clan, rebelFaction, out _)) return false; @@ -92,4 +94,4 @@ public static IEnumerable CanApply(Clan clan, RebelFaction rebelFact } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs index 5e9a8274..59867774 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/LeaveFactionAction.cs @@ -1,4 +1,5 @@ using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; namespace Diplomacy.CivilWar.Actions @@ -10,4 +11,4 @@ public static void Apply(Clan clan, RebelFaction rebelFaction) rebelFaction.RemoveClan(clan); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs index 39263139..dc2c57ec 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/StartRebellionAction.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using System.Linq; +using Diplomacy.CivilWar.Factions; -using Diplomacy.CivilWar.Factions; +using System.Collections.Generic; +using System.Linq; using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; diff --git a/src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs b/src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs index 71574736..912ee85c 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/FactionNameGenerator.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using Diplomacy.CivilWar.Factions; + +using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Localization; @@ -12,31 +14,46 @@ internal class FactionNameGenerator private static Dictionary> CultureToKingdomTitles { get; } = new() { // {"empire", new() { } }, - {"aserai", new() { - new("{=iLMqCvmk}Sultanate of {CLAN_NAME}"), - new("{=EnpnMNRH}Emirate of {CLAN_NAME}"), - new("{=uzd9mxIC}Banu {CLAN_NAME}"), - new("{=NTFz3B56}Sharifate of {CLAN_NAME}") - } }, - {"battania", new() + "aserai", + new() + { + new("{=iLMqCvmk}Sultanate of {CLAN_NAME}"), + new("{=EnpnMNRH}Emirate of {CLAN_NAME}"), + new("{=uzd9mxIC}Banu {CLAN_NAME}"), + new("{=NTFz3B56}Sharifate of {CLAN_NAME}") + } + }, { - new(StringConstants.FactionConfederation), - } }, - {"khuzait", new() + "battania", + new() + { + new(StringConstants.FactionConfederation), + } + }, { - new("{=mEHufuep}Khaganate of {CLAN_NAME}", 0.5f), - new("{=DTBaowBi}{CLAN_NAME} Khaganate", 0.5f), - new("{=pRgQF4WY}{CLAN_NAME} Dynasty") - } }, - {"sturgia", new() + "khuzait", + new() + { + new("{=mEHufuep}Khaganate of {CLAN_NAME}", 0.5f), + new("{=DTBaowBi}{CLAN_NAME} Khaganate", 0.5f), + new("{=pRgQF4WY}{CLAN_NAME} Dynasty") + } + }, { - new("{=z5VPFrfh}Earldom of {CLAN_NAME}") - } }, - {"vlandia", new() + "sturgia", + new() + { + new("{=z5VPFrfh}Earldom of {CLAN_NAME}") + } + }, { - new("{=A4zT7H5g}Grand Duchy of {CLAN_NAME}") - } }, + "vlandia", + new() + { + new("{=A4zT7H5g}Grand Duchy of {CLAN_NAME}") + } + }, }; private static readonly List CommonKingdomTitles = new() diff --git a/src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs index 334d1aed..7dd0b86b 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Factions/AbdicationFaction.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Diplomacy.CivilWar.Actions; -using Diplomacy.CivilWar.Actions; +using System.Collections.Generic; using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Election; @@ -55,7 +55,7 @@ public void DestroyFactionBecauseDemandSatisfied() { RebelFactionManager.DestroyRebelFaction(this); - var strVars = new Dictionary { { "PARENT_KINGDOM", this.ParentKingdom.Name }, { "REBELS", this.Name }}; + var strVars = new Dictionary { { "PARENT_KINGDOM", this.ParentKingdom.Name }, { "REBELS", this.Name } }; InformationManager.ShowInquiry( new InquiryData( _TAbdicateTitle.ToString(), @@ -68,4 +68,4 @@ public void DestroyFactionBecauseDemandSatisfied() null), true); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs index 658e5e76..6e0e0248 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs @@ -1,8 +1,11 @@ -using System; +using Diplomacy.CivilWar.Actions; + +using JetBrains.Annotations; + +using System; using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Actions; -using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; using TaleWorlds.Core; @@ -169,18 +172,18 @@ private void ApplyInfluenceAndReputationChanges(bool success) private void ApplyReputationChanges() { var loyalistCombinations = from clan in ParentKingdom.Clans - from otherClan in ParentKingdom.Clans - where clan.Id < otherClan.Id - select Tuple.Create(clan, otherClan); + from otherClan in ParentKingdom.Clans + where clan.Id < otherClan.Id + select Tuple.Create(clan, otherClan); var rebelCombinations = from clan in Clans - from otherClan in Clans - where clan.Id < otherClan.Id - select Tuple.Create(clan, otherClan); + from otherClan in Clans + where clan.Id < otherClan.Id + select Tuple.Create(clan, otherClan); var opposingCombinations = from clan in ParentKingdom.Clans - from otherClan in Clans - select Tuple.Create(clan, otherClan); + from otherClan in Clans + select Tuple.Create(clan, otherClan); foreach (Tuple tuple in loyalistCombinations) ChangeRelationAction.ApplyRelationChangeBetweenHeroes(tuple.Item1.Leader, tuple.Item2.Leader, diff --git a/src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs index 44f309af..70e1abad 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Factions/SecessionFaction.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using Diplomacy.CivilWar.Actions; -using Diplomacy.CivilWar.Actions; +using System.Collections.Generic; using TaleWorlds.CampaignSystem; using TaleWorlds.Core; @@ -51,4 +51,4 @@ protected override void ApplyDemand() null), true); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs b/src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs index 6d9c6ff8..4c263a70 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/RebelFactionManager.cs @@ -1,7 +1,10 @@ -using System.Collections.Generic; -using System.Linq; -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; + using JetBrains.Annotations; + +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.SaveSystem; @@ -11,11 +14,14 @@ internal sealed class RebelFactionManager { public static RebelFactionManager? Instance { get; private set; } - [SaveableProperty(1)] [UsedImplicitly] + [SaveableProperty(1)] + [UsedImplicitly] public Dictionary> RebelFactions { get; private set; } - [SaveableProperty(2)] [UsedImplicitly] + [SaveableProperty(2)] + [UsedImplicitly] public List DeadRebelKingdoms { get; private set; } - [SaveableProperty(3)] [UsedImplicitly] + [SaveableProperty(3)] + [UsedImplicitly] public Dictionary LastCivilWar { get; private set; } public RebelFactionManager() diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs index 065e666a..86a9c45d 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs @@ -1,7 +1,9 @@ -using System; +using Diplomacy.CivilWar.Factions; + +using System; using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -18,7 +20,7 @@ protected override List GetPossibleFactions(Clan clan) protected override IEnumerable> GetMemberScore(Clan clan, RebelFaction rebelFaction) { - List> memberScores = new() {CalculateFiefDeficitScore(clan)}; + List> memberScores = new() { CalculateFiefDeficitScore(clan) }; memberScores.AddRange(CalculateTraitScore(clan, rebelFaction, rebelFaction.ParentKingdom.Leader, DefaultTraits.Honor)); memberScores.AddRange(CalculateTraitScore(clan, rebelFaction, rebelFaction.ParentKingdom.Leader, DefaultTraits.Valor)); diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs index da2d8734..b3ce8ffa 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs @@ -1,7 +1,9 @@ -using System; +using Diplomacy.CivilWar.Factions; + +using System; using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; @@ -116,4 +118,4 @@ protected virtual IEnumerable> GetRelationshipScores(Cl protected abstract Tuple GetRelationshipScoreWithTarget(Clan clan, RebelFaction rebelFaction); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs index 8124cd89..fb16fe7e 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs @@ -1,6 +1,8 @@ -using System; +using Diplomacy.CivilWar.Factions; + +using System; using System.Collections.Generic; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs index 9e2020e9..e6d6a9d3 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/RebelFactionScoringModel.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; namespace Diplomacy.CivilWar.Scoring @@ -32,4 +34,4 @@ public static ExplainedNumber GetDemandScore(Clan clan, RebelFaction rebelFactio return DemandScoreCalculators[rebelFaction.RebelDemandType].GetScore(clan, rebelFaction); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs index 3acef2cd..2166db56 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs @@ -1,7 +1,9 @@ -using System; +using Diplomacy.CivilWar.Factions; + +using System; using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -23,7 +25,7 @@ protected override List GetPossibleFactions(Clan clan) protected override IEnumerable> GetMemberScore(Clan clan, RebelFaction rebelFaction) { - List> memberScores = new() {CalculateFiefDeficitScore(clan)}; + List> memberScores = new() { CalculateFiefDeficitScore(clan) }; memberScores.AddRange(CalculateTraitScore(clan, rebelFaction, rebelFaction.ParentKingdom.Leader, DefaultTraits.Honor)); memberScores.AddRange(CalculateTraitScore(clan, rebelFaction, rebelFaction.ParentKingdom.Leader, DefaultTraits.Valor)); @@ -38,7 +40,7 @@ protected override IEnumerable> GetMemberScore(Clan cla protected override IEnumerable> GetLeaderOnlyScore(Clan clan, RebelFaction rebelFaction) { // ambition of faction sponsor - yield return new Tuple(_TCalculating ,clan.Leader.GetTraitLevel(DefaultTraits.Calculating) * 20); + yield return new Tuple(_TCalculating, clan.Leader.GetTraitLevel(DefaultTraits.Calculating) * 20); // must be clan tier 4+ if (clan.Tier < 4) @@ -82,4 +84,4 @@ public class SecessionScores : IFactionDemandScores public float KingdomSizeTownScore => 2; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Compat.cs b/src/Bannerlord.Diplomacy/Compat.cs index 2fc2c54f..f942f764 100644 --- a/src/Bannerlord.Diplomacy/Compat.cs +++ b/src/Bannerlord.Diplomacy/Compat.cs @@ -12,4 +12,4 @@ public static TaleWorlds.Core.ViewModelCollection.HintViewModel Create(TextObjec } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CooldownManager.cs b/src/Bannerlord.Diplomacy/CooldownManager.cs index 90d09f2e..9dd47b80 100644 --- a/src/Bannerlord.Diplomacy/CooldownManager.cs +++ b/src/Bannerlord.Diplomacy/CooldownManager.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using JetBrains.Annotations; + +using System.Collections.Generic; using System.Linq; -using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.SaveSystem; @@ -14,13 +16,16 @@ internal sealed class CooldownManager internal static Dictionary LastPeaceProposalTime => Instance!._lastPeaceProposalTime; internal static Dictionary LastAllianceFormedTime => Instance!._lastAllianceFormedTime; - [SaveableField(1)] [UsedImplicitly] + [SaveableField(1)] + [UsedImplicitly] private Dictionary _lastWarTime; - [SaveableField(2)] [UsedImplicitly] + [SaveableField(2)] + [UsedImplicitly] private Dictionary _lastPeaceProposalTime; - [SaveableField(3)] [UsedImplicitly] + [SaveableField(3)] + [UsedImplicitly] private Dictionary _lastAllianceFormedTime; private static float MinimumDaysBetweenPeaceProposals => 5f; @@ -71,7 +76,7 @@ public static CampaignTime GetLastWarTimeBetweenFactions(IFaction faction1, IFac if (LastWarTime.TryGetValue(CreateKey(faction1, faction2), out var value)) { return value; - } + } else { return CampaignTime.Zero; @@ -128,4 +133,4 @@ internal void Sync() Instance = this; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs b/src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs index 45ee34bd..1a395dca 100644 --- a/src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs +++ b/src/Bannerlord.Diplomacy/Costs/DiplomacyCost.cs @@ -12,4 +12,4 @@ protected DiplomacyCost(float value) public abstract void ApplyCost(); public abstract bool CanPayCost(); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs b/src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs index b00529ed..272faa39 100644 --- a/src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs +++ b/src/Bannerlord.Diplomacy/Costs/DiplomacyCostCalculator.cs @@ -1,5 +1,6 @@ using System; using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.Library; @@ -18,7 +19,7 @@ public static DiplomacyCost DetermineCostForDeclaringWar(Kingdom kingdom, bool f if (!Settings.Instance!.ScalingInfluenceCosts) return new InfluenceCost(clanPayingInfluence, Settings.Instance!.DeclareWarInfluenceCost); - return new InfluenceCost(clanPayingInfluence, (float)Math.Floor(GetKingdomTierCount(kingdom) * Settings.Instance!.ScalingInfluenceCostMultiplier)); + return new InfluenceCost(clanPayingInfluence, (float) Math.Floor(GetKingdomTierCount(kingdom) * Settings.Instance!.ScalingInfluenceCostMultiplier)); } public static HybridCost DetermineCostForMakingPeace(Kingdom kingdom, Kingdom otherKingdom, bool forcePlayerCharacterCosts = false) @@ -50,7 +51,7 @@ private static InfluenceCost DetermineInfluenceCostForMakingPeace(Kingdom kingdo private static float GetKingdomScalingFactor(Kingdom kingdom) { - return (float)Math.Floor(GetKingdomTierCount(kingdom) * Settings.Instance!.ScalingInfluenceCostMultiplier); + return (float) Math.Floor(GetKingdomTierCount(kingdom) * Settings.Instance!.ScalingInfluenceCostMultiplier); } public static HybridCost DetermineCostForFormingNonAggressionPact(Kingdom kingdom, Kingdom otherKingdom, bool forcePlayerCharacterCosts = false) @@ -79,7 +80,7 @@ private static GoldCost DetermineGoldCostForFormingNonAggressionPact(Kingdom kin var baseGoldCost = 500; var goldCostFactor = 100; - var goldCost = (int)((MBMath.ClampFloat((1 / otherKingdomWarLoad), 0f, 1f) * GetKingdomScalingFactor(kingdom) * goldCostFactor) + baseGoldCost); + var goldCost = (int) ((MBMath.ClampFloat((1 / otherKingdomWarLoad), 0f, 1f) * GetKingdomScalingFactor(kingdom) * goldCostFactor) + baseGoldCost); return new GoldCost(giver, otherKingdom.Leader, goldCost); } @@ -113,7 +114,7 @@ private static GoldCost DetermineGoldCostForMakingPeace(Kingdom kingdomMakingPea var relativeWarExhaustion = (kingdomMakingPeaceWarExhaustion + 1f) / (otherKingdomWarExhaustion + 1f) - 1f; warExhaustionMultiplier = MBMath.ClampFloat(relativeWarExhaustion, 0, ((1f / 20f) * kingdomMakingPeaceWarExhaustion) - 1f); } - goldCost = Math.Min((int)(GetKingdomScalingFactor(kingdomMakingPeace) * warExhaustionMultiplier), kingdomMakingPeace.Leader.Gold / 2); + goldCost = Math.Min((int) (GetKingdomScalingFactor(kingdomMakingPeace) * warExhaustionMultiplier), kingdomMakingPeace.Leader.Gold / 2); } return new GoldCost(giver, otherKingdom.Leader, goldCost); @@ -155,9 +156,9 @@ private static GoldCost DetermineGoldCostForFormingAlliance(Kingdom kingdom, Kin var baseGoldCost = 500; var goldCostFactor = 100; - var goldCost = (int)((MBMath.ClampFloat((1 / otherKingdomWarLoad), 0f, 1f) * GetKingdomScalingFactor(kingdom) * AllianceFactor * goldCostFactor) + baseGoldCost); + var goldCost = (int) ((MBMath.ClampFloat((1 / otherKingdomWarLoad), 0f, 1f) * GetKingdomScalingFactor(kingdom) * AllianceFactor * goldCostFactor) + baseGoldCost); return new GoldCost(giver, otherKingdom.Leader, goldCost); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Costs/GoldCost.cs b/src/Bannerlord.Diplomacy/Costs/GoldCost.cs index fe3685e3..e16aa971 100644 --- a/src/Bannerlord.Diplomacy/Costs/GoldCost.cs +++ b/src/Bannerlord.Diplomacy/Costs/GoldCost.cs @@ -18,18 +18,18 @@ public override void ApplyCost() { if (_receiver is not null) { - GiveGoldAction.ApplyBetweenCharacters(_giver, _receiver, (int)Value); + GiveGoldAction.ApplyBetweenCharacters(_giver, _receiver, (int) Value); } else { - _giver.ChangeHeroGold(-(int)Value); + _giver.ChangeHeroGold(-(int) Value); } } public override bool CanPayCost() { - return _giver.Gold >= (int)Value; + return _giver.Gold >= (int) Value; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Costs/HybridCost.cs b/src/Bannerlord.Diplomacy/Costs/HybridCost.cs index 188bc296..d3505b22 100644 --- a/src/Bannerlord.Diplomacy/Costs/HybridCost.cs +++ b/src/Bannerlord.Diplomacy/Costs/HybridCost.cs @@ -27,4 +27,4 @@ public override bool CanPayCost() return _diplomacyCosts.All(x => x.CanPayCost()); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs b/src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs index aed76a68..6d60fbc1 100644 --- a/src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs +++ b/src/Bannerlord.Diplomacy/Costs/InfluenceCost.cs @@ -22,4 +22,4 @@ public override bool CanPayCost() return _clan.Influence >= Value; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs b/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs index 1c0910a4..735d17d8 100644 --- a/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs +++ b/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs @@ -3,8 +3,10 @@ using Diplomacy.DiplomaticAction; using Diplomacy.Messengers; -using System.Collections.Generic; using JetBrains.Annotations; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.SaveSystem; @@ -51,4 +53,4 @@ protected override void DefineContainerDefinitions() ConstructContainerDefinition(typeof(Dictionary)); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs index 73f86dd0..0344d64e 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractConditionEvaluator.cs @@ -38,11 +38,11 @@ public List CanApplyExceptions(KingdomDiplomacyItemVM item, return Conditions .Select(c => { - c.ApplyCondition((Kingdom)item.Faction1, (Kingdom)item.Faction2, out var txt, forcePlayerCosts, bypassCosts); + c.ApplyCondition((Kingdom) item.Faction1, (Kingdom) item.Faction2, out var txt, forcePlayerCosts, bypassCosts); return txt; }) .OfType() .ToList(); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs index 3caefebe..6be294b5 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractCostCondition.cs @@ -22,4 +22,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject protected abstract bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKingdom, ref TextObject? textObject, bool forcePlayerCharacterCosts = false); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs index 24f56a5e..9bb64d5c 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractDiplomaticAction.cs @@ -1,5 +1,6 @@  using System; + using TaleWorlds.CampaignSystem; namespace Diplomacy.DiplomaticAction @@ -43,4 +44,4 @@ protected void ApplyInternalWithCosts(Kingdom proposingKingdom, Kingdom otherKin } protected abstract void AssessCosts(Kingdom proposingKingdom, Kingdom otherKingdom, bool forcePlayerCharacterCosts); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs index 6df6023e..3fb76499 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/AbstractScoringModel.cs @@ -85,7 +85,7 @@ public virtual ExplainedNumber GetScore(Kingdom ourKingdom, Kingdom otherKingdom // Relationship - var relationMult = MBMath.ClampFloat((float)Math.Log((ourKingdom.Leader.GetRelation(otherKingdom.Leader) + 100f) / 100f, 1.5), + var relationMult = MBMath.ClampFloat((float) Math.Log((ourKingdom.Leader.GetRelation(otherKingdom.Leader) + 100f) / 100f, 1.5), -1f, +1f); @@ -98,7 +98,7 @@ public virtual ExplainedNumber GetScore(Kingdom ourKingdom, Kingdom otherKingdom explainedNum.Add(expansionismPenalty, _TExpansionism); // Tendency - explainedNum.Add(Scores.Tendency, _TTendency); + explainedNum.Add(Scores.Tendency, _TTendency); return explainedNum; } diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs index 2e4fc507..be096d2a 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceEvent.cs @@ -13,4 +13,4 @@ public AllianceEvent(Kingdom kingdom, Kingdom otherKingdom) public Kingdom Kingdom { get; } public Kingdom OtherKingdom { get; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs index d7bf2b87..2ff15609 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/AllianceScoringModel.cs @@ -24,4 +24,4 @@ public class AllianceScores : IDiplomacyScores public int NonAggressionPactWithNeutral => -10; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs index e7b60fc5..d735a42c 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceAction.cs @@ -46,4 +46,4 @@ protected override void ShowPlayerInquiry(Kingdom proposingKingdom, Action accep null), true); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs index f9875b1b..a22aeb5e 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/Alliance/BreakAllianceConditions.cs @@ -1,4 +1,5 @@ using Diplomacy.DiplomaticAction.Alliance.Conditions; + using System.Collections.Generic; namespace Diplomacy.DiplomaticAction.Alliance @@ -11,4 +12,4 @@ class BreakAllianceConditions : AbstractConditionEvaluator> _agreements; public DiplomaticAgreementManager() @@ -53,4 +56,4 @@ public void Sync() Instance = this; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs index c01eb610..faacedb5 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/AtPeaceCondition.cs @@ -16,4 +16,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject return !atWar; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs index 2fb70635..97fcf20b 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/HasAuthorityCondition.cs @@ -24,4 +24,4 @@ public bool ApplyCondition(Kingdom kingdom, return authority; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs index 4ab865aa..7aa5f550 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotInAllianceCondition.cs @@ -17,8 +17,8 @@ public bool ApplyCondition(Kingdom kingdom, if (alreadyInAlliance) textObject = new TextObject(StringConstants.InAlliance); - + return !alreadyInAlliance; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs index 0d9b9952..aacbe9cc 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/GenericConditions/NotRebelKingdomCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Extensions; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs index 3fba3d63..8a36963c 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/FormNonAggressionPactAction.cs @@ -6,8 +6,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Core; -using TaleWorlds.Localization; using TaleWorlds.Library; +using TaleWorlds.Localization; namespace Diplomacy.DiplomaticAction.NonAggressionPact { @@ -53,4 +53,4 @@ protected override void ShowPlayerInquiry(Kingdom proposingKingdom, Action apply null), true); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs index f2a027c3..4b038081 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughGoldCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Costs; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -18,4 +19,4 @@ protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKin return hasEnoughGold; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs index 49c86d9c..b0892825 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughInfluenceCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Costs; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -21,4 +22,4 @@ protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKin return hasEnoughInfluence; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs index 4af1fb6a..c604be32 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/HasEnoughScoreCondition.cs @@ -18,4 +18,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject return !scoreTooLow; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs index 3b46daf5..2335f3c6 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NoNonAggressionPactCondition.cs @@ -19,4 +19,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject return !hasNonAggressionPact; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs index 2417a423..8ef4c8a9 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPact/NonAggressionPactConditions.cs @@ -1,4 +1,5 @@ using Diplomacy.DiplomaticAction.GenericConditions; + using System.Collections.Generic; namespace Diplomacy.DiplomaticAction.NonAggressionPact @@ -18,4 +19,4 @@ internal class NonAggressionPactConditions : AbstractConditionEvaluator -10; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs index ea50cf42..1c2ad0a3 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/NonAggressionPactAgreement.cs @@ -36,4 +36,4 @@ public override void NotifyExpired() InformationManager.DisplayMessage(new InformationMessage(txtRendered)); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs index 67b27690..9591e257 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughGoldForPeaceCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Costs; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -18,4 +19,4 @@ protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKin return hasEnoughGold; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs index cbabd751..a95dd351 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForPeaceCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Costs; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -18,4 +19,4 @@ protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKin return hasEnoughInfluence; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs index d32cc8dd..b16b40eb 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughInfluenceForWarCondition.cs @@ -1,4 +1,5 @@ using Diplomacy.Costs; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -18,4 +19,4 @@ protected override bool ApplyConditionInternal(Kingdom kingdom, Kingdom otherKin return hasEnoughInfluence; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs index 05e93a9e..dfd2045d 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/HasEnoughTimeElapsedForPeaceCondition.cs @@ -1,4 +1,5 @@ using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.Localization; @@ -15,10 +16,10 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject if (!hasEnoughTimeElapsed) { textObject = _TTooSoon.CopyTextObject(); - textObject.SetTextVariable("ELAPSED_DAYS", (float)Math.Floor(elapsedDaysUntilNow)); + textObject.SetTextVariable("ELAPSED_DAYS", (float) Math.Floor(elapsedDaysUntilNow)); textObject.SetTextVariable("REQUIRED_DAYS", Settings.Instance!.MinimumWarDurationInDays); } return hasEnoughTimeElapsed; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs index 1fe48419..04c39c36 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs @@ -26,4 +26,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject return true; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs index 55008613..8107dfc9 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs @@ -29,4 +29,4 @@ public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject return isValidQuestState; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs index 1712321f..9cbe7a15 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/DeclareWarConditions.cs @@ -19,4 +19,4 @@ internal sealed class DeclareWarConditions : AbstractConditionEvaluator { AcceptPeace(kingdom, faction, diplomacyCost); @@ -87,7 +87,7 @@ public static void ApplyPeace(Kingdom kingdomMakingPeace, Kingdom otherKingdom, false, GameTexts.FindText("str_ok").ToString(), null, - () => KingdomPeaceAction.ApplyPeace(kingdomMakingPeace, otherKingdom, skipPlayerPrompts:true), + () => KingdomPeaceAction.ApplyPeace(kingdomMakingPeace, otherKingdom, skipPlayerPrompts: true), null), true); } else @@ -113,4 +113,4 @@ public static void ApplyPeace(Kingdom kingdomMakingPeace, Kingdom otherKingdom, } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs index fbb679bc..f580742c 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/MakePeaceConditions.cs @@ -1,5 +1,6 @@ using Diplomacy.DiplomaticAction.GenericConditions; using Diplomacy.DiplomaticAction.WarPeace.Conditions; + using System.Collections.Generic; namespace Diplomacy.DiplomaticAction.WarPeace @@ -18,4 +19,4 @@ class MakePeaceConditions : AbstractConditionEvaluator public MakePeaceConditions() : base(Conditions) { } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs index 2272b68b..82c6a323 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/WarDeclaredEvent.cs @@ -5,7 +5,7 @@ namespace Diplomacy.DiplomaticAction.WarPeace internal sealed class WarDeclaredEvent { public IFaction Faction { get; } - + public IFaction ProvocatorFaction { get; } public bool IsProvoked { get; } @@ -17,4 +17,4 @@ public WarDeclaredEvent(IFaction faction, IFaction provocatorFaction, bool isPro IsProvoked = isProvoked; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Event/Events.cs b/src/Bannerlord.Diplomacy/Event/Events.cs index 5d70c027..10fc26cd 100644 --- a/src/Bannerlord.Diplomacy/Event/Events.cs +++ b/src/Bannerlord.Diplomacy/Event/Events.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; -using Diplomacy.DiplomaticAction.Alliance; +using Diplomacy.DiplomaticAction.Alliance; using Diplomacy.DiplomaticAction.WarPeace; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; namespace Diplomacy.Event diff --git a/src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs b/src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs index 64f4e7a3..ec20df8f 100644 --- a/src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs +++ b/src/Bannerlord.Diplomacy/Event/WarExhaustionEvent.cs @@ -17,4 +17,4 @@ public WarExhaustionEvent(Kingdom kingdom, Kingdom otherKingdom, WarExhaustionMa public WarExhaustionManager.WarExhaustionType WarExhaustionType { get; } public float WarExhaustionToAdd { get; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ExpansionismManager.cs b/src/Bannerlord.Diplomacy/ExpansionismManager.cs index 950c79aa..8eb98884 100644 --- a/src/Bannerlord.Diplomacy/ExpansionismManager.cs +++ b/src/Bannerlord.Diplomacy/ExpansionismManager.cs @@ -1,7 +1,10 @@ -using System; -using System.Collections.Generic; -using Diplomacy.Extensions; +using Diplomacy.Extensions; + using JetBrains.Annotations; + +using System; +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.SaveSystem; diff --git a/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs index 820281f2..14df5d5b 100644 --- a/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs +++ b/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs @@ -1,7 +1,9 @@ using Diplomacy.CivilWar; +using Diplomacy.CivilWar.Factions; + using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; namespace Diplomacy.Extensions @@ -37,7 +39,7 @@ public static IEnumerable GetRebelFactions(this Clan clan) yield break; } - foreach(RebelFaction faction in RebelFactionManager.GetRebelFaction(clan.Kingdom)) + foreach (RebelFaction faction in RebelFactionManager.GetRebelFaction(clan.Kingdom)) { if (faction.Clans.Contains(clan)) yield return faction; @@ -56,4 +58,4 @@ public static IEnumerable GetRebelFactions(this Clan clan) } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs index 832d0a6f..4ce890c8 100644 --- a/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs +++ b/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs @@ -1,4 +1,5 @@ using System; + using TaleWorlds.CampaignSystem; namespace Diplomacy.Extensions @@ -12,4 +13,4 @@ public static float GetNormalizedTraitValue(this Hero hero, TraitObject trait) return zeroMinTraitLevel / zeroMinMaxTraitLevel; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs index 3f17ee6f..b1aaa336 100644 --- a/src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs +++ b/src/Bannerlord.Diplomacy/Extensions/KingdomExtensions.cs @@ -1,8 +1,10 @@ using Diplomacy.CivilWar; +using Diplomacy.CivilWar.Factions; + using System; using System.Collections.Generic; using System.Linq; -using Diplomacy.CivilWar.Factions; + using TaleWorlds.CampaignSystem; namespace Diplomacy.Extensions @@ -101,4 +103,4 @@ public static IEnumerable GetRebelFactions(this Kingdom kingdom) return RebelFactionManager.GetRebelFaction(kingdom); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/FactionPair.cs b/src/Bannerlord.Diplomacy/FactionPair.cs index ffde7dff..c7a0945d 100644 --- a/src/Bannerlord.Diplomacy/FactionPair.cs +++ b/src/Bannerlord.Diplomacy/FactionPair.cs @@ -63,4 +63,4 @@ private static int CalculateHash(string s) public override int GetHashCode() => _hashCode; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/FieldAccessHelper.cs b/src/Bannerlord.Diplomacy/FieldAccessHelper.cs index 10b29e18..2059ba1d 100644 --- a/src/Bannerlord.Diplomacy/FieldAccessHelper.cs +++ b/src/Bannerlord.Diplomacy/FieldAccessHelper.cs @@ -9,4 +9,4 @@ public static class FieldAccessHelper public static readonly FieldRef PlayerEncounterAttackerPartyByRef = FieldRefAccess("_attackerParty"); public static readonly FieldRef PlayerEncounterDefenderPartyByRef = FieldRefAccess("_defenderParty"); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs index 9b2180e4..a6be63f5 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs @@ -1,5 +1,7 @@ using Diplomacy.ViewModel; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs index 04a955b4..9be1ad1c 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs @@ -1,4 +1,5 @@ using Diplomacy.ViewModel; + using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs index de58a045..26f4759c 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs @@ -1,5 +1,6 @@ using HarmonyLib; using HarmonyLib.BUTR.Extensions; + using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs index 8048f6d4..01633315 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs @@ -1,5 +1,7 @@ -using System; -using Diplomacy.ViewModel; +using Diplomacy.ViewModel; + +using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs index be15b1d0..b4df25e7 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs @@ -1,4 +1,5 @@ using Diplomacy.ViewModel; + using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Engine.Screens; diff --git a/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs b/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs index 42cefdd6..8cb66ecc 100644 --- a/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs +++ b/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs @@ -1,8 +1,10 @@ -using System; -using System.Linq; -using Diplomacy.Character; +using Diplomacy.Character; using Diplomacy.Event; using Diplomacy.Extensions; + +using System; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/IDiplomacyCondition.cs b/src/Bannerlord.Diplomacy/IDiplomacyCondition.cs index 99072ef7..9ff4d26b 100644 --- a/src/Bannerlord.Diplomacy/IDiplomacyCondition.cs +++ b/src/Bannerlord.Diplomacy/IDiplomacyCondition.cs @@ -7,4 +7,4 @@ interface IDiplomacyCondition { bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject? textObject, bool forcePlayerCharacterCosts = false, bool bypassCosts = false); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/LogFactory.cs b/src/Bannerlord.Diplomacy/LogFactory.cs index 70ab45c7..43398905 100644 --- a/src/Bannerlord.Diplomacy/LogFactory.cs +++ b/src/Bannerlord.Diplomacy/LogFactory.cs @@ -17,4 +17,4 @@ internal static ILogger Get() ?? NullLogger.Instance; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/MessageHelper.cs b/src/Bannerlord.Diplomacy/MessageHelper.cs index bd5c9aa3..15e38255 100644 --- a/src/Bannerlord.Diplomacy/MessageHelper.cs +++ b/src/Bannerlord.Diplomacy/MessageHelper.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; + using TaleWorlds.Core; using TaleWorlds.Localization; @@ -26,4 +27,4 @@ public static void SendFailedActionMessage(string action, List excep InformationManager.DisplayMessage(new InformationMessage(sb.ToString())); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Messengers/Messenger.cs b/src/Bannerlord.Diplomacy/Messengers/Messenger.cs index 45619ddf..10d62a90 100644 --- a/src/Bannerlord.Diplomacy/Messengers/Messenger.cs +++ b/src/Bannerlord.Diplomacy/Messengers/Messenger.cs @@ -1,4 +1,5 @@ using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.Library; using TaleWorlds.SaveSystem; diff --git a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs index 559aa5b9..3b3662ee 100644 --- a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs +++ b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs @@ -1,7 +1,10 @@ -using System.Collections.Generic; -using System.Linq; -using Diplomacy.Costs; +using Diplomacy.Costs; + using JetBrains.Annotations; + +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; using TaleWorlds.Core; @@ -16,7 +19,7 @@ internal sealed class MessengerManager : IMissionListener { private const float MessengerHourlySpeed = 20f; - private static readonly List AllowedMissionModes = new() {MissionMode.Conversation, MissionMode.Barter}; + private static readonly List AllowedMissionModes = new() { MissionMode.Conversation, MissionMode.Barter }; private static readonly TextObject _TMessengerSent = new("{=zv12jjyW}Messenger Sent"); @@ -152,7 +155,7 @@ private static bool IsPlayerHeroAvailable() { return PartyBase.MainParty is not null && PlayerEncounter.Current is null - && GameStateManager.Current.ActiveState is MapState {AtMenu: false}; + && GameStateManager.Current.ActiveState is MapState { AtMenu: false }; } internal void Sync() diff --git a/src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs b/src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs index 8d2b5330..b1899fda 100644 --- a/src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs +++ b/src/Bannerlord.Diplomacy/PatchTools/PatchClass.cs @@ -172,4 +172,4 @@ public Finalizer(string patchMethodName, string targetMethodName, int priority = : base(HarmonyPatchType.Finalizer, new(typeof(TPatch), patchMethodName), new Reflect.Method(typeof(TTarget), targetMethodName), priority) { } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs b/src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs index 3065605d..7e3d4e96 100644 --- a/src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs +++ b/src/Bannerlord.Diplomacy/PatchTools/PatchManager.cs @@ -40,7 +40,7 @@ private PatchManager(string harmonyId) { var log = LogFactory.Get(); log.LogDebug($"Applying unannotated Harmony patches (domain: {harmonyId})..."); - + Harmony = new(harmonyId); _patches = _PatchClasses.SelectMany(pc => pc.Patches).ToArray(); @@ -74,4 +74,4 @@ private PatchManager(string harmonyId) // ... Only 1 class left to convert to declarative patching. }; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/PatchTools/Priority.cs b/src/Bannerlord.Diplomacy/PatchTools/Priority.cs index 8fe18353..3add6c91 100644 --- a/src/Bannerlord.Diplomacy/PatchTools/Priority.cs +++ b/src/Bannerlord.Diplomacy/PatchTools/Priority.cs @@ -1,43 +1,43 @@ namespace Diplomacy.PatchTools { - /// A patch priority - /// - public static class Priority - { - /// Patch last (the lowest priority) - /// - public const int Last = 0; - - /// Patch with very low priority - /// - public const int VeryLow = 100; - - /// Patch with low priority - /// - public const int Low = 200; - - /// Patch with lower than normal priority - /// - public const int LowerThanNormal = 300; - - /// Patch with normal priority - /// - public const int Normal = 400; - - /// Patch with higher than normal priority - /// - public const int HigherThanNormal = 500; - - /// Patch with high priority - /// - public const int High = 600; - - /// Patch with very high priority - /// - public const int VeryHigh = 700; - - /// Patch first (the highest priority) - /// - public const int First = 800; - } -} + /// A patch priority + /// + public static class Priority + { + /// Patch last (the lowest priority) + /// + public const int Last = 0; + + /// Patch with very low priority + /// + public const int VeryLow = 100; + + /// Patch with low priority + /// + public const int Low = 200; + + /// Patch with lower than normal priority + /// + public const int LowerThanNormal = 300; + + /// Patch with normal priority + /// + public const int Normal = 400; + + /// Patch with higher than normal priority + /// + public const int HigherThanNormal = 500; + + /// Patch with high priority + /// + public const int High = 600; + + /// Patch with very high priority + /// + public const int VeryHigh = 700; + + /// Patch first (the highest priority) + /// + public const int First = 800; + } +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs b/src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs index 084bf313..4a71b62a 100644 --- a/src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DeclareWarActionPatch.cs @@ -30,5 +30,5 @@ private static void ApplyDeclareWarOverProvocationPostfix(IFaction faction, IFac => Events.Instance.OnWarDeclared(new WarDeclaredEvent(faction, provocatorFaction, true)); // FIXME: LO-PRIO: There are two other types of Apply* methods; they should probably also fire the event. - } -} + } +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs index b18a46a8..37c03c70 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs @@ -38,7 +38,7 @@ private static void CalculateInfluenceChangePostfix(Clan clan, ref ExplainedNumb if (Settings.Instance!.EnableInfluenceDecay && clan.Influence > Settings.Instance!.InfluenceDecayThreshold) { float decayFactor = Settings.Instance!.InfluenceDecayPercentage / 100f; - int decay = (int)(decayFactor * (clan.Influence - Settings.Instance!.InfluenceDecayThreshold)); + int decay = (int) (decayFactor * (clan.Influence - Settings.Instance!.InfluenceDecayThreshold)); if (decay > 0) __result.Add(-decay, _TInfluenceDecay); @@ -51,4 +51,4 @@ private static void CalculateInfluenceChangePostfix(Clan clan, ref ExplainedNumb private static readonly TextObject _TCorruption = new("{=dUCOV7km}Corruption: Too Many Fiefs"); private static readonly TextObject _TInfluenceDecay = new("{=koTNaZUX}Decay of High Influence"); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs index 8231d878..0396323e 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs @@ -38,12 +38,12 @@ private static IEnumerable PassThroughPostfix(IEnumerable< }; // ReSharper disable once RedundantAssignment - private static void ApplyPostfix(ref IEnumerable __result, ref IEnumerable ____items) + private static void ApplyPostfix(ref IEnumerable __result, ref IEnumerable ____items) { var listItems = ____items.ToList(); foreach (var item in listItems.ToList()) { - var kingdom = (Kingdom)item.Object; + var kingdom = (Kingdom) item.Object; if (kingdom.IsRebelKingdom() && kingdom.IsEliminated) { listItems.Remove(item); @@ -54,4 +54,4 @@ private static void ApplyPostfix(ref IEnumerable __result } #endif } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs index 8a31b956..0ae81069 100644 --- a/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs @@ -42,4 +42,4 @@ private static bool ConsiderWarPrefix(Clan clan, IFaction otherMapFaction) return true; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs b/src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs index c7ad78e3..4b60f3d2 100644 --- a/src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/EncyclopediaDataPatch.cs @@ -1,5 +1,5 @@ -using Diplomacy.ViewModel; -using Diplomacy.PatchTools; +using Diplomacy.PatchTools; +using Diplomacy.ViewModel; using HarmonyLib; @@ -20,7 +20,7 @@ internal sealed class EncyclopediaDataPatch : PatchClass SetStance = new Reflect.Method("SetStance").GetDelegate>(); + private static readonly Func SetStance = new Reflect.Method("SetStance").GetDelegate>(); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs b/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs index 6766e7d1..7cfa3ddd 100644 --- a/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs @@ -20,4 +20,4 @@ protected override IEnumerable Prepare() private static void menu_settlement_taken_on_init_Postfix() => Events.Instance.OnPlayerSettlementTaken(Settlement.CurrentSettlement); } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs b/src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs index ac397cdb..426f23cb 100644 --- a/src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/GiveGoldToClanActionPatch.cs @@ -26,4 +26,4 @@ private static bool ApplyFromHeroToClanReplaced(Hero giverHero, Clan clan, int a return false; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs index 31a0d4c1..31514adc 100644 --- a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs @@ -54,4 +54,4 @@ private static bool ConsiderPeacePrefix(Clan clan, Clan otherClan, Kingdom kingd return true; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs index 06297c5a..7c00f40f 100644 --- a/src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/KingdomManagementVMPatch.cs @@ -21,4 +21,4 @@ private static void FinalizeFix(KingdomManagementVM __instance) __instance.Diplomacy.OnFinalize(); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs index eb2c2e40..412a7a81 100644 --- a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs +++ b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs @@ -103,4 +103,4 @@ private static void HandleThroneAbdication(Kingdom kingdom) } #endif } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs b/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs index 6ec7e2da..95c94a39 100644 --- a/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs @@ -1,11 +1,11 @@ using Diplomacy.PatchTools; +using StoryMode.Behaviors.Quests; + using System; using System.Collections.Generic; using System.Reflection; -using StoryMode.Behaviors.Quests; - using TaleWorlds.CampaignSystem; namespace Diplomacy.Patches @@ -29,10 +29,10 @@ internal sealed class SupportKingdomQuestPatch : PatchClass ActivateCharacter = (hero, __instance) => { hero.ChangeState(Hero.CharacterStates.Active); - var companionsList = (List)CompanionsFieldInfo.GetValue(__instance); + var companionsList = (List) CompanionsFieldInfo.GetValue(__instance); companionsList.Remove(hero); }; @@ -32,7 +32,7 @@ public static void RegisterEventsPatch(UrbanCharactersCampaignBehavior __instanc CampaignEvents.NewCompanionAdded.AddNonSerializedListener(__instance, hero => ActivateCharacter(hero, __instance)); } -// It Seems they changed this to "DailyTickHero" in 1.5.0 + // It Seems they changed this to "DailyTickHero" in 1.5.0 //[HarmonyPostfix, HarmonyPatch("DailyTick")] [HarmonyPostfix, HarmonyPatch("DailyTickHero")] [UsedImplicitly] @@ -41,4 +41,4 @@ public static void HourlyTickPatch(UrbanCharactersCampaignBehavior __instance) Hero.MainHero.CompanionsInParty.Where(companion => companion.HeroState == Hero.CharacterStates.NotSpawned).Do(hero => ActivateCharacter(hero, __instance)); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/PlayerHelpers.cs b/src/Bannerlord.Diplomacy/PlayerHelpers.cs index 0afd1922..569d5e00 100644 --- a/src/Bannerlord.Diplomacy/PlayerHelpers.cs +++ b/src/Bannerlord.Diplomacy/PlayerHelpers.cs @@ -11,4 +11,4 @@ internal sealed class PlayerHelpers : default; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Reflect.cs b/src/Bannerlord.Diplomacy/Reflect.cs index afadcf15..4b67e739 100644 --- a/src/Bannerlord.Diplomacy/Reflect.cs +++ b/src/Bannerlord.Diplomacy/Reflect.cs @@ -1,9 +1,9 @@ -using System; +using HarmonyLib; + +using System; using System.Linq; using System.Reflection; -using HarmonyLib; - namespace Diplomacy { internal static class Reflect @@ -11,16 +11,16 @@ internal static class Reflect public class Method { public Type RequestedType { get; init; } - + public string Name { get; init; } - + public Type[]? Parameters { get; init; } - + public Type[]? Generics { get; init; } public MethodInfo MethodInfo { get; init; } - public Type Type => MethodInfo is {DeclaringType: { } dt} ? dt : RequestedType; + public Type Type => MethodInfo is { DeclaringType: { } dt } ? dt : RequestedType; protected virtual string MethodType => "method"; @@ -135,4 +135,4 @@ public sealed class DeclaredSetter : DeclaredSetter public DeclaredSetter(string name) : base(typeof(T), name) { } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Settings.cs b/src/Bannerlord.Diplomacy/Settings.cs index 3d69da81..2f362737 100644 --- a/src/Bannerlord.Diplomacy/Settings.cs +++ b/src/Bannerlord.Diplomacy/Settings.cs @@ -116,7 +116,7 @@ class Settings : AttributeGlobalSettings public int GrantFiefRelationPenalty { get; set; } = -2; // Costs - + [SettingPropertyFloatingInteger(displayName: "{=HFtZsD6v}Scaling War Reparations Gold Cost Multiplier", 0, 10000, Order = 0, RequireRestart = false, HintText = "{=MIhbrqbr}Multiplier for the scaling of war reparations gold costs. Default value is 100.")] [SettingPropertyGroup(HeadingGoldCosts)] public float ScalingWarReparationsGoldCostMultiplier { get; set; } = 100.0f; @@ -140,7 +140,7 @@ class Settings : AttributeGlobalSettings [SettingPropertyFloatingInteger(displayName: "{=TvAYJv5Q}Scaling Influence Cost Multiplier", 0, 100, Order = 1, RequireRestart = false, HintText = "{=AQ5gRYN6}Multiplier for the scaling influence costs. Default value is 5.")] [SettingPropertyGroup(HeadingInfluenceCosts)] public float ScalingInfluenceCostMultiplier { get; set; } = 5.0f; - + // Influence [SettingPropertyBool("{=4jlYRUdZ}Enable Influence Balancing", RequireRestart = false, HintText = "{=tOMN9DQD}Enables influence balancing. May need to be disabled for mod compatibility.")] @@ -234,4 +234,4 @@ class Settings : AttributeGlobalSettings public float CoalitionChancePercentage { get; set; } = 5.0f; */ } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/StringConstants.cs b/src/Bannerlord.Diplomacy/StringConstants.cs index b1c8b8e0..b8a892b7 100644 --- a/src/Bannerlord.Diplomacy/StringConstants.cs +++ b/src/Bannerlord.Diplomacy/StringConstants.cs @@ -20,4 +20,4 @@ internal sealed class StringConstants public const string FactionLeague = "{=LUzfk4tb}{CLAN_NAME} League"; public const string FactionConspiracy = "{=MXAsjFdI}{CLAN_NAME} Conspiracy"; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/SubModule.cs b/src/Bannerlord.Diplomacy/SubModule.cs index 483d2ec0..5444322f 100644 --- a/src/Bannerlord.Diplomacy/SubModule.cs +++ b/src/Bannerlord.Diplomacy/SubModule.cs @@ -1,7 +1,9 @@ -using Diplomacy.CampaignBehaviors; -using Diplomacy.PatchTools; +using Bannerlord.ButterLib.Common.Extensions; +using Bannerlord.UIExtenderEx; -using Bannerlord.ButterLib.Common.Extensions; +using Diplomacy.CampaignBehaviors; +using Diplomacy.Event; +using Diplomacy.PatchTools; using HarmonyLib; @@ -12,10 +14,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; -using TaleWorlds.MountAndBlade; -using Bannerlord.UIExtenderEx; -using Diplomacy.Event; using TaleWorlds.ModuleManager; +using TaleWorlds.MountAndBlade; namespace Diplomacy { @@ -82,7 +82,7 @@ protected override void OnGameStart(Game game, IGameStarter gameStarterObject) if (game.GameType is Campaign) { Events.Instance = new Events(); - var gameStarter = (CampaignGameStarter)gameStarterObject; + var gameStarter = (CampaignGameStarter) gameStarterObject; gameStarter.AddBehavior(new DiplomaticAgreementBehavior()); gameStarter.AddBehavior(new CooldownBehavior()); @@ -120,4 +120,4 @@ public override void OnGameEnd(Game game) Log.LogDebug("Campaign session ended."); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs index d399dd01..a0807c52 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DetailWarStatsVM.cs @@ -1,4 +1,5 @@ using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; @@ -24,4 +25,4 @@ public DetailWarStatsVM(Kingdom kingdom) FiefsLabel = GameTexts.FindText("str_fiefs").ToString(); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs index e2b752af..d5945ec5 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DetailWarVM.cs @@ -1,11 +1,14 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; + +using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection; using TaleWorlds.Core; using TaleWorlds.Core.ViewModelCollection; using TaleWorlds.Library; using TaleWorlds.Localization; + using static Diplomacy.WarExhaustionManager; namespace Diplomacy.ViewModel diff --git a/src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs index 199eb25d..6853ab7d 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyFactionRelationshipVM.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; -using JetBrains.Annotations; +using JetBrains.Annotations; + +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Core.ViewModelCollection; @@ -9,7 +11,7 @@ namespace Diplomacy.ViewModel { public sealed class DiplomacyFactionRelationshipVM : TaleWorlds.Library.ViewModel { - public IFaction Faction { get; init; } + public IFaction Faction { get; init; } public DiplomacyFactionRelationshipVM(IFaction faction, HintViewModel? hint = null) { @@ -75,4 +77,4 @@ public HintViewModel Hint private string _nameText; private HintViewModel _hint; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs index f47347c4..aa685dff 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DiplomacyPropertiesVM.cs @@ -75,7 +75,7 @@ private HintViewModel CreateAllianceHint(Kingdom kingdom1, Kingdom kingdom2) { textObject = _TDaysRemaining.CopyTextObject(); var remaining = Settings.Instance!.MinimumAllianceDuration - elapsedDaysUntilNow; - textObject.SetTextVariable("DAYS_LEFT", (int)Math.Round(remaining)); + textObject.SetTextVariable("DAYS_LEFT", (int) Math.Round(remaining)); } else { @@ -87,10 +87,10 @@ private HintViewModel CreateAllianceHint(Kingdom kingdom1, Kingdom kingdom2) private void AddNonAggressionPactRelationships(Kingdom kingdom, IFaction faction, MBBindingList factionPacts) { - if (DiplomaticAgreementManager.HasNonAggressionPact(kingdom, (Kingdom)faction, out var pact)) + if (DiplomaticAgreementManager.HasNonAggressionPact(kingdom, (Kingdom) faction, out var pact)) { var textObject = _TDaysRemaining.CopyTextObject(); - textObject.SetTextVariable("DAYS_LEFT", (int)Math.Round(pact!.EndDate.RemainingDaysFromNow)); + textObject.SetTextVariable("DAYS_LEFT", (int) Math.Round(pact!.EndDate.RemainingDaysFromNow)); factionPacts.Add(new DiplomacyFactionRelationshipVM(kingdom, Compat.HintViewModel.Create(textObject))); } } @@ -98,10 +98,10 @@ private void AddNonAggressionPactRelationships(Kingdom kingdom, IFaction faction private void AddWarRelationships(IEnumerable stances) { foreach (var stance in from x in stances - where x.IsAtWar - select x into w - orderby w.Faction1.Name.ToString() + w.Faction2.Name.ToString() - select w) + where x.IsAtWar + select x into w + orderby w.Faction1.Name.ToString() + w.Faction2.Name.ToString() + select w) { var (f1, f2) = (stance.Faction1, stance.Faction2); @@ -206,4 +206,4 @@ public MBBindingList Faction2Pacts } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs index ef1d8163..84fea040 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs @@ -1,6 +1,8 @@ -using System; +using JetBrains.Annotations; + +using System; using System.ComponentModel; -using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; using TaleWorlds.Core; @@ -139,14 +141,14 @@ private int GetBaseRelationValueOfCurrentGoldCost() var relationValuePerInfluence = (float) Campaign.Current.Models.DiplomacyModel.GetRelationValueOfSupportingClan() / Campaign.Current.Models.DiplomacyModel.GetInfluenceCostOfSupportingClan(); - return (int)Math.Round(influenceValue * relationValuePerInfluence); + return (int) Math.Round(influenceValue * relationValuePerInfluence); } private int GetEstimatedRelationValue() { var baseRelation = GetBaseRelationValueOfCurrentGoldCost(); var adjustedRelation = Campaign.Current.Models.DiplomacyModel.GetRelationIncreaseFactor(Hero.MainHero, _clan.Leader, baseRelation); - return (int)Math.Floor(adjustedRelation); + return (int) Math.Floor(adjustedRelation); } } } \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs index 314c7507..5db2dc1d 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs @@ -1,7 +1,10 @@ using Diplomacy.DiplomaticAction; using Diplomacy.GauntletInterfaces; -using System.Linq; + using JetBrains.Annotations; + +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia.EncyclopediaItems; @@ -25,7 +28,7 @@ class EncyclopediaFactionPageVMExtensionVM : EncyclopediaFactionPageVM public EncyclopediaFactionPageVMExtensionVM(EncyclopediaPageArgs args) : base(args) { - _faction = (IFaction)Obj; + _faction = (IFaction) Obj; _alliesText = _TAllies.ToString(); _nonAggressionPactsText = _TNonAggressionPacts.ToString(); FactionsText = _TFactions.ToString(); @@ -33,7 +36,7 @@ public EncyclopediaFactionPageVMExtensionVM(EncyclopediaPageArgs args) : base(ar public override void RefreshValues() { - _faction = (IFaction)Obj; + _faction = (IFaction) Obj; _allies = new(); _nonAggressionPacts = new(); base.RefreshValues(); @@ -53,7 +56,7 @@ public override void Refresh() if (_faction.IsKingdomFaction) foreach (var f in Kingdom.All.Cast().Where(f => f != _faction).OrderBy(f => f.Name.ToString())) - if (clanPages.IsValidEncyclopediaItem(f) && DiplomaticAgreementManager.HasNonAggressionPact((Kingdom)_faction, (Kingdom)f, out _)) + if (clanPages.IsValidEncyclopediaItem(f) && DiplomaticAgreementManager.HasNonAggressionPact((Kingdom) _faction, (Kingdom) f, out _)) _nonAggressionPacts.Add(new EncyclopediaFactionVM(f)); base.Refresh(); @@ -124,4 +127,4 @@ public MBBindingList? NonAggressionPacts } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs index 28645b58..bd35d819 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs @@ -3,7 +3,9 @@ using Diplomacy.GauntletInterfaces; using Diplomacy.GrantFief; using Diplomacy.Messengers; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia; using TaleWorlds.Engine.Screens; @@ -28,7 +30,7 @@ public EncyclopediaHeroPageVMExtensionVM(EncyclopediaPageArgs args) : base(args) _grantFiefInterface = new GrantFiefInterface(); _hero = (Obj as Hero)!; _sendMessengerCost = DiplomacyCostCalculator.DetermineCostForSendingMessenger(); - SendMessengerCost = (int)_sendMessengerCost.Value; + SendMessengerCost = (int) _sendMessengerCost.Value; SendMessengerActionName = _TSendMessengerText.ToString(); GrantFiefActionName = _TGrantFiefText.ToString(); RefreshValues(); @@ -37,7 +39,7 @@ public EncyclopediaHeroPageVMExtensionVM(EncyclopediaPageArgs args) : base(args) public sealed override void RefreshValues() { base.RefreshValues(); - + // this is called before the constructor the first time // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (_hero is null) @@ -114,4 +116,4 @@ private void UpdateIsMessengerAvailable() [DataSourceProperty] public string GrantFiefActionName { get; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs index 875341dc..bbad43c6 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs @@ -1,6 +1,9 @@ using Diplomacy.GrantFief; -using System; + using JetBrains.Annotations; + +using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.Library; @@ -21,12 +24,12 @@ public GrantFiefItemVM(Settlement settlement, Hero targetHero, Action(); if (component2 is not null) { - Prosperity = (int)Math.Round(component2.Prosperity); + Prosperity = (int) Math.Round(component2.Prosperity); IconPath = component2.BackgroundMeshName; } else if (settlement.IsCastle) { - Prosperity = (int)Math.Round(settlement.Prosperity); + Prosperity = (int) Math.Round(settlement.Prosperity); IconPath = ""; } Garrison = Settlement.Town.GarrisonParty?.Party.NumberOfAllMembers ?? 0; @@ -78,4 +81,4 @@ public bool IsSelected [DataSourceProperty] public string RelationBonus { get; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs index c8384768..2d24e0ad 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefSortControllerVM.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; + using TaleWorlds.Library; namespace Diplomacy.ViewModel @@ -89,11 +90,11 @@ private void ExecuteSortByDefenders() private void SetAllStates(SortState state) { - TypeState = (int)state; - NameState = (int)state; - ProsperityState = (int)state; - DefendersState = (int)state; - RelationState = (int)state; + TypeState = (int) state; + NameState = (int) state; + ProsperityState = (int) state; + DefendersState = (int) state; + RelationState = (int) state; IsTypeSelected = false; IsNameSelected = false; IsProsperitySelected = false; @@ -390,4 +391,4 @@ public override int Compare(GrantFiefItemVM x, GrantFiefItemVM y) } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs index cf16bee8..a2198f6f 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefVM.cs @@ -1,8 +1,11 @@ -using System; -using System.Linq; -using Diplomacy.Extensions; +using Diplomacy.Extensions; using Diplomacy.GrantFief; + using JetBrains.Annotations; + +using System; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Core.ViewModelCollection; diff --git a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs index feb5cce1..948a700d 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs @@ -1,7 +1,10 @@ -using System; -using Diplomacy.CivilWar.Actions; +using Diplomacy.CivilWar.Actions; using Diplomacy.CivilWar.Factions; + using JetBrains.Annotations; + +using System; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; diff --git a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs index 5b9857dd..1695c343 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionParticipantVM.cs @@ -1,8 +1,11 @@ -using System; -using System.Collections.Generic; -using Diplomacy.CivilWar.Factions; +using Diplomacy.CivilWar.Factions; using Diplomacy.CivilWar.Scoring; + using JetBrains.Annotations; + +using System; +using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia.EncyclopediaItems; using TaleWorlds.Core; diff --git a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs index 711ea359..6f86a442 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionsVM.cs @@ -1,11 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Diplomacy.CivilWar; +using Diplomacy.CivilWar; using Diplomacy.CivilWar.Actions; using Diplomacy.CivilWar.Factions; using Diplomacy.Extensions; + using JetBrains.Annotations; + +using System; +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia.EncyclopediaItems; using TaleWorlds.Core; diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs index 7a221169..c590c101 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionBreakdownVM.cs @@ -1,5 +1,6 @@ using TaleWorlds.Library; using TaleWorlds.Localization; + using static Diplomacy.WarExhaustionManager; namespace Diplomacy.ViewModel diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs index f61f8f69..b94c0324 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs @@ -1,5 +1,7 @@ using Diplomacy.GauntletInterfaces; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Engine.Screens; @@ -55,7 +57,7 @@ public ImageIdentifierVM Faction1Visual public ImageIdentifierVM Faction2Visual { get => _faction2Visual; - set { _faction2Visual = value; OnPropertyChanged(nameof(Faction2Visual));} + set { _faction2Visual = value; OnPropertyChanged(nameof(Faction2Visual)); } } [DataSourceProperty] diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs index f43b771c..bcbe0ff7 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs @@ -1,4 +1,5 @@ using Diplomacy.Event; + using TaleWorlds.CampaignSystem; using TaleWorlds.Library; diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs index 34762cdf..964f53d7 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/DiplomacyPanelPrefabExtension.cs @@ -1,12 +1,11 @@ using Bannerlord.BUTR.Shared.Helpers; - using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.Prefabs2; -using System.Xml; - using JetBrains.Annotations; +using System.Xml; + namespace Diplomacy.ViewModelMixin { [PrefabExtension("DiplomacyPanel", "descendant::Widget[@IsVisible='@Show']")] @@ -40,4 +39,4 @@ public DiplomacyPanelPrefabExtension() public XmlDocument GetPrefabExtension() => _document; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs index e8ddf695..7e045044 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaFactionPagePrefabExtension.cs @@ -1,8 +1,10 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.Prefabs2; -using System.Xml; + using JetBrains.Annotations; +using System.Xml; + namespace Diplomacy.ViewModelMixin { [PrefabExtension("EncyclopediaFactionPage", "descendant::GridWidget[@Id='EnemiesGrid']")] @@ -42,4 +44,4 @@ public FactionsButtonExtension() [UsedImplicitly] public XmlDocument GetPrefabExtension() => _document; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs index 2cb232cf..9f749392 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/EncyclopediaHeroPagePrefabExtension.cs @@ -1,8 +1,10 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.Prefabs2; -using System.Xml; + using JetBrains.Annotations; +using System.Xml; + namespace Diplomacy.ViewModelMixin { [PrefabExtension("EncyclopediaHeroPage", "descendant::RichTextWidget[@Text='@InformationText']")] @@ -23,4 +25,4 @@ public EncyclopediaHeroPagePrefabExtension() [UsedImplicitly] public XmlDocument GetPrefabExtension() => _document; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs index aaadc5b6..93d53efc 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs @@ -1,9 +1,12 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Event; using Diplomacy.GauntletInterfaces; using Diplomacy.GrantFief; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.KingdomManagement.KingdomClan; using TaleWorlds.Core.ViewModelCollection; @@ -117,4 +120,4 @@ public HintViewModel GrantFiefHint [DataSourceProperty] public string DonateGoldExplanationText { get; } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs index 73dfad36..46f5f525 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs @@ -1,13 +1,18 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Bannerlord.UIExtenderEx.Attributes; +using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.DiplomaticAction.Alliance; using Diplomacy.Event; using Diplomacy.Extensions; + using HarmonyLib; + using JetBrains.Annotations; + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.KingdomManagement.KingdomDiplomacy; using TaleWorlds.Core; @@ -173,7 +178,7 @@ public void ExecuteShowStatComparison() private void OnDiplomacyItemSelection(KingdomDiplomacyItemVM item) { - OnDiplomacyItemSelectionMethod.Invoke(ViewModel, new object[] {item}); + OnDiplomacyItemSelectionMethod.Invoke(ViewModel, new object[] { item }); #if !(e159 || e1510) ExecuteShowStatComparison(); #endif diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs index 236774cd..8c75f52b 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementPrefabExtension.cs @@ -1,8 +1,10 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.Prefabs2; + +using JetBrains.Annotations; + using System.Collections.Generic; using System.Xml; -using JetBrains.Annotations; namespace Diplomacy.ViewModelMixin { @@ -40,4 +42,4 @@ internal sealed class KingdomManagementScalingPatch : PrefabExtensionSetAttribut new Attribute("MultiplyResult", "0.60") }; } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs index b42827b7..caf27027 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs @@ -1,7 +1,10 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.GauntletInterfaces; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem.ViewModelCollection; using TaleWorlds.Engine.Screens; using TaleWorlds.Library; @@ -35,4 +38,4 @@ public void ExecuteShowFactions() new RebelFactionsInterface().ShowInterface(ScreenManager.TopScreen, ViewModel!.Kingdom); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs index 1b550ad6..0409f391 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs @@ -1,13 +1,17 @@ -using System.Collections.Generic; -using System.Linq; -using Bannerlord.UIExtenderEx.Attributes; +using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Costs; using Diplomacy.DiplomaticAction.Alliance; using Diplomacy.DiplomaticAction.NonAggressionPact; using Diplomacy.DiplomaticAction.WarPeace; using Diplomacy.ViewModel; + using JetBrains.Annotations; + +using System.Collections.Generic; +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; using TaleWorlds.CampaignSystem.ViewModelCollection.KingdomManagement.KingdomDiplomacy; diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs index 0809dc87..3c4e59c9 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs @@ -1,10 +1,14 @@ -using System.Linq; -using Bannerlord.UIExtenderEx.Attributes; +using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Costs; using Diplomacy.DiplomaticAction.WarPeace; using Diplomacy.ViewModel; + using JetBrains.Annotations; + +using System.Linq; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.KingdomManagement.KingdomDiplomacy; using TaleWorlds.Core; diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs index 54d45242..71a4bc10 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/MapNavigationVMMixin.cs @@ -1,7 +1,10 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Extensions; + using JetBrains.Annotations; + using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Map; using TaleWorlds.Localization; @@ -25,4 +28,4 @@ public override void OnRefresh() } } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs index 75d90cbf..9a66f40e 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/PartyNameplateVMMixin.cs @@ -1,8 +1,12 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Event; + using JetBrains.Annotations; + using SandBox.ViewModelCollection.Nameplate; + using TaleWorlds.CampaignSystem; namespace Diplomacy.ViewModelMixin @@ -26,4 +30,4 @@ public override void OnFinalize() Events.RemoveListeners(this); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs index a4dc2759..f77c49af 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/SettlementNameplatesVMMixin.cs @@ -1,8 +1,12 @@ using Bannerlord.UIExtenderEx.Attributes; using Bannerlord.UIExtenderEx.ViewModels; + using Diplomacy.Event; + using JetBrains.Annotations; + using SandBox.ViewModelCollection.Nameplate; + using TaleWorlds.CampaignSystem; namespace Diplomacy.ViewModelMixin @@ -26,4 +30,4 @@ public override void OnFinalize() Events.RemoveListeners(this); } } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs b/src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs index 9d722355..0516a493 100644 --- a/src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs +++ b/src/Bannerlord.Diplomacy/Views/GauntletWarExhaustionIndicator.cs @@ -1,6 +1,9 @@ using Diplomacy.ViewModel; + using JetBrains.Annotations; + using SandBox.View.Map; + using TaleWorlds.Engine.GauntletUI; using TaleWorlds.Library; using TaleWorlds.MountAndBlade; diff --git a/src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs b/src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs index 2f6ed5c7..8c5dc5e5 100644 --- a/src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs +++ b/src/Bannerlord.Diplomacy/Views/WarExhaustionIndicatorView.cs @@ -5,4 +5,4 @@ namespace Diplomacy.Views public class MapWarExhaustionIndicatorView : MapView { } -} +} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/WarExhaustionManager.cs b/src/Bannerlord.Diplomacy/WarExhaustionManager.cs index 74c190ea..d33be526 100644 --- a/src/Bannerlord.Diplomacy/WarExhaustionManager.cs +++ b/src/Bannerlord.Diplomacy/WarExhaustionManager.cs @@ -1,6 +1,8 @@ using Diplomacy.Event; + using System; using System.Collections.Generic; + using TaleWorlds.CampaignSystem; using TaleWorlds.Core; using TaleWorlds.Library; From bc90c91d513d394ef00e6e1b6ab55267b02e8190 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:11:41 +0300 Subject: [PATCH 05/41] Update TestBuild.yml --- .github/workflows/TestBuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index 0cf8e2bb..95cfd1e7 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -2,13 +2,13 @@ name: TestBuild on: push: - branches: - - '*' - - '!main' + branches-ignore: + - main pull_request: branches: - main - dev + workflow_dispatch: env: # Disable the .NET logo in the console output. From 2387767b5cb69bf08d5c019ff4b4262778545cd3 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:16:36 +0300 Subject: [PATCH 06/41] Update common.targets --- build/common.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/common.targets b/build/common.targets index e520f80a..315d82bc 100644 --- a/build/common.targets +++ b/build/common.targets @@ -2,9 +2,9 @@ - - - + + + From a3dc2560e44d7f1b4cbad7e37d9e2ba2b7ab6b91 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:18:31 +0300 Subject: [PATCH 07/41] Update common.targets --- build/common.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.targets b/build/common.targets index 315d82bc..e4e3f3c8 100644 --- a/build/common.targets +++ b/build/common.targets @@ -1,4 +1,4 @@ - + From ff9bea355d09b4da68e5b7fad8a5daddc96084cc Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:48:47 +0300 Subject: [PATCH 08/41] Update TestBuild.yml --- .github/workflows/TestBuild.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index 95cfd1e7..7f06f9f2 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -8,6 +8,8 @@ on: branches: - main - dev + # hopefully will be triggered more often + types: [assigned, opened, edited, reopened, review_requested, ready_for_review] workflow_dispatch: env: From 5c462b54746a6555e6db86a6127c563069885bf0 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:53:33 +0300 Subject: [PATCH 09/41] Test dependencybot pulls --- build/common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index 645103e0..86836d61 100644 --- a/build/common.props +++ b/build/common.props @@ -12,7 +12,7 @@ 2.1.1 - 1.0.31 + 1.0.30 4.3.10 @@ -105,4 +105,4 @@ - \ No newline at end of file + From 5f736704320c6dc9a6bc03ccb7195efe8deedc11 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sat, 8 Jan 2022 12:35:43 +0300 Subject: [PATCH 10/41] Added Url to SubModule.xml --- .../_Module/SubModule.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml b/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml index a9f100c7..158b502c 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml +++ b/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml @@ -7,6 +7,7 @@ + From 7b5c0e5f073073ef8c247c71c50c2ef49d3a2286 Mon Sep 17 00:00:00 2001 From: Aragas Date: Thu, 13 Jan 2022 00:43:27 +0300 Subject: [PATCH 11/41] Fixed usage of the new BUTR.Shared version Replaced ImplementationLoader with Module Loader --- build/common.props | 8 +- ...lord.Diplomacy.ImplementationLoader.csproj | 60 ----- .../ImplementationLoaderSubModule.cs | 250 ------------------ .../Properties/launchSettings.json | 11 - src/Bannerlord.Diplomacy.sln | 18 +- .../Bannerlord.Diplomacy.csproj | 22 +- .../Widgets/CriticalThresholdTextWidget.cs | 0 .../Widgets/HoveredBrushWidget.cs | 0 .../KingdomDiplomacyPanelTabControlWidget.cs | 0 .../_Module/SubModule.xml | 12 +- 10 files changed, 26 insertions(+), 355 deletions(-) delete mode 100644 src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj delete mode 100644 src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs delete mode 100644 src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json rename src/{Bannerlord.Diplomacy.ImplementationLoader => Bannerlord.Diplomacy}/Widgets/CriticalThresholdTextWidget.cs (100%) rename src/{Bannerlord.Diplomacy.ImplementationLoader => Bannerlord.Diplomacy}/Widgets/HoveredBrushWidget.cs (100%) rename src/{Bannerlord.Diplomacy.ImplementationLoader => Bannerlord.Diplomacy}/Widgets/KingdomDiplomacyPanelTabControlWidget.cs (100%) rename src/{Bannerlord.Diplomacy.ImplementationLoader => Bannerlord.Diplomacy}/_Module/SubModule.xml (83%) diff --git a/build/common.props b/build/common.props index 86836d61..2769ff28 100644 --- a/build/common.props +++ b/build/common.props @@ -18,9 +18,13 @@ 2.1.6 - 1.6.1.61 + 2.0.0.76 + + 3.0.83 + + 1.0.0 - 2.0.0.10 + 2.0.0.53 diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj b/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj deleted file mode 100644 index d04d5e3e..00000000 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Bannerlord.Diplomacy.ImplementationLoader.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - $(ModuleName) - Minimal_Debug;Minimal_Release - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - \$displayname\$ - $(DisplayName) - - - \$mcmversion\$ - $(MCMVersion) - - - - diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs b/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs deleted file mode 100644 index e06692ab..00000000 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/ImplementationLoaderSubModule.cs +++ /dev/null @@ -1,250 +0,0 @@ -using Bannerlord.BUTR.Shared.Helpers; -using Bannerlord.ButterLib.Common.Extensions; -using Bannerlord.ButterLib.Common.Helpers; -using Bannerlord.ButterLib.SubModuleWrappers; - -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -using TaleWorlds.Core; -using TaleWorlds.Library; -using TaleWorlds.MountAndBlade; - -using AccessTools2 = HarmonyLib.BUTR.Extensions.AccessTools2; - -namespace Diplomacy -{ - /// - /// Loads all ButterLib's implementation libraries that are supported by the game. - /// - public sealed class ImplementationLoaderSubModule : MBSubModuleBaseListWrapper - { - private delegate MBSubModuleBase ConstructorDelegate(); - - private static IEnumerable LoadAllImplementations(ILogger? logger) - { - logger?.LogInformation("Loading implementations..."); - - var implementationAssemblies = new List(); - - var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).ToList(); - - var thisAssembly = typeof(ImplementationLoaderSubModule).Assembly; - - var assemblyFile = new FileInfo(thisAssembly.Location); - if (!assemblyFile.Exists) - { - logger?.LogError("Assembly file does not exists!"); - yield break; - } - - var assemblyDirectory = assemblyFile.Directory; - if (assemblyDirectory?.Exists != true) - { - logger?.LogError("Assembly directory does not exists!"); - yield break; - } - - var implementations = assemblyDirectory.GetFiles("Bannerlord.Diplomacy.*.dll"); - if (implementations.Length == 0) - { - logger?.LogError("No implementations found."); - yield break; - } - - var gameVersion = ApplicationVersionHelper.GameVersion(); - if (gameVersion is null) - { - logger?.LogError("Failed to get Game version!"); - yield break; - } - - - var implementationsFiles = implementations.Where(x => assemblies.All(a => Path.GetFileNameWithoutExtension(a.Location) != Path.GetFileNameWithoutExtension(x.Name))); - var implementationsWithVersions = GetImplementations(implementationsFiles, logger).ToList(); - if (implementationsWithVersions.Count == 0) - { - logger?.LogError("No compatible implementations were found!"); - yield break; - } - - var implementationsForGameVersion = ImplementationForGameVersion(gameVersion.Value, implementationsWithVersions).ToList(); - switch (implementationsForGameVersion.Count) - { - case > 1: - { - logger?.LogInformation("Found multiple matching implementations:"); - foreach (var (implementation1, version1) in implementationsForGameVersion) - logger?.LogInformation("Implementation {name} for game {gameVersion}.", implementation1.Name, version1); - - - logger?.LogInformation("Loading the latest available."); - - var (implementation, version) = ImplementationLatest(implementationsForGameVersion); - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } - - case 1: - { - logger?.LogInformation("Found matching implementation. Loading it."); - - var (implementation, version) = implementationsForGameVersion[0]; - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } - - case 0: - { - logger?.LogInformation("Found no matching implementations. Loading the latest available."); - - var (implementation, version) = ImplementationLatest(implementationsWithVersions); - logger?.LogInformation("Implementation {name} for game {gameVersion} is loaded.", implementation.Name, version); - implementationAssemblies.Add(Assembly.LoadFrom(implementation.FullName)); - break; - } - } - - var subModules = implementationAssemblies.SelectMany(a => - { - try - { - return a.GetTypes().Where(t => typeof(MBSubModuleBase).IsAssignableFrom(t)); - } - catch (Exception e) when (e is ReflectionTypeLoadException) - { - logger?.LogError(e, "Implementation {name} is not compatible with the current game!", Path.GetFileName(a.Location)); - return Enumerable.Empty(); - } - - }).ToList(); - - if (subModules.Count == 0) - logger?.LogError("No implementation was initialized!"); - - foreach (var subModuleType in subModules) - { - var constructor = subModuleType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, Type.EmptyTypes, null); - if (constructor is null) - { - logger?.LogError("SubModule {subModuleType} is missing a default constructor!", subModuleType); - continue; - } - - var constructorFunc = AccessTools2.GetDelegate(constructor); - if (constructorFunc is null) - { - logger?.LogError("SubModule {subModuleType}'s default constructor could not be converted to a delegate!", subModuleType); - continue; - } - - yield return constructorFunc(); - } - - logger?.LogInformation("Finished loading implementations."); - } - - private static IEnumerable<(FileInfo Implementation, ApplicationVersion Version)> GetImplementations(IEnumerable implementations, ILogger? logger = null) - { - foreach (var implementation in implementations) - { - bool found = false; - logger?.LogInformation("Found implementation {name}.", implementation.Name); - - using var fs = File.OpenRead(implementation.FullName); - using var peReader = new PEReader(fs); - var mdReader = peReader.GetMetadataReader(MetadataReaderOptions.None); - foreach (var attr in mdReader.GetAssemblyDefinition().GetCustomAttributes().Select(ah => mdReader.GetCustomAttribute(ah))) - { - var ctorHandle = attr.Constructor; - if (ctorHandle.Kind != HandleKind.MemberReference) continue; - - var container = mdReader.GetMemberReference((MemberReferenceHandle) ctorHandle).Parent; - var name = mdReader.GetTypeReference((TypeReferenceHandle) container).Name; - if (!string.Equals(mdReader.GetString(name), "AssemblyMetadataAttribute")) continue; - - var attributeReader = mdReader.GetBlobReader(attr.Value); - attributeReader.ReadByte(); - attributeReader.ReadByte(); - var key = attributeReader.ReadSerializedString(); - var value = attributeReader.ReadSerializedString(); - if (string.Equals(key, "GameVersion")) - { - if (!ApplicationVersionHelper.TryParse(value, out var implementationGameVersion)) - { - logger?.LogError("Implementation {name} has invalid GameVersion AssemblyMetadataAttribute!", implementation.Name); - continue; - } - - found = true; - yield return (implementation, implementationGameVersion); - break; - } - } - - if (!found) - logger?.LogError("Implementation {name} is missing GameVersion AssemblyMetadataAttribute!", implementation.Name); - } - } - - private static IEnumerable<(FileInfo Implementation, ApplicationVersion Version)> ImplementationForGameVersion(ApplicationVersion gameVersion, IEnumerable<(FileInfo Implementation, ApplicationVersion Verion)> implementations) - { - foreach (var (implementation, version) in implementations) - { - if (version.Revision == -1) // Implementation does not specify the revision - { - if (gameVersion.IsSameWithoutRevision(version)) - { - yield return (implementation, version); - } - } - else // Implementation specified the revision - { - if (gameVersion.IsSameWithRevision(version)) - { - yield return (implementation, version); - } - } - } - } - private static (FileInfo Implementation, ApplicationVersion Version) ImplementationLatest(IEnumerable<(FileInfo Implementation, ApplicationVersion Version)> implementations) - { - return implementations.MaxBy(x => x.Version, new ApplicationVersionComparer(), out _); - } - - - private bool ServiceRegistrationWasCalled { get; set; } - - public override void OnServiceRegistration() - { - ServiceRegistrationWasCalled = true; - - var logger = this.GetTempServiceProvider()?.GetRequiredService>() ?? NullLogger.Instance; - SubModules.AddRange(LoadAllImplementations(logger).Select(x => new MBSubModuleBaseWrapper(x)).ToList()); - - base.OnServiceRegistration(); - } - - protected override void OnSubModuleLoad() - { - if (!ServiceRegistrationWasCalled) - { - var logger = this.GetTempServiceProvider()?.GetRequiredService>() ?? NullLogger.Instance; - SubModules.AddRange(LoadAllImplementations(logger).Select(x => new MBSubModuleBaseWrapper(x)).ToList()); - } - - base.OnSubModuleLoad(); - } - } -} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json b/src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json deleted file mode 100644 index dab18cb7..00000000 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/Properties/launchSettings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "profiles": { - "Bannerlord.Diplomacy.ImplementationLoader": { - "commandName": "Executable", - "executablePath": "$(GameFolder)\\bin\\Win64_Shipping_Client\\Bannerlord.exe", - "commandLineArgs": "/singleplayer _MODULES_*Bannerlord.Harmony*Bannerlord.ButterLib*Bannerlord.UIExtenderEx*Bannerlord.MBOptionScreen*Native*SandBoxCore*Sandbox*StoryMode*CustomBattle*QuickStart*$(ModuleName)*_MODULES_", - "workingDirectory": "$(GameFolder)\\bin\\Win64_Shipping_Client", - "nativeDebugging": true - } - } -} \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy.sln b/src/Bannerlord.Diplomacy.sln index e5e3c52a..f290bec0 100644 --- a/src/Bannerlord.Diplomacy.sln +++ b/src/Bannerlord.Diplomacy.sln @@ -1,12 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31005.135 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy", "Bannerlord.Diplomacy\Bannerlord.Diplomacy.csproj", "{AD3695A8-2BDD-44AF-A115-54F839A9EC2A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy.ImplementationLoader", "Bannerlord.Diplomacy.ImplementationLoader\Bannerlord.Diplomacy.ImplementationLoader.csproj", "{F8659754-47D5-472D-8939-666874D8C9B9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{12CCA2B5-A874-47B3-BB43-799275014D7B}" ProjectSection(SolutionItems) = preProject ..\changelog.txt = ..\changelog.txt @@ -53,18 +51,6 @@ Global {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Debug|x64.Build.0 = Stable_Debug|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Release|x64.ActiveCfg = Stable_Release|x64 {AD3695A8-2BDD-44AF-A115-54F839A9EC2A}.Stable_Release|x64.Build.0 = Stable_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.ActiveCfg = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Debug|x64.Build.0 = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.ActiveCfg = Minimal_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Beta_Release|x64.Build.0 = Minimal_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Debug|x64.ActiveCfg = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Debug|x64.Build.0 = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Release|x64.ActiveCfg = Minimal_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Minimal_Release|x64.Build.0 = Minimal_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.ActiveCfg = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Debug|x64.Build.0 = Minimal_Debug|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.ActiveCfg = Minimal_Release|x64 - {F8659754-47D5-472D-8939-666874D8C9B9}.Stable_Release|x64.Build.0 = Minimal_Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj index e0734dee..c3d5f4cc 100644 --- a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj +++ b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj @@ -14,14 +14,16 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + @@ -52,8 +54,4 @@ - - - - diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs b/src/Bannerlord.Diplomacy/Widgets/CriticalThresholdTextWidget.cs similarity index 100% rename from src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/CriticalThresholdTextWidget.cs rename to src/Bannerlord.Diplomacy/Widgets/CriticalThresholdTextWidget.cs diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs b/src/Bannerlord.Diplomacy/Widgets/HoveredBrushWidget.cs similarity index 100% rename from src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/HoveredBrushWidget.cs rename to src/Bannerlord.Diplomacy/Widgets/HoveredBrushWidget.cs diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs b/src/Bannerlord.Diplomacy/Widgets/KingdomDiplomacyPanelTabControlWidget.cs similarity index 100% rename from src/Bannerlord.Diplomacy.ImplementationLoader/Widgets/KingdomDiplomacyPanelTabControlWidget.cs rename to src/Bannerlord.Diplomacy/Widgets/KingdomDiplomacyPanelTabControlWidget.cs diff --git a/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml b/src/Bannerlord.Diplomacy/_Module/SubModule.xml similarity index 83% rename from src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml rename to src/Bannerlord.Diplomacy/_Module/SubModule.xml index a9f100c7..d6dbc18c 100644 --- a/src/Bannerlord.Diplomacy.ImplementationLoader/_Module/SubModule.xml +++ b/src/Bannerlord.Diplomacy/_Module/SubModule.xml @@ -29,11 +29,15 @@ + - - - - + + + + + + + From 672cd8c2df9b5314248a6ea9092ae13eb92c5cf8 Mon Sep 17 00:00:00 2001 From: Aragas Date: Thu, 13 Jan 2022 00:45:58 +0300 Subject: [PATCH 12/41] Fix --- src/Bannerlord.Diplomacy.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bannerlord.Diplomacy.sln b/src/Bannerlord.Diplomacy.sln index f290bec0..9bdbf4b9 100644 --- a/src/Bannerlord.Diplomacy.sln +++ b/src/Bannerlord.Diplomacy.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bannerlord.Diplomacy", "Bannerlord.Diplomacy\Bannerlord.Diplomacy.csproj", "{AD3695A8-2BDD-44AF-A115-54F839A9EC2A}" EndProject From 981e515cb87bf7cb1637c8e80c312c26e25c3ca4 Mon Sep 17 00:00:00 2001 From: Aragas Date: Thu, 13 Jan 2022 10:18:06 +0300 Subject: [PATCH 13/41] Updated deps --- build/common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index 2769ff28..5941a3e7 100644 --- a/build/common.props +++ b/build/common.props @@ -18,9 +18,9 @@ 2.1.6 - 2.0.0.76 + 2.0.0.77 - 3.0.83 + 3.0.85 1.0.0 From 21ddcc20b126d15ea309f38d966a3c63bf89d36e Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Thu, 13 Jan 2022 12:09:33 +0300 Subject: [PATCH 14/41] Update common.props --- build/common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index 5941a3e7..aab762e1 100644 --- a/build/common.props +++ b/build/common.props @@ -20,9 +20,9 @@ 2.0.0.77 - 3.0.85 + 3.0.86 - 1.0.0 + 1.0.0.5 2.0.0.53 From 3bc17bf3564bf88825d3e8ad3182975761f50af5 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:05:27 +0300 Subject: [PATCH 15/41] Update common.props --- build/common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index aab762e1..4d38991b 100644 --- a/build/common.props +++ b/build/common.props @@ -18,9 +18,9 @@ 2.1.6 - 2.0.0.77 + 2.0.0.78 - 3.0.86 + 3.0.87 1.0.0.5 From 2c5ef45851c54de8ff1c217aabef82a63caf0100 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sat, 15 Jan 2022 14:25:56 +0300 Subject: [PATCH 16/41] Update common.props --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index 4d38991b..d469c6be 100644 --- a/build/common.props +++ b/build/common.props @@ -22,7 +22,7 @@ 3.0.87 - 1.0.0.5 + 1.0.1.10 2.0.0.53 From d1f5edba2ba38060c93431988b001f41609fb5c6 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sat, 15 Jan 2022 14:26:34 +0300 Subject: [PATCH 17/41] Update SubModule.xml --- src/Bannerlord.Diplomacy/_Module/SubModule.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bannerlord.Diplomacy/_Module/SubModule.xml b/src/Bannerlord.Diplomacy/_Module/SubModule.xml index b7aa4240..58d865e3 100644 --- a/src/Bannerlord.Diplomacy/_Module/SubModule.xml +++ b/src/Bannerlord.Diplomacy/_Module/SubModule.xml @@ -33,12 +33,11 @@ - - + + - From 8234b93318c709223ceddb9faf60bc7ecd0783d7 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sat, 15 Jan 2022 14:27:15 +0300 Subject: [PATCH 18/41] Update Bannerlord.Diplomacy.csproj --- src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj index c3d5f4cc..4ed98a72 100644 --- a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj +++ b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj @@ -22,7 +22,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From b0c5374397dc33be875d2300fa7be2faacf7ddc4 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sun, 16 Jan 2022 15:27:33 +0300 Subject: [PATCH 19/41] Update common.props --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index d469c6be..cbd282d6 100644 --- a/build/common.props +++ b/build/common.props @@ -22,7 +22,7 @@ 3.0.87 - 1.0.1.10 + 1.0.1.18 2.0.0.53 From 7430337520512674d4684687292c5fbba8f884c9 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sun, 16 Jan 2022 15:30:11 +0300 Subject: [PATCH 20/41] Update SubModule.xml --- src/Bannerlord.Diplomacy/_Module/SubModule.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bannerlord.Diplomacy/_Module/SubModule.xml b/src/Bannerlord.Diplomacy/_Module/SubModule.xml index 58d865e3..1f30668e 100644 --- a/src/Bannerlord.Diplomacy/_Module/SubModule.xml +++ b/src/Bannerlord.Diplomacy/_Module/SubModule.xml @@ -33,10 +33,10 @@ - - + + - + From f54158156cfc136707dd80c5b07564bf4dcdbf00 Mon Sep 17 00:00:00 2001 From: Vitaly Mikhailov Date: Sun, 16 Jan 2022 15:30:22 +0300 Subject: [PATCH 21/41] Update common.props --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index cbd282d6..b2d8e145 100644 --- a/build/common.props +++ b/build/common.props @@ -22,7 +22,7 @@ 3.0.87 - 1.0.1.18 + 1.0.1.19 2.0.0.53 From a7af97d748e686591baec7454ce7d6555486a6e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:22:22 +0000 Subject: [PATCH 22/41] Bump actions/download-artifact from 2 to 3 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e72aacbc..94b85cba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} - name: Download stable bannerlord folder - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: Bannerlord.Diplomacy path: ./bannerlord/Modules/ From f0f1179a0998c85f0fffe16d08b97f5bad7ab30e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:21:43 +0000 Subject: [PATCH 23/41] Bump actions/checkout from 2 to 3.0.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.0.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3.0.2) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/TestBuild.yml | 2 +- .github/workflows/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index 7f06f9f2..d370a6f8 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3.0.2 - name: Setup .NET Core uses: actions/setup-dotnet@master diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e72aacbc..707b8ce6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3.0.2 - name: Setup .NET Core uses: actions/setup-dotnet@master From 22a800a1f9be5481da81e0fc0969443f13679611 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 May 2022 16:27:34 +0000 Subject: [PATCH 24/41] Bump actions/upload-artifact from 2 to 3.1.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.1.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3.1.0) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e72aacbc..025495bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: shell: pwsh - name: Upload bannerlord folder - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3.1.0 with: name: Bannerlord.Diplomacy path: ./bannerlord/Modules/ From f91687ee78306c4eb66b29449c63391f1cc8926d Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 1 Jun 2022 12:16:06 +0300 Subject: [PATCH 25/41] Update Directory.Build.props --- src/Directory.Build.props | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c00df63b..d90cfc00 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,3 +1,7 @@ + - + + + + From 8475567b743bd344a95e6c8fa110beac46987c20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:17:58 +0000 Subject: [PATCH 26/41] Bump Bannerlord.BUTR.Shared from 2.0.0.78 to 2.0.0.82 Bumps [Bannerlord.BUTR.Shared](https://github.com/BUTR/Bannerlord.BUTR.Shared) from 2.0.0.78 to 2.0.0.82. - [Release notes](https://github.com/BUTR/Bannerlord.BUTR.Shared/releases) - [Commits](https://github.com/BUTR/Bannerlord.BUTR.Shared/commits) --- updated-dependencies: - dependency-name: Bannerlord.BUTR.Shared dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index b2d8e145..8c23d280 100644 --- a/build/common.props +++ b/build/common.props @@ -18,7 +18,7 @@ 2.1.6 - 2.0.0.78 + 2.0.0.82 3.0.87 From 981027f071db30cfb685ae4a3e40ed91f67fd04e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:18:03 +0000 Subject: [PATCH 27/41] Bump Bannerlord.ModuleManager.Source from 3.0.87 to 3.0.94 Bumps [Bannerlord.ModuleManager.Source](https://github.com/BUTR/Bannerlord.ModuleManager) from 3.0.87 to 3.0.94. - [Release notes](https://github.com/BUTR/Bannerlord.ModuleManager/releases) - [Commits](https://github.com/BUTR/Bannerlord.ModuleManager/commits) --- updated-dependencies: - dependency-name: Bannerlord.ModuleManager.Source dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index b2d8e145..8abf2930 100644 --- a/build/common.props +++ b/build/common.props @@ -20,7 +20,7 @@ 2.0.0.78 - 3.0.87 + 3.0.94 1.0.1.19 From e9b13016d3907efce0ce336e0c66c411d9b44d7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:18:09 +0000 Subject: [PATCH 28/41] Bump Bannerlord.BuildResources from 1.0.0.33 to 1.0.1.68 Bumps [Bannerlord.BuildResources](https://github.com/BUTR/Bannerlord.BuildResources) from 1.0.0.33 to 1.0.1.68. - [Release notes](https://github.com/BUTR/Bannerlord.BuildResources/releases) - [Commits](https://github.com/BUTR/Bannerlord.BuildResources/commits) --- updated-dependencies: - dependency-name: Bannerlord.BuildResources dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index b2d8e145..dc5caba7 100644 --- a/build/common.props +++ b/build/common.props @@ -8,7 +8,7 @@ - 1.0.0.33 + 1.0.1.68 2.1.1 From a79c3ad34bedc04b129d5a9c18fb17e889db2b2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:18:14 +0000 Subject: [PATCH 29/41] Bump Bannerlord.ButterLib from 1.0.30 to 2.1.2 Bumps [Bannerlord.ButterLib](https://github.com/BUTR/Bannerlord.ButterLib) from 1.0.30 to 2.1.2. - [Release notes](https://github.com/BUTR/Bannerlord.ButterLib/releases) - [Changelog](https://github.com/BUTR/Bannerlord.ButterLib/blob/dev/changelog.txt) - [Commits](https://github.com/BUTR/Bannerlord.ButterLib/compare/v1.0.30...v2.1.2) --- updated-dependencies: - dependency-name: Bannerlord.ButterLib dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index b2d8e145..d71b69fe 100644 --- a/build/common.props +++ b/build/common.props @@ -12,7 +12,7 @@ 2.1.1 - 1.0.30 + 2.1.2 4.3.10 From c2fe62e717e7922b68588a160f911054b50952ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:18:21 +0000 Subject: [PATCH 30/41] Bump Bannerlord.ModuleLoader.Injector from 1.0.1.19 to 1.0.1.24 Bumps [Bannerlord.ModuleLoader.Injector](https://github.com/BUTR/Bannerlord.ModuleLoader) from 1.0.1.19 to 1.0.1.24. - [Release notes](https://github.com/BUTR/Bannerlord.ModuleLoader/releases) - [Commits](https://github.com/BUTR/Bannerlord.ModuleLoader/commits) --- updated-dependencies: - dependency-name: Bannerlord.ModuleLoader.Injector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index b2d8e145..d635f6ba 100644 --- a/build/common.props +++ b/build/common.props @@ -22,7 +22,7 @@ 3.0.87 - 1.0.1.19 + 1.0.1.24 2.0.0.53 From c0f70fe623783664f79a7d1a1a52798a9b076a29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:27:18 +0000 Subject: [PATCH 31/41] Bump Bannerlord.MCM from 4.3.10 to 4.6.0 Bumps [Bannerlord.MCM](https://github.com/Aragas/Bannerlord.MBOptionScreen) from 4.3.10 to 4.6.0. - [Release notes](https://github.com/Aragas/Bannerlord.MBOptionScreen/releases) - [Changelog](https://github.com/Aragas/Bannerlord.MBOptionScreen/blob/dev/changelog.txt) - [Commits](https://github.com/Aragas/Bannerlord.MBOptionScreen/compare/v4.3.10...v4.6.0) --- updated-dependencies: - dependency-name: Bannerlord.MCM dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index 444b93b1..4eda2583 100644 --- a/build/common.props +++ b/build/common.props @@ -14,7 +14,7 @@ 2.1.2 - 4.3.10 + 4.6.0 2.1.6 From 62b6e67f929ffb1bf6057562b2c6e8c5accd096d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:27:21 +0000 Subject: [PATCH 32/41] Bump Harmony.Extensions from 2.0.0.53 to 2.0.0.56 Bumps [Harmony.Extensions](https://github.com/BUTR/Harmony.Extensions) from 2.0.0.53 to 2.0.0.56. - [Release notes](https://github.com/BUTR/Harmony.Extensions/releases) - [Commits](https://github.com/BUTR/Harmony.Extensions/commits) --- updated-dependencies: - dependency-name: Harmony.Extensions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index 444b93b1..8711ee83 100644 --- a/build/common.props +++ b/build/common.props @@ -24,7 +24,7 @@ 1.0.1.24 - 2.0.0.53 + 2.0.0.56 From 4bd56ee61ebb5948695c56789ab0486232c5db64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:27:26 +0000 Subject: [PATCH 33/41] Bump Bannerlord.UIExtenderEx from 2.1.6 to 2.1.13 Bumps [Bannerlord.UIExtenderEx](https://github.com/BUTR/Bannerlord.UIExtenderEx) from 2.1.6 to 2.1.13. - [Release notes](https://github.com/BUTR/Bannerlord.UIExtenderEx/releases) - [Changelog](https://github.com/BUTR/Bannerlord.UIExtenderEx/blob/dev/changelog.txt) - [Commits](https://github.com/BUTR/Bannerlord.UIExtenderEx/compare/v2.1.6...v2.1.13) --- updated-dependencies: - dependency-name: Bannerlord.UIExtenderEx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build/common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/common.props b/build/common.props index 444b93b1..db2326aa 100644 --- a/build/common.props +++ b/build/common.props @@ -16,7 +16,7 @@ 4.3.10 - 2.1.6 + 2.1.13 2.0.0.82 From 40a078a3d669c8ce0e595b79333b2ed26253b661 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Wed, 1 Jun 2022 15:14:49 +0300 Subject: [PATCH 34/41] Update to e1.7.2 --- .github/workflows/TestBuild.yml | 2 +- .github/workflows/build.yml | 2 +- build/common.props | 21 +++++++++++------ changelog.txt | 4 ++++ .../DiplomaticAgreementBehavior.cs | 1 + .../CampaignBehaviors/ExpansionismBehavior.cs | 1 + .../KeepFiefAfterSiegeBehavior.cs | 1 + .../MaintainInfluenceBehavior.cs | 5 ++-- .../CampaignBehaviors/MessengerBehavior.cs | 4 ---- .../CampaignBehaviors/UIBehavior.cs | 1 + .../WarExhaustionBehavior.cs | 6 ++--- .../PlayerCharacterTraitEventExperience.cs | 2 +- .../Character/PlayerCharacterTraitHelper.cs | 2 +- .../Actions/ChangeKingdomBannerAction.cs | 2 ++ .../Actions/ConsolidateKingdomsAction.cs | 1 + .../CivilWar/Factions/RebelFaction.cs | 2 ++ .../CivilWar/Scoring/AbdicationDemandScore.cs | 1 + .../AbstractFactionDemandScoringModel.cs | 1 + .../Scoring/ChangeRulerFactionScoreBase.cs | 1 + .../CivilWar/Scoring/SecessionDemandScore.cs | 1 + .../CustomSavedTypeDefiner.cs | 1 + .../WarPeace/Conditions/NoSiegeCondition.cs | 1 + ...tisfiesQuestConditionsForPeaceCondition.cs | 4 ---- src/Bannerlord.Diplomacy/Event/Events.cs | 1 + .../Extensions/ClanExtensions.cs | 1 + .../Extensions/HeroExtensions.cs | 1 + src/Bannerlord.Diplomacy/FieldAccessHelper.cs | 3 ++- .../DetailWarViewInterface.cs | 2 +- .../GauntletInterfaces/DonateGoldInterface.cs | 2 +- .../GauntletInterfaces/GenericInterface.cs | 2 +- .../GauntletInterfaces/GrantFiefInterface.cs | 2 +- .../RebelFactionsInterface.cs | 2 +- .../GrantFief/GrantFiefAction.cs | 1 + .../Messengers/MessengerManager.cs | 12 ++++------ .../Patches/DefaultClanPoliticsModelPatch.cs | 2 +- .../DefaultEncyclopediaFactionPagePatch.cs | 23 ------------------- .../Patches/DiplomaticBartersBehaviorPatch.cs | 2 +- .../Patches/GameMenusCallbacksPatch.cs | 4 ++-- .../KingdomDecisionProposalBehaviorPatch.cs | 2 +- .../Patches/RebelKingdomPatches.cs | 11 ++++----- .../Patches/SupportKingdomQuestPatch.cs | 8 +------ .../UrbanCharactersCampaignBehaviorPatch.cs | 9 ++++---- .../EncyclopediaFactionPageVMExtensionVM.cs | 1 + .../EncyclopediaHeroPageVMExtensionVM.cs | 1 + .../ViewModel/GrantFiefItemVM.cs | 1 + .../ViewModel/RebelFactionItemVM.cs | 1 + .../WarExhaustionMapIndicatorItemVM.cs | 1 + .../ViewModel/WarExhaustionMapIndicatorVM.cs | 3 --- .../ViewModelMixin/KingdomClanVMMixin.cs | 4 ++-- .../ViewModelMixin/KingdomDiplomacyVMMixin.cs | 10 -------- .../KingdomManagementVMMixin.cs | 4 +--- supported-game-versions.txt | 10 +------- 52 files changed, 82 insertions(+), 111 deletions(-) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index d370a6f8..7742c8f9 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -45,7 +45,7 @@ jobs: # The folders are required to be created before executing the script New-Item -ItemType directory -Force -Path $impl; New-Item -ItemType directory -Force -Path $path; - $gameversions = Get-Content -Path supported-game-versions.txt; + [string[]]$gameversions = Get-Content -Path supported-game-versions.txt; # Process all implementations For ($i = 0; $i -le $gameversions.Length - 1; $i++) { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a16c7f1..bcdd84fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: # The folders are required to be created before executing the script New-Item -ItemType directory -Force -Path $impl; New-Item -ItemType directory -Force -Path $path; - $gameversions = Get-Content -Path supported-game-versions.txt; + [string[]]$gameversions = Get-Content -Path supported-game-versions.txt; # Process all implementations For ($i = 0; $i -le $gameversions.Length - 1; $i++) { diff --git a/build/common.props b/build/common.props index d7c785c1..f6e25691 100644 --- a/build/common.props +++ b/build/common.props @@ -2,7 +2,7 @@ - 1.1.9 + 1.1.10 @@ -10,7 +10,7 @@ 1.0.1.68 - 2.1.1 + 2.2.1 2.1.2 @@ -62,13 +62,20 @@ - + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`).Length) $([MSBuild]::Subtract($(SGVLineCount), 1)) - - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[0]) - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[1]) - $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[$(SGVLastEntryIndex)]) + + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[0]) + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[1]) + $([System.Text.RegularExpressions.Regex]::Split($(SGVFile), `\r\n|\r|\n`)[$(SGVLastEntryIndex)]) + + $(FirstLine) + $(SecondLine) + + $(FirstLine) + $(SecondLine) + $(LastLine) e1.1.0 $(GameMinimalVersion) diff --git a/changelog.txt b/changelog.txt index cf4e5192..07189d54 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.10 +Game Versions: e1.7.2 +* Compatibility with e1.7.2 +--------------------------------------------------------------------------------------------------- Version: 1.1.9 Game Versions: e1.5.9,e1.5.10,e1.6.0,e1.6.1,e1.6.2,e1.6.3,e1.6.4,e1.6.5,e1.7.0 * Compatibility with e1.7.0 diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs index 45ef5b67..8d220b0b 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/DiplomaticAgreementBehavior.cs @@ -9,6 +9,7 @@ using System.Linq; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; using TaleWorlds.Core; namespace Diplomacy.CampaignBehaviors diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs index da554fff..0ae34ea4 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/ExpansionismBehavior.cs @@ -1,5 +1,6 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.CampaignBehaviors { diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs index ffea4d70..1416bece 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/KeepFiefAfterSiegeBehavior.cs @@ -3,6 +3,7 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs index b7cb02ca..5c34a88a 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/MaintainInfluenceBehavior.cs @@ -4,7 +4,8 @@ using System.Linq; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.Barterables; +using TaleWorlds.CampaignSystem.BarterSystem.Barterables; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.CampaignBehaviors { @@ -62,7 +63,7 @@ private void ReduceCorruption(Clan clan) private static int GetGoldValueForFief(Clan buyerClan, Settlement settlement) { - return (int) Math.Min(Campaign.Current.Models.SettlementValueModel.CalculateValueForFaction(settlement, buyerClan), + return (int) Math.Min(Campaign.Current.Models.SettlementValueModel.CalculateSettlementValueForFaction(settlement, buyerClan), buyerClan.Gold * 0.8); } } diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs index 55386d6f..6b76f9f1 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/MessengerBehavior.cs @@ -15,11 +15,7 @@ internal sealed class MessengerBehavior : CampaignBehaviorBase public override void RegisterEvents() { Events.MessengerSent.AddNonSerializedListener(this, OnMessengerSent); -#if e165 || e170 CampaignEvents.OnAfterSessionLaunchedEvent.AddNonSerializedListener(this, OnAfterSessionLaunched); -#else - CampaignEvents.OnSessionLaunchedEvent.AddNonSerializedListener(this, OnAfterSessionLaunched); -#endif CampaignEvents.HourlyTickEvent.AddNonSerializedListener(this, HasMessengerArrivedHourlyTick); } diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs index de499d74..7bc95520 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/UIBehavior.cs @@ -3,6 +3,7 @@ using SandBox.View.Map; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.GameState; using TaleWorlds.Core; namespace Diplomacy.CampaignBehaviors diff --git a/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs b/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs index ab5f3c31..7b4351d4 100644 --- a/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs +++ b/src/Bannerlord.Diplomacy/CampaignBehaviors/WarExhaustionBehavior.cs @@ -6,6 +6,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.MapEvents; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Core; namespace Diplomacy.CampaignBehaviors @@ -142,11 +144,7 @@ private void ConsiderPeaceActions(Kingdom kingdom) private bool IsValidQuestState(Kingdom kingdom1, Kingdom kingdom2) { -#if e170 var currentStoryMode = StoryMode.StoryModeManager.Current; -#else - var currentStoryMode = StoryMode.StoryMode.Current; -#endif // not in story mode if (currentStoryMode == null) { diff --git a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs index 135c9202..511626f4 100644 --- a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs +++ b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitEventExperience.cs @@ -1,6 +1,6 @@ using System; -using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; namespace Diplomacy.Character { diff --git a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs index 71b65de9..9da0860e 100644 --- a/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs +++ b/src/Bannerlord.Diplomacy/Character/PlayerCharacterTraitHelper.cs @@ -3,7 +3,7 @@ using System; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.CharacterDevelopment.Managers; +using TaleWorlds.CampaignSystem.CharacterDevelopment; namespace Diplomacy.Character { diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs index 0c578348..5c69421f 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/ChangeKingdomBannerAction.cs @@ -11,6 +11,8 @@ using System.Reflection; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Party; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Core; namespace Diplomacy.CivilWar.Actions diff --git a/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs b/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs index faea2b41..368f20b3 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Actions/ConsolidateKingdomsAction.cs @@ -4,6 +4,7 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.CivilWar.Actions { diff --git a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs index 6e0e0248..f86baa05 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs @@ -8,6 +8,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.CharacterDevelopment; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs index 86a9c45d..f446ca07 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbdicationDemandScore.cs @@ -5,6 +5,7 @@ using System.Linq; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; using TaleWorlds.Localization; namespace Diplomacy.CivilWar.Scoring diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs index b3ce8ffa..ed9359a2 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/AbstractFactionDemandScoringModel.cs @@ -5,6 +5,7 @@ using System.Linq; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs index fb16fe7e..be53d894 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/ChangeRulerFactionScoreBase.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs b/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs index 2166db56..2ca10c35 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Scoring/SecessionDemandScore.cs @@ -5,6 +5,7 @@ using System.Linq; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; using TaleWorlds.Localization; namespace Diplomacy.CivilWar.Scoring diff --git a/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs b/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs index 735d17d8..13d23b38 100644 --- a/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs +++ b/src/Bannerlord.Diplomacy/CustomSavedTypeDefiner.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.SaveSystem; namespace Diplomacy diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs index 04c39c36..49838ea8 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/NoSiegeCondition.cs @@ -1,4 +1,5 @@ using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Siege; using TaleWorlds.Localization; namespace Diplomacy.DiplomaticAction.WarPeace.Conditions diff --git a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs index 8107dfc9..5f32633c 100644 --- a/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs +++ b/src/Bannerlord.Diplomacy/DiplomaticAction/WarPeace/Conditions/SatisfiesQuestConditionsForPeaceCondition.cs @@ -9,11 +9,7 @@ internal class SatisfiesQuestConditionsForPeaceCondition : IDiplomacyCondition public bool ApplyCondition(Kingdom kingdom, Kingdom otherKingdom, out TextObject? textObject, bool forcePlayerCharacterCosts = false, bool bypassCosts = false) { textObject = null; -#if e170 var currentStoryMode = StoryMode.StoryModeManager.Current; -#else - var currentStoryMode = StoryMode.StoryMode.Current; -#endif // not in story mode if (currentStoryMode == null) { diff --git a/src/Bannerlord.Diplomacy/Event/Events.cs b/src/Bannerlord.Diplomacy/Event/Events.cs index 10fc26cd..3f62c478 100644 --- a/src/Bannerlord.Diplomacy/Event/Events.cs +++ b/src/Bannerlord.Diplomacy/Event/Events.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.Event { diff --git a/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs index 14df5d5b..0d689667 100644 --- a/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs +++ b/src/Bannerlord.Diplomacy/Extensions/ClanExtensions.cs @@ -5,6 +5,7 @@ using System.Linq; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.Extensions { diff --git a/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs b/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs index 4ce890c8..6bae39cb 100644 --- a/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs +++ b/src/Bannerlord.Diplomacy/Extensions/HeroExtensions.cs @@ -1,6 +1,7 @@ using System; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.CharacterDevelopment; namespace Diplomacy.Extensions { diff --git a/src/Bannerlord.Diplomacy/FieldAccessHelper.cs b/src/Bannerlord.Diplomacy/FieldAccessHelper.cs index 2059ba1d..086c95a8 100644 --- a/src/Bannerlord.Diplomacy/FieldAccessHelper.cs +++ b/src/Bannerlord.Diplomacy/FieldAccessHelper.cs @@ -1,4 +1,5 @@ -using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Encounters; +using TaleWorlds.CampaignSystem.Party; using static HarmonyLib.AccessTools; diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs index a6be63f5..fb4da6bf 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/DetailWarViewInterface.cs @@ -4,8 +4,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; -using TaleWorlds.Engine.Screens; using TaleWorlds.InputSystem; +using TaleWorlds.ScreenSystem; namespace Diplomacy.GauntletInterfaces { diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs index 9be1ad1c..7fb4c040 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/DonateGoldInterface.cs @@ -2,8 +2,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; -using TaleWorlds.Engine.Screens; using TaleWorlds.InputSystem; +using TaleWorlds.ScreenSystem; namespace Diplomacy.GauntletInterfaces { diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs index 26f4759c..9c93ae95 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/GenericInterface.cs @@ -2,7 +2,7 @@ using HarmonyLib.BUTR.Extensions; using TaleWorlds.Engine.GauntletUI; -using TaleWorlds.Engine.Screens; +using TaleWorlds.ScreenSystem; namespace Diplomacy.GauntletInterfaces { diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs index 01633315..e0b5c101 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/GrantFiefInterface.cs @@ -4,8 +4,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; -using TaleWorlds.Engine.Screens; using TaleWorlds.InputSystem; +using TaleWorlds.ScreenSystem; namespace Diplomacy.GauntletInterfaces { diff --git a/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs b/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs index b4df25e7..a87568ad 100644 --- a/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs +++ b/src/Bannerlord.Diplomacy/GauntletInterfaces/RebelFactionsInterface.cs @@ -2,8 +2,8 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Engine.GauntletUI; -using TaleWorlds.Engine.Screens; using TaleWorlds.InputSystem; +using TaleWorlds.ScreenSystem; namespace Diplomacy.GauntletInterfaces { diff --git a/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs b/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs index 8cb66ecc..b28f1ffe 100644 --- a/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs +++ b/src/Bannerlord.Diplomacy/GrantFief/GrantFiefAction.cs @@ -7,6 +7,7 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Localization; namespace Diplomacy.GrantFief diff --git a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs index 3b3662ee..9a1064cc 100644 --- a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs +++ b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs @@ -7,6 +7,11 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Actions; +using TaleWorlds.CampaignSystem.Conversation; +using TaleWorlds.CampaignSystem.Encounters; +using TaleWorlds.CampaignSystem.GameState; +using TaleWorlds.CampaignSystem.Party; +using TaleWorlds.CampaignSystem.Settlements.Locations; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; @@ -271,16 +276,9 @@ internal void CleanUpAfterLoad(float obj) private void RemoveThisFromListeners() { -#if e159 || e1510 - CampaignEvents.RemoveListeners(this); -#else CampaignEventDispatcher.Instance.RemoveListeners(this); -#endif } -#if e170 public void OnDeploymentPlanMade(BattleSideEnum battleSide, bool isFirstPlan) { } -#else -#endif } } \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs index 37c03c70..ac54cf1a 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultClanPoliticsModelPatch.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.SandBox.GameComponents; +using TaleWorlds.CampaignSystem.GameComponents; using TaleWorlds.Localization; namespace Diplomacy.Patches diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs index 0396323e..b9f917d8 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs @@ -12,7 +12,6 @@ namespace Diplomacy.Patches { internal sealed class DefaultEncyclopediaFactionPagePatch : PatchClass { -#if e165 || e170 protected override IEnumerable Prepare() => new Patch[] { new Postfix(nameof(PassThroughPostfix), "InitializeListItems"), @@ -31,27 +30,5 @@ private static IEnumerable PassThroughPostfix(IEnumerable< yield return item; } } -#else - protected override IEnumerable Prepare() => new Patch[] - { - new Postfix(nameof(ApplyPostfix), nameof(DefaultEncyclopediaFactionPage.GetListItems)), - }; - - // ReSharper disable once RedundantAssignment - private static void ApplyPostfix(ref IEnumerable __result, ref IEnumerable ____items) - { - var listItems = ____items.ToList(); - foreach (var item in listItems.ToList()) - { - var kingdom = (Kingdom) item.Object; - if (kingdom.IsRebelKingdom() && kingdom.IsEliminated) - { - listItems.Remove(item); - } - } - ____items = listItems; - __result = ____items; - } -#endif } } \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs index 0ae81069..8a7e8759 100644 --- a/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DiplomaticBartersBehaviorPatch.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.BarterBehaviors; +using TaleWorlds.CampaignSystem.CampaignBehaviors.BarterBehaviors; namespace Diplomacy.Patches { diff --git a/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs b/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs index 7cfa3ddd..826156ae 100644 --- a/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/GameMenusCallbacksPatch.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; -using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors; +using TaleWorlds.CampaignSystem.CampaignBehaviors; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.Patches { diff --git a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs index 31514adc..5202a40d 100644 --- a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs @@ -6,7 +6,7 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.Election; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors; +using TaleWorlds.CampaignSystem.CampaignBehaviors; namespace Diplomacy.Patches { diff --git a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs index 412a7a81..b9581e38 100644 --- a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs +++ b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs @@ -7,9 +7,9 @@ using System.Linq; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.Towns; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.VillageBehaviors; +using TaleWorlds.CampaignSystem.CampaignBehaviors; +using TaleWorlds.CampaignSystem.Party; +using TaleWorlds.CampaignSystem.Settlements; namespace Diplomacy.Patches { @@ -27,9 +27,7 @@ protected override IEnumerable Prepare() new Postfix(nameof(PreventHostileActionsConversation), typeof(VillagerCampaignBehavior), "village_farmer_loot_on_condition"), new Postfix(nameof(PreventHostileActionsConversation), typeof(CaravansCampaignBehavior), "caravan_loot_on_condition"), new Postfix(nameof(PreventHostileActionsMenu), typeof(PlayerTownVisitCampaignBehavior), "game_menu_village_hostile_action_on_condition"), -#if !e159 new Prefix(nameof(HandleThroneAbdication), typeof(KingdomManager), "AbdicateTheThrone"), -#endif }; } @@ -88,7 +86,7 @@ private static bool ShouldPreventHostileAction(IFaction otherFaction) playerFaction is Kingdom playerKingdom && playerKingdom.IsRebelKingdom() && !playerKingdom.IsAtWarWith(otherFaction); return shouldPreventAction1 || shouldPreventAction2; } -#if !e159 + private static void HandleThroneAbdication(Kingdom kingdom) { if (kingdom.Clans.Count <= 1 && kingdom.HasRebellion()) @@ -101,6 +99,5 @@ private static void HandleThroneAbdication(Kingdom kingdom) kingdom.GetRebelFactions().First().EnforceSuccess(); } } -#endif } } \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs b/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs index 95c94a39..8fc93a24 100644 --- a/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/SupportKingdomQuestPatch.cs @@ -1,10 +1,9 @@ using Diplomacy.PatchTools; -using StoryMode.Behaviors.Quests; +using StoryMode.Quests.FirstPhase; using System; using System.Collections.Generic; -using System.Reflection; using TaleWorlds.CampaignSystem; @@ -17,12 +16,7 @@ internal sealed class SupportKingdomQuestPatch : PatchClass CompleteQuestWithSuccess = new Reflect.Method("CompleteQuestWithSuccess") .GetOpenDelegate>(); diff --git a/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs index e24c33f3..a6de2633 100644 --- a/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs @@ -8,15 +8,18 @@ using System.Reflection; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors; +using TaleWorlds.CampaignSystem.CampaignBehaviors; namespace Diplomacy.Patches { + // Outdated since e1.7.2? + /* [HarmonyPatch(typeof(UrbanCharactersCampaignBehavior))] [UsedImplicitly] internal sealed class UrbanCharactersCampaignBehaviorPatch { private static readonly FieldInfo CompanionsFieldInfo = AccessTools.Field(typeof(UrbanCharactersCampaignBehavior), "_companions"); + private static readonly Action ActivateCharacter = (hero, __instance) => { hero.ChangeState(Hero.CharacterStates.Active); @@ -24,7 +27,6 @@ internal sealed class UrbanCharactersCampaignBehaviorPatch companionsList.Remove(hero); }; - [HarmonyPostfix, HarmonyPatch("RegisterEvents")] [UsedImplicitly] public static void RegisterEventsPatch(UrbanCharactersCampaignBehavior __instance) @@ -32,8 +34,6 @@ public static void RegisterEventsPatch(UrbanCharactersCampaignBehavior __instanc CampaignEvents.NewCompanionAdded.AddNonSerializedListener(__instance, hero => ActivateCharacter(hero, __instance)); } - // It Seems they changed this to "DailyTickHero" in 1.5.0 - //[HarmonyPostfix, HarmonyPatch("DailyTick")] [HarmonyPostfix, HarmonyPatch("DailyTickHero")] [UsedImplicitly] public static void HourlyTickPatch(UrbanCharactersCampaignBehavior __instance) @@ -41,4 +41,5 @@ public static void HourlyTickPatch(UrbanCharactersCampaignBehavior __instance) Hero.MainHero.CompanionsInParty.Where(companion => companion.HeroState == Hero.CharacterStates.NotSpawned).Do(hero => ActivateCharacter(hero, __instance)); } } + */ } \ No newline at end of file diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs index 5db2dc1d..071c4900 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs @@ -11,6 +11,7 @@ using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; +using TaleWorlds.ScreenSystem; namespace Diplomacy.ViewModel { diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs index bd35d819..a2af8e6c 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs @@ -11,6 +11,7 @@ using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; +using TaleWorlds.ScreenSystem; namespace Diplomacy.ViewModel { diff --git a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs index bbad43c6..7040ecd3 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/GrantFiefItemVM.cs @@ -5,6 +5,7 @@ using System; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.Library; namespace Diplomacy.ViewModel diff --git a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs index 948a700d..9696dd3c 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/RebelFactionItemVM.cs @@ -6,6 +6,7 @@ using System; using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.GameState; using TaleWorlds.Core; using TaleWorlds.Library; using TaleWorlds.Localization; diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs index b94c0324..ec30958c 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs @@ -6,6 +6,7 @@ using TaleWorlds.Core; using TaleWorlds.Engine.Screens; using TaleWorlds.Library; +using TaleWorlds.ScreenSystem; namespace Diplomacy.ViewModel { diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs index bcbe0ff7..19a4a9a7 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorVM.cs @@ -30,9 +30,6 @@ public WarExhaustionMapIndicatorVM() CampaignEvents.WarDeclared.AddNonSerializedListener(this, HandleStanceChange); CampaignEvents.MakePeace.AddNonSerializedListener(this, HandleStanceChange); CampaignEvents.ClanChangedKingdom.AddNonSerializedListener(this, (x, _, _, _, _) => HandleClanChangedKingdom(x)); -#if e159 || e1510 - CampaignEvents.MercenaryClanChangedKingdom.AddNonSerializedListener(this, (x, y, z) => HandleClanChangedKingdom(x)); -#endif Events.WarExhaustionAdded.AddNonSerializedListener(this, HandleWarExhaustionChange); } diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs index 93d53efc..1ff1abfe 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomClanVMMixin.cs @@ -7,12 +7,12 @@ using JetBrains.Annotations; -using TaleWorlds.CampaignSystem; +using TaleWorlds.CampaignSystem.Settlements; using TaleWorlds.CampaignSystem.ViewModelCollection.KingdomManagement.KingdomClan; using TaleWorlds.Core.ViewModelCollection; -using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; +using TaleWorlds.ScreenSystem; namespace Diplomacy.ViewModelMixin { diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs index 46f5f525..bf71d32a 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomDiplomacyVMMixin.cs @@ -136,9 +136,7 @@ private void OnPropertyChangedWithValue(object sender, PropertyChangedWithValueE { if (e.PropertyName == nameof(ViewModel.CurrentSelectedDiplomacyItem)) { -#if !(e159 || e1510) OnDiplomacyItemSelection(ViewModel!.CurrentSelectedDiplomacyItem); -#endif } } @@ -146,11 +144,7 @@ public override void OnFinalize() { Events.RemoveListeners(this); ViewModel!.PropertyChangedWithValue -= _eventHandler; -#if e159 || e1510 - CampaignEvents.RemoveListeners(this); -#else CampaignEventDispatcher.Instance.RemoveListeners(this); -#endif } [DataSourceMethod] @@ -168,20 +162,16 @@ public void ExecuteShowOverview() ShowStats = false; } -#if !(e159 || e1510) public void ExecuteShowStatComparison() { ViewModel!.IsDisplayingStatComparisons = true; ViewModel!.IsDisplayingWarLogs = false; } -#endif private void OnDiplomacyItemSelection(KingdomDiplomacyItemVM item) { OnDiplomacyItemSelectionMethod.Invoke(ViewModel, new object[] { item }); -#if !(e159 || e1510) ExecuteShowStatComparison(); -#endif } public override void OnRefresh() diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs index caf27027..bbc5e819 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomManagementVMMixin.cs @@ -6,9 +6,9 @@ using JetBrains.Annotations; using TaleWorlds.CampaignSystem.ViewModelCollection; -using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; +using TaleWorlds.ScreenSystem; namespace Diplomacy.ViewModelMixin { @@ -24,12 +24,10 @@ public KingdomManagementVMMixin(KingdomManagementVM vm) : base(vm) FactionsLabel = new TextObject("{=gypPPxUJ}Factions").ToString(); } -#if !(e159 || e1510) public override void OnFinalize() { ViewModel!.Diplomacy.OnFinalize(); } -#endif [DataSourceMethod] [UsedImplicitly] diff --git a/supported-game-versions.txt b/supported-game-versions.txt index 1a719c22..02a9ef57 100644 --- a/supported-game-versions.txt +++ b/supported-game-versions.txt @@ -1,9 +1 @@ -e1.7.0 -e1.6.5 -e1.6.4 -e1.6.3 -e1.6.2 -e1.6.1 -e1.6.0 -e1.5.10 -e1.5.9 \ No newline at end of file +e1.7.2 \ No newline at end of file From 727b92b23ae8616b42939878adb0f79ad92b2d10 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:36:20 +0300 Subject: [PATCH 35/41] Update TestBuild.yml --- .github/workflows/TestBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestBuild.yml b/.github/workflows/TestBuild.yml index 7742c8f9..d6a3d764 100644 --- a/.github/workflows/TestBuild.yml +++ b/.github/workflows/TestBuild.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3 - name: Setup .NET Core uses: actions/setup-dotnet@master From 2ee907f995816b3df7083efa6975b2ca61048185 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Wed, 1 Jun 2022 15:44:23 +0300 Subject: [PATCH 36/41] Props fix --- build/common.props | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index f6e25691..64f66231 100644 --- a/build/common.props +++ b/build/common.props @@ -32,7 +32,8 @@ x64 9.0 enable - Bannerlord.Diplomacy + Bannerlord.Diplomacy + $(ModuleId) Diplomacy $(DisplayName) @@ -41,7 +42,7 @@ Diplomacy Team Diplomacy Library mod for Bannerlord false - Copyright © 2020-2021 Diplomacy Team + Copyright © 2020-2022 Diplomacy Team Diplomacy system overhaul for Mount & Blade II: Bannerlord From 0dfedaf9746e35d0b6220999b10347d0ac915ecd Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:48:14 +0300 Subject: [PATCH 37/41] Update LICENSE --- LICENSE | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 1f6b7991..e8de31fd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,21 @@ -Copyright © 2020 Katarn2000x -Copyright © 2020-2021 Matthew D. Hall (zijistark) +MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Copyright © 2020-2022 Diplomacy Team -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 60893ef4b5edb24790b6d42f446638e79aef74e0 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov <65975574+artifixer@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:49:04 +0300 Subject: [PATCH 38/41] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 199a3d35..74bbce65 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ Diplomacy is a fork of a popular, now defunct Bannerlord mod called DiplomacyFix Authors: -- **Katarn2000x** -- Matthew D. Hall (**zijistark**), +- **Katarn2000x**, +- Matthew D. Hall (**zijistark**), +- Alexey Chernyshov (**artifixer**) License: [MIT License](LICENSE) From f02f41384f186aabf81f4ee866e057976cb6ec95 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Wed, 1 Jun 2022 16:59:41 +0300 Subject: [PATCH 39/41] Some fixes --- src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj | 12 ++++++++++++ .../Patches/RebelKingdomPatches.cs | 2 +- src/Bannerlord.Diplomacy/SubModule.cs | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj index 4ed98a72..e2a795ad 100644 --- a/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj +++ b/src/Bannerlord.Diplomacy/Bannerlord.Diplomacy.csproj @@ -54,4 +54,16 @@ + + + + \$displayname\$ + $(DisplayName) + + + \$mcmversion\$ + $(MCMVersion) + + + diff --git a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs index b9581e38..7785823e 100644 --- a/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs +++ b/src/Bannerlord.Diplomacy/Patches/RebelKingdomPatches.cs @@ -17,7 +17,7 @@ internal sealed class RebelKingdomPatches : PatchClass { protected override IEnumerable Prepare() { - Type conversationBehaviorType = Type.GetType("SandBox.LordConversationsCampaignBehavior, SandBox, Version=1.0.0.0, Culture=neutral")!; + Type conversationBehaviorType = Type.GetType("SandBox.CampaignBehaviors.LordConversationsCampaignBehavior, SandBox, Version=1.0.0.0, Culture=neutral")!; return new Patch[] { new Postfix(nameof(PreventOtherActionsConversation), conversationBehaviorType, "conversation_lord_request_mission_ask_on_condition"), diff --git a/src/Bannerlord.Diplomacy/SubModule.cs b/src/Bannerlord.Diplomacy/SubModule.cs index 5444322f..109fccac 100644 --- a/src/Bannerlord.Diplomacy/SubModule.cs +++ b/src/Bannerlord.Diplomacy/SubModule.cs @@ -51,7 +51,7 @@ protected override void OnSubModuleLoad() Log = LogFactory.Get(); PatchManager.PatchAll(HarmonyDomain); - new Harmony(HarmonyDomain).PatchAll(); // Will only keep this around while I convert all the remaining annotated patches. + //new Harmony(HarmonyDomain).PatchAll(); // Will only keep this around while I convert all the remaining annotated patches. } protected override void OnSubModuleUnloaded() From adbad4fdfcd08e4b443ef52d292ac5ca97fcd32f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 1 Jun 2022 14:01:28 +0000 Subject: [PATCH 40/41] Automated dotnet-format update --- .../Patches/DefaultEncyclopediaFactionPagePatch.cs | 2 +- .../Patches/KingdomDecisionProposalBehaviorPatch.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs index b9f917d8..7ad1c81b 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs @@ -22,7 +22,7 @@ private static IEnumerable PassThroughPostfix(IEnumerable< { foreach (var item in values.ToList()) { - var kingdom = (Kingdom)item.Object; + var kingdom = (Kingdom) item.Object; if (kingdom.IsRebelKingdom() && kingdom.IsEliminated) { continue; diff --git a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs index 5202a40d..8045e4ff 100644 --- a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.Election; using TaleWorlds.CampaignSystem.CampaignBehaviors; +using TaleWorlds.CampaignSystem.Election; namespace Diplomacy.Patches { From 7a21a71689ca90db2500829d9072548d7775af38 Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Wed, 1 Jun 2022 17:06:46 +0300 Subject: [PATCH 41/41] Cleanup --- .../CivilWar/Factions/RebelFaction.cs | 8 ++++---- src/Bannerlord.Diplomacy/ExpansionismManager.cs | 2 +- src/Bannerlord.Diplomacy/Messengers/Messenger.cs | 4 ++-- src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs | 2 +- .../Patches/DefaultEncyclopediaFactionPagePatch.cs | 2 +- .../Patches/KingdomDecisionProposalBehaviorPatch.cs | 2 +- .../Patches/UrbanCharactersCampaignBehaviorPatch.cs | 6 ++++-- src/Bannerlord.Diplomacy/SubModule.cs | 3 --- src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs | 8 ++++---- .../ViewModel/EncyclopediaFactionPageVMExtensionVM.cs | 1 - .../ViewModel/EncyclopediaHeroPageVMExtensionVM.cs | 1 - .../ViewModel/WarExhaustionMapIndicatorItemVM.cs | 1 - .../ViewModelMixin/KingdomTruceItemVmMixin.cs | 2 +- .../ViewModelMixin/KingdomWarItemVMMixin.cs | 2 +- 14 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs index f86baa05..725e8030 100644 --- a/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs +++ b/src/Bannerlord.Diplomacy/CivilWar/Factions/RebelFaction.cs @@ -21,19 +21,19 @@ public abstract class RebelFaction { [SaveableProperty(1)] public Clan SponsorClan { get; private set; } - [SaveableField(2)] [UsedImplicitly] private List _participatingClans; + [SaveableField(2)][UsedImplicitly] private List _participatingClans; - [SaveableProperty(3)] [UsedImplicitly] public Kingdom ParentKingdom { get; private set; } + [SaveableProperty(3)][UsedImplicitly] public Kingdom ParentKingdom { get; private set; } [SaveableProperty(4)] public Kingdom? RebelKingdom { get; private set; } [SaveableProperty(5)] public bool AtWar { get; set; } - [SaveableProperty(6)] [UsedImplicitly] public CampaignTime DateStarted { get; private set; } + [SaveableProperty(6)][UsedImplicitly] public CampaignTime DateStarted { get; private set; } [SaveableProperty(7)] public TextObject Name { get; private set; } - [SaveableProperty(8)] [UsedImplicitly] public Dictionary OriginalFiefOwners { get; private set; } + [SaveableProperty(8)][UsedImplicitly] public Dictionary OriginalFiefOwners { get; private set; } public abstract RebelDemandType RebelDemandType { get; } diff --git a/src/Bannerlord.Diplomacy/ExpansionismManager.cs b/src/Bannerlord.Diplomacy/ExpansionismManager.cs index 8eb98884..99bf8e1f 100644 --- a/src/Bannerlord.Diplomacy/ExpansionismManager.cs +++ b/src/Bannerlord.Diplomacy/ExpansionismManager.cs @@ -12,7 +12,7 @@ namespace Diplomacy { internal sealed class ExpansionismManager { - [SaveableField(1)] [UsedImplicitly] private Dictionary _expansionism; + [SaveableField(1)][UsedImplicitly] private Dictionary _expansionism; public static ExpansionismManager? Instance { get; private set; } public float SiegeExpansionism => Settings.Instance!.ExpanisonismPerSiege; diff --git a/src/Bannerlord.Diplomacy/Messengers/Messenger.cs b/src/Bannerlord.Diplomacy/Messengers/Messenger.cs index 10d62a90..2058e777 100644 --- a/src/Bannerlord.Diplomacy/Messengers/Messenger.cs +++ b/src/Bannerlord.Diplomacy/Messengers/Messenger.cs @@ -8,9 +8,9 @@ namespace Diplomacy.Messengers { internal class Messenger { - [SaveableProperty(1)] [UsedImplicitly] public CampaignTime DispatchTime { get; private set; } + [SaveableProperty(1)][UsedImplicitly] public CampaignTime DispatchTime { get; private set; } - [SaveableProperty(2)] [UsedImplicitly] public Hero TargetHero { get; private set; } + [SaveableProperty(2)][UsedImplicitly] public Hero TargetHero { get; private set; } [SaveableProperty(3)] public Vec2 CurrentPosition { get; set; } diff --git a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs index 9a1064cc..e11a89e0 100644 --- a/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs +++ b/src/Bannerlord.Diplomacy/Messengers/MessengerManager.cs @@ -31,7 +31,7 @@ internal sealed class MessengerManager : IMissionListener private Messenger? _activeMessenger; private Mission? _currentMission; - [SaveableField(1)] [UsedImplicitly] private List _messengers; + [SaveableField(1)][UsedImplicitly] private List _messengers; public MBReadOnlyList Messengers { get; private set; } diff --git a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs index b9f917d8..7ad1c81b 100644 --- a/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/DefaultEncyclopediaFactionPagePatch.cs @@ -22,7 +22,7 @@ private static IEnumerable PassThroughPostfix(IEnumerable< { foreach (var item in values.ToList()) { - var kingdom = (Kingdom)item.Object; + var kingdom = (Kingdom) item.Object; if (kingdom.IsRebelKingdom() && kingdom.IsEliminated) { continue; diff --git a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs index 5202a40d..8045e4ff 100644 --- a/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/KingdomDecisionProposalBehaviorPatch.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using TaleWorlds.CampaignSystem; -using TaleWorlds.CampaignSystem.Election; using TaleWorlds.CampaignSystem.CampaignBehaviors; +using TaleWorlds.CampaignSystem.Election; namespace Diplomacy.Patches { diff --git a/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs b/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs index a6de2633..693043ca 100644 --- a/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs +++ b/src/Bannerlord.Diplomacy/Patches/UrbanCharactersCampaignBehaviorPatch.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +/* +using HarmonyLib; using JetBrains.Annotations; @@ -9,10 +10,11 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.CampaignBehaviors; +*/ +// Outdated since e1.7.2? namespace Diplomacy.Patches { - // Outdated since e1.7.2? /* [HarmonyPatch(typeof(UrbanCharactersCampaignBehavior))] [UsedImplicitly] diff --git a/src/Bannerlord.Diplomacy/SubModule.cs b/src/Bannerlord.Diplomacy/SubModule.cs index 109fccac..71818cf6 100644 --- a/src/Bannerlord.Diplomacy/SubModule.cs +++ b/src/Bannerlord.Diplomacy/SubModule.cs @@ -5,8 +5,6 @@ using Diplomacy.Event; using Diplomacy.PatchTools; -using HarmonyLib; - using Microsoft.Extensions.Logging; using Serilog.Events; @@ -51,7 +49,6 @@ protected override void OnSubModuleLoad() Log = LogFactory.Get(); PatchManager.PatchAll(HarmonyDomain); - //new Harmony(HarmonyDomain).PatchAll(); // Will only keep this around while I convert all the remaining annotated patches. } protected override void OnSubModuleUnloaded() diff --git a/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs b/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs index 84fea040..97f305d7 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/DonateGoldVM.cs @@ -64,7 +64,7 @@ public string RelationGain } } - [DataSourceProperty] [UsedImplicitly] public float MinValue { get; } + [DataSourceProperty][UsedImplicitly] public float MinValue { get; } [DataSourceProperty] public int IntValue @@ -80,11 +80,11 @@ public int IntValue } } - [DataSourceProperty] [UsedImplicitly] public string AcceptText { get; } = new TextObject(StringConstants.Accept).ToString(); + [DataSourceProperty][UsedImplicitly] public string AcceptText { get; } = new TextObject(StringConstants.Accept).ToString(); - [DataSourceProperty] [UsedImplicitly] public string CancelText { get; } = GameTexts.FindText("str_cancel").ToString(); + [DataSourceProperty][UsedImplicitly] public string CancelText { get; } = GameTexts.FindText("str_cancel").ToString(); - [DataSourceProperty] [UsedImplicitly] public string TitleText { get; } = new TextObject("{=Gzq6VHPt}Donate Gold").ToString(); + [DataSourceProperty][UsedImplicitly] public string TitleText { get; } = new TextObject("{=Gzq6VHPt}Donate Gold").ToString(); public DonateGoldVM(Clan clan, Action onFinalize) { diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs index 071c4900..21109581 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaFactionPageVMExtensionVM.cs @@ -8,7 +8,6 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia.EncyclopediaItems; -using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; using TaleWorlds.ScreenSystem; diff --git a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs index a2af8e6c..61d0acbd 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/EncyclopediaHeroPageVMExtensionVM.cs @@ -8,7 +8,6 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.CampaignSystem.ViewModelCollection.Encyclopedia; -using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.Localization; using TaleWorlds.ScreenSystem; diff --git a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs index ec30958c..ceea5dc0 100644 --- a/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs +++ b/src/Bannerlord.Diplomacy/ViewModel/WarExhaustionMapIndicatorItemVM.cs @@ -4,7 +4,6 @@ using TaleWorlds.CampaignSystem; using TaleWorlds.Core; -using TaleWorlds.Engine.Screens; using TaleWorlds.Library; using TaleWorlds.ScreenSystem; diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs index 0409f391..76e08d03 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomTruceItemVmMixin.cs @@ -251,7 +251,7 @@ public BasicTooltipViewModel? NonAggressionPactScoreHint [DataSourceProperty] public string AllianceActionName { get; } - [DataSourceProperty] [UsedImplicitly] public bool IsGoldCostVisible { get; } + [DataSourceProperty][UsedImplicitly] public bool IsGoldCostVisible { get; } [DataSourceProperty] public string NonAggressionPactHelpText { get; } diff --git a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs index 3c4e59c9..a9821c10 100644 --- a/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs +++ b/src/Bannerlord.Diplomacy/ViewModelMixin/KingdomWarItemVMMixin.cs @@ -60,7 +60,7 @@ public int GoldCost } } - [DataSourceProperty] [UsedImplicitly] public bool IsGoldCostVisible { get; } = true; + [DataSourceProperty][UsedImplicitly] public bool IsGoldCostVisible { get; } = true; [DataSourceProperty] public bool IsOptionAvailable