Jump to content

PerkRole text on CharacterDevelopment Screen


AlcoholV

Recommended Posts

I have completed a modification that shows the Perkrole directly in the Character UI as shown in the picture.

However, I don't do c# these days and it's a hassle to install VS and create a new project myself. Can someone make a mod and distribute it for everyone?


Here's the file I modified and the code changes I made to it.

https://drive.google.com/file/d/10O3oH-IhIz1Ioetz0LAPQGZvPw0d0gRP/view?usp=drive_link

``` TaleWorlds.CampaignSystem.ViewModelCollection.dll
using TaleWorlds.Localization;

namespace TaleWorlds.CampaignSystem.ViewModelCollection.CharacterDeveloper{
    public partial class PerkVM : ViewMode{
        public PerkVM(PerkObject perk, bool isAvailable...){
            ...
            TextObject combinedPerkRoleText = CampaignUIHelper.GetCombinedPerkRoleText(this.Perk);
            this.PerkRole = (((combinedPerkRoleText != null) ? combinedPerkRoleText.ToString().Substring(1, combinedPerkRoleText.ToString().Length - 2).Replace("/", "\n") : null) ?? "");
            this.RefreshState();
        }
    }
}
[DataSourceProperty]
public string PerkRole
{
    get
    {
        return this._perkRole;
    }
    set
    {
        if (value != this._perkRole)
        {
            this._perkRole = value;
            base.OnPropertyChangedWithValue<string>(value, "PerkRole");
        }
    }
}

private string _perkRole;
```
```CharacterDeveloper.xml
<CharacterDeveloperPerksContainerWidget>
    ......
    <TextWidget WidthSizePolicy="CoverChildren" HeightSizePolicy="CoverChildren" HorizontalAlignment="Center" VerticalAlignment="Bottom" Brush.FontSize="14" PositionYOffset="10" Text="@PerkRole" />
    ......
<CharacterDeveloperPerksContainerWidget>

```

 


It also fixes a bug that caused the weapon selection to randomize in the smelting UI. A mod to fix this bug would be very nice, it would make smelting really convenient.


TaleWorlds.CampaignSystem.ViewModelCollection.WeaponCrafting.Smelting
- SmeltingVM
    - SmeltSelectedItems(Hero currentCraftingHero)

resize_20240118071216_1.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...