Closed Will-GuiSKJ closed 4 years ago
Hi William,
Perhaps there are some mistakes in your movie file. Then it will not be displayed. To test this, try replacing the movie with another one that works. I checked the functionality of the simplest layer, which had a single button. To display a layer you need to:
You may find useful information here:
https://docs.bannerlordmodding.com/_tutorials/modding-gauntlet-without-csharp.html#important https://docs.bannerlordmodding.com/_gauntlet/screenbase.html
I know that all my Behaviour, Layer and ViewModel C# logic is running, but nothing shows up.
I have a simple Prefab and Brush based on your earlier work, when you just had those "troope_tier_2" buttons on each slot. Here is my current prefab
<?xml version="1.0" encoding="utf-8" ?>
<Prefab>
<Constants />
<VisualDefinitions />
<Window>
<Widget DoNotAcceptEvents="true" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent">
<Children>
<ButtonWidget Id="HelmButton" Command.Click="ExecuteEquipBestHelm" IsEnabled="@IsHelmButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="250" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="CloakButton" Command.Click="ExecuteEquipBestCloak" IsEnabled="@IsCloakButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="335" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="ArmorButton" Command.Click="ExecuteEquipBestArmor" IsEnabled="@IsArmorButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="420" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="GloveButton" Command.Click="ExecuteEquipBestGlove" IsEnabled="@IsGloveButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="505" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="BootButton" Command.Click="ExecuteEquipBestBoot" IsEnabled="@IsBootButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="590" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="MountButton" Command.Click="ExecuteEquipBestMount" IsEnabled="@IsMountButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="710" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="HarnessButton" Command.Click="ExecuteEquipBestHarness" IsEnabled="@IsHarnessButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Left" MarginLeft="585" MarginTop="795" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="Weapon1Button" Command.Click="ExecuteEquipBestWeapon1" IsEnabled="@IsWeapon1ButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Right" MarginRight="670" MarginTop="335" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="Weapon2Button" Command.Click="ExecuteEquipBestWeapon2" IsEnabled="@IsWeapon2ButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Right" MarginRight="670" MarginTop="420" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="Weapon3Button" Command.Click="ExecuteEquipBestWeapon3" IsEnabled="@IsWeapon3ButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Right" MarginRight="670" MarginTop="505" Brush="Inventory.UpgradeButton"/>
<ButtonWidget Id="Weapon4Button" Command.Click="ExecuteEquipBestWeapon4" IsEnabled="@IsWeapon4ButtonEnabled" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="35" SuggestedHeight="35" HorizontalAlignment="Right" MarginRight="670" MarginTop="590" Brush="Inventory.UpgradeButton"/>
</Children>
</Widget>
</Window>
</Prefab>
Sorry for the long answer. Show the xml code in which you describe the brush "Inventory.Upgrade Button". Also make sure that all variables specified in IsEnabled="" are true, otherwise the buttons will be disabled (visibility depends on the brush description). I checked myself, everything is correct, so the problem is in the description of the brush, or in the variables.
Hi Aleksey, I am trying to learn how to mod bannerlord and I have been trying to rebuilt your mod myself, though much simpler.
I am having the hardest time figuring out why my Inventory prefab is not showing in the screen even though I now my Layer is being added.
If you wouldn't mind helping me, it would be great help. Documentation online is so sparse that I don't know what else to try.