Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.73k stars 331 forks source link

Added ability to move text labels. #2555

Closed Jagget closed 9 months ago

Jagget commented 10 months ago

Reason

It's not a secret that text in different languages have different lengths. Hence, we need the ability to move labels. At least through mods. But currently we cannot do that easily, because these fields are private. And instead of quick extension of the dialog class we must re-implement the whole window logic.

To be able to do something simple like

protected override void Setup()
{
    base.Setup();
    // Setup labels
    nameLabel.Position = new Vector2(34, 4);
    raceLabel.Position = new Vector2(40, 14);
    classLabel.Position = new Vector2(47, 24);
    levelLabel.Position = new Vector2(54, 34);
    goldLabel.Position = new Vector2(53, 44);
    fatigueLabel.Position = new Vector2(42, 54);
    healthLabel.Position = new Vector2(48, 64);
    encumbranceLabel.Position = new Vector2(68, 74);
}

or

protected override void Setup()
{
    base.Setup();
    // Setup labels
    accountAmount.Position = new Vector2(126, 14);
    inventoryAmount.Position = new Vector2(141, 24);
    loanAmountDue.Position = new Vector2(71, 34);
    loanDueBy.Position = new Vector2(71, 44);
}

we need to change the protection level on these labels.

Result

Before:

Screenshot 2023-12-18 124824 Screenshot 2023-12-18 130222

After

Screenshot 2023-12-18 124740 Screenshot 2023-12-18 131827