Started messing arround with the inventory textures today to see what I can do and made this.
I'm still wondering tho If it's possible for me to recolor the text in the info box and the text above the bag icon.
Oblivion Theme UI
- polarstar
- Posts: 34
- Joined: Tue Dec 03, 2019 4:51 pm
Oblivion Theme UI
- Attachments
-
- Screenshot 2021-02-13 213931.png (686.5 KiB) Viewed 2029 times
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Oblivion Theme UI
I'll look into it.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- haloterm
- Posts: 391
- Joined: Sat Feb 16, 2019 5:21 am
Re: Oblivion Theme UI
This looks quite nice!
Did you also make compatible travel maps, character screens, etc.?
Did you also make compatible travel maps, character screens, etc.?
- polarstar
- Posts: 34
- Joined: Tue Dec 03, 2019 4:51 pm
-
- Posts: 1403
- Joined: Mon Aug 12, 2019 4:32 pm
- Contact:
Re: Oblivion Theme UI
The text above the bag for item weight is hidden within this inventory object and is not accessible. This is all within the DaggerfallInventoryWindow.cs object.
The funny thing is the object that updates the panel when you have a wagon is override accessible, just not the player backpack one.
Also, the info panel needs to be turned into a accessible override. As of now, it is protected, so you cannot change it using a traditional override hook.
Both need changed to overrides for modders to access requested stuff.
Code: Select all
protected virtual void UpdateLocalTargetIcon()
{
// Never changes on inventory window.
localTargetIconPanel.BackgroundTexture = DaggerfallUnity.ItemHelper.GetContainerImage(InventoryContainerImages.Backpack).texture;
float weight = GetCarriedWeight();
localTargetIconLabel.Text = String.Format(weight % 1 == 0 ? "{0:F0} / {1}" : "{0:F2} / {1}", weight, PlayerEntity.MaxEncumbrance);
}
Also, the info panel needs to be turned into a accessible override. As of now, it is protected, so you cannot change it using a traditional override hook.
Code: Select all
protected void SetupItemInfoPanel()
{
itemInfoPanelLabel = new MultiFormatTextLabel
{
Position = new Vector2(2, 0),
VerticalAlignment = VerticalAlignment.Middle,
MinTextureDimTextLabel = 16, // important to prevent scaling issues for single text lines
TextScale = 0.43f,
MaxTextWidth = 37,
WrapText = true,
WrapWords = true,
ExtraLeading = 3, // spacing between info panel elements
TextColor = new Color32(250, 250, 220, 255),
ShadowPosition = new Vector2(0.5f, 0.5f),
ShadowColor = DaggerfallUI.DaggerfallAlternateShadowColor1
};
itemInfoPanel.BackgroundTexture = infoTexture;
itemInfoPanel.Components.Add(itemInfoPanelLabel);
}
Code: Select all
protected override void SetupItemInfoPanel()
{
...
}
My Daggerfall Mod Github: l3lessed DFU Mod Github
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
My Beth Mods: l3lessed Nexus Page
Daggerfall Unity mods: Combat Overhaul Mod
Enjoy the free work I'm doing? Consider lending your support.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Oblivion Theme UI
So some of this is easy to do right now as the df ui manager class has static colour definitions which a mod can change. This approach will allow the colours to be changed for the entire UI globally, and I think is a better approach than doing each instance individually.
As you can see I changed the text colour for most of the inventory screen with just 2 lines of code, one for main colour and other for shadow as you can see below:
You may also know I am not good at defining nice colours!
There is one place where this will not work, in code I implemented and I neglegted to add a colour definition into the ui manager. I'll submit a PR to change this since the UI being replacible is not much use if you cannot also change the text colours. So it's just the info panel text that uses a hardcoded colour. Once I changed that I am easily able to override all the colours as you can see below:
As you can see I changed the text colour for most of the inventory screen with just 2 lines of code, one for main colour and other for shadow as you can see below:
You may also know I am not good at defining nice colours!
There is one place where this will not work, in code I implemented and I neglegted to add a colour definition into the ui manager. I'll submit a PR to change this since the UI being replacible is not much use if you cannot also change the text colours. So it's just the info panel text that uses a hardcoded colour. Once I changed that I am easily able to override all the colours as you can see below:
- Attachments
-
- colors.JPG (181.69 KiB) Viewed 1886 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Oblivion Theme UI
There's one area that could be problematic which is tool tips. The colours for them are taken from player settings which you wont have any control over unfortunately. I suppose the best you can do is to suggest values for players to use. Either that or have the mod change whatever setting players have configured.. which is not the politest behaviour.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods