[MOD] Retro-Frame

Show off your mod creations or just a work in progress.
User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

[MOD] Retro-Frame

Post by DunnyOfPenwick »

2024_01_27_13_46_28.jpg
2024_01_27_13_46_28.jpg (205.97 KiB) Viewed 934 times
Hey all, just dropped the Retro-Frame UI mod over on Nexus.
The source code is available on Github.

This mod:
  • moves HUD info to the unused edges of the screen
  • Adds hotkey functionality, including custom actions supplied by other mods
  • adds an error log indicator and display
There is the capability for other mods to add custom hotkey handlers.
This feature, coupled with the error log viewer, is particularly useful for testing mods.
You could create a testing mod and register custom hotkey handlers to create enemies, modify character status, etc., then activate your mod whenever you want to test other mods you are developing.
Here is some explanatory sample code for a test mod:

Code: Select all

        void Start()
        {
            Debug.Log("Start(): MyTestingMod");

            Mod retroFrame = ModManager.Instance.GetMod("Retro-Frame");
            const string registerHotkey = "registerCustomHotkeyHandler";

            retroFrame.MessageReceiver(registerHotkey, ("Disease", Texture2D.redTexture), Inflict);
            retroFrame.MessageReceiver(registerHotkey, ("Poison", Texture2D.redTexture), Inflict);
            retroFrame.MessageReceiver(registerHotkey, ("Vampirism", Texture2D.redTexture), Inflict);
            retroFrame.MessageReceiver(registerHotkey, ("Lycanthrope", Texture2D.redTexture), Inflict);
            retroFrame.MessageReceiver(registerHotkey, ("Mage", Texture2D.redTexture), CreateEnemy);
            retroFrame.MessageReceiver(registerHotkey, ("Skeleton", Texture2D.redTexture), CreateEnemy);

            Debug.Log("Finished Start(): MyTestingMod");
        }

        
        void Inflict(string description, object hotkeyIndex)
        {
            PlayerEntity player = GameManager.Instance.PlayerEntity;
            EntityEffectBundle bundle;

            switch (description.ToLower())
            {
                case "poison":
                    FormulaHelper.InflictPoison(player, player, DaggerfallWorkshop.Game.Items.Poisons.Moonseed, true);
                    break;
                case "disease":
                    FormulaHelper.InflictDisease(player, player, new Diseases[] { Diseases.BloodRot });
                    break;
                case "vampirism":
                    bundle = GameManager.Instance.PlayerEffectManager.CreateVampirismDisease();
                    GameManager.Instance.PlayerEffectManager.AssignBundle(bundle, AssignBundleFlags.SpecialInfection);
                    break;
                case "lycanthrope":
                    bundle = GameManager.Instance.PlayerEffectManager.CreateLycanthropyDisease(LycanthropyTypes.Werewolf);
                    GameManager.Instance.PlayerEffectManager.AssignBundle(bundle, AssignBundleFlags.SpecialInfection);
                    break;
                default:
                    break;
            }
        }




        void CreateEnemy(string description, object hotkeyIndex)
        {
            MobileTypes mobileType;

            switch (description.ToLower())
            {
                case "mage":
                    mobileType = MobileTypes.Mage;
                    break;
                case "skeleton":
                    mobileType = MobileTypes.SkeletalWarrior;
                    break;
                default:
                    mobileType = MobileTypes.Rat;
                    break;
            }
            Transform parent = GameObjectHelper.GetBestParent();

            Vector3 location = GameManager.Instance.PlayerObject.transform.position;
            location += GameManager.Instance.PlayerObject.transform.forward * 2;

            string name = mobileType.ToString();

            GameObject go = GameObjectHelper.InstantiatePrefab(DaggerfallUnity.Instance.Option_EnemyPrefab.gameObject, name, parent, location);
            SetupDemoEnemy setupEnemy = go.GetComponent<SetupDemoEnemy>();

            setupEnemy.ApplyEnemySettings(mobileType, MobileReactions.Hostile, MobileGender.Female, 0, false);

            GameManager.Instance.RaiseOnEnemySpawnEvent(go);

            DaggerfallEntityBehaviour behaviour = setupEnemy.GetComponent<DaggerfallEntityBehaviour>();
            EnemyEntity enemy = behaviour.Entity as EnemyEntity;
            DaggerfallUI.AddHUDText($"Spawned {enemy.Name}({name})");

            DaggerfallEnemy dfEnemy = behaviour.GetComponent<DaggerfallEnemy>();
            dfEnemy.LoadID = DaggerfallUnity.NextUID;

        }

Update: Added the ability for other mods to grab and modify the content panel. See the github Readme for details.
Last edited by DunnyOfPenwick on Tue Jan 30, 2024 1:15 pm, edited 1 time in total.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: [MOD] Retro-Frame

Post by Magicono43 »

Looks neat, me personally I'm usually content with the more minimalistic HUD options, but I think this is definitely a improvement over the vanilla "Big" HUD placement.

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [MOD] Retro-Frame

Post by King of Worms »

Magicono43 wrote: Sat Jan 27, 2024 8:10 pm Looks neat, me personally I'm usually content with the more minimalistic HUD options, but I think this is definitely a improvement over the vanilla "Big" HUD placement.
Its all about that 4:3 aspect ratio :) IMO this is quite a clever mod. Its the ultimate way to play DFU in retro mode, 4:3 aspect, same as the original was, and than using the free space on the monitor, to show the hud on the sides.

It also has the charm of the old HUDs of RPGs like Ultima Underworld etc. I really like this' :geek:

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Retro-Frame

Post by DunnyOfPenwick »

It seemed like the natural way to implement an old 4:3 game in a newer widescreen format.
That's why I used the phrase 'As Julianos decreed', meaning 'as logic dictates'.

I've done limited testing with DREAM at this point. I did notice a technical issue when using concealment spells.
My code copies and creates alternate versions of character portrait in the upper left frame when shadow/chameleon is used. In Dream the character portrait gets replaced by a grey rectangle. I haven't looked into it but I'm guessing there's a mechanism preventing me from grabbing texture pixels?

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: [MOD] Retro-Frame

Post by Ralzar »

Is this compatible with setting DFU in Retro Mode?

And if so, is it possible to get a Ultr Wide version of it? I play in 16:9 retro mode and would love to use the black bare on the ides for something :D

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Retro-Frame

Post by DunnyOfPenwick »

I'm planning on dropping an update in the coming week.
I'll be adding the capability for other mods to retrieve the fullscreen overlay panel using a messaging callback.
You'll be able to manipulate the UI content however you want.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Retro-Frame

Post by DunnyOfPenwick »

Update dropped.
Check the Readme on the github for details about changing the overlay panel.

User avatar
jayhova
Posts: 924
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: [MOD] Retro-Frame

Post by jayhova »

I don't have a retro-nostalgia fetish when it comes to Daggerfall or really any game. I dream about all games being even better while I'm playing them. Daggerfall certainly was no exception to this. DF was buggy when it came out and was not really finished.

All that being said, I really like this mod. The UI is a weird fusion of 90s nostalgia enabled via a modern game interface and hardware. It's a bit like running a Daggerfall emulator in Daggerfall Unity
Remember always 'What would Julian Do?'.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Retro-Frame

Post by DunnyOfPenwick »

My main goal was to make use of the wasted space on the sides. I just added some more code to allow access to the content panel, so other modders can add updated graphics if they wish.

User avatar
MrFlibble
Posts: 411
Joined: Sat Jan 27, 2018 10:43 am

Re: [MOD] Retro-Frame

Post by MrFlibble »

I definitely love the look! What a clever way to reimagine the HUD! Reminds me of those party-based RPGs like Wizardry and stuff. Great job!

Post Reply