Oblivion Theme UI

Show off your mod creations or just a work in progress.
Post Reply
User avatar
polarstar
Posts: 26
Joined: Tue Dec 03, 2019 4:51 pm

Oblivion Theme UI

Post by polarstar »

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.
Attachments
Screenshot 2021-02-13 213931.png
Screenshot 2021-02-13 213931.png (686.5 KiB) Viewed 372 times

User avatar
Hazelnut
Posts: 2665
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Oblivion Theme UI

Post by Hazelnut »

polarstar wrote: Sat Feb 13, 2021 9:11 pm 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.
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: 220
Joined: Sat Feb 16, 2019 5:21 am

Re: Oblivion Theme UI

Post by haloterm »

This looks quite nice!

Did you also make compatible travel maps, character screens, etc.?

User avatar
polarstar
Posts: 26
Joined: Tue Dec 03, 2019 4:51 pm

Re: Oblivion Theme UI

Post by polarstar »

haloterm wrote: Sun Feb 14, 2021 9:05 am Did you also make compatible travel maps, character screens, etc.?
This is work in progress so at the moment this is all I have but the plan is the replace everything I can.

l3lessed
Posts: 760
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Oblivion Theme UI

Post by l3lessed »

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.

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);
        }
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.

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);
        }
Both need changed to overrides for modders to access requested stuff.

Code: Select all

protected override void SetupItemInfoPanel() 
{
...
}
My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Hazelnut
Posts: 2665
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Oblivion Theme UI

Post by Hazelnut »

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:

colors.JPG
colors.JPG (126.5 KiB) Viewed 233 times
You may also know I am not good at defining nice colours! :D

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
colors.JPG (181.69 KiB) Viewed 229 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 2665
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Oblivion Theme UI

Post by Hazelnut »

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

Post Reply