Can't override trade window

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Post Reply
User avatar
Posts: 222
Joined: Mon Mar 23, 2015 5:47 pm

Can't override trade window

Post by Uncanny_Valley »

So I'm been trying to modify the trade window, by overriding it with a new one and using RegisterCustomUIWindow, for my UI mod. But I get the following error message when I do so.

Code: Select all

Error (): Constant does not match the defined type.

UnityEngine.Debug:LogError (object)
DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:CompileFromSourceAssets (string[]) (at Assets/Game/Addons/ModSupport/ModManager.cs:774)
DaggerfallWorkshop.Game.Utility.ModSupport.Mod:CompileSourceToAssemblies () (at Assets/Game/Addons/ModSupport/Mod.cs:974)
DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:Init () (at Assets/Game/Addons/ModSupport/ModManager.cs:698)
DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:StateManager_OnStateChange (DaggerfallWorkshop.Game.StateManager/StateTypes) (at Assets/Game/Addons/ModSupport/ModManager.cs:1287)
DaggerfallWorkshop.Game.StateManager:TriggerStateChange (DaggerfallWorkshop.Game.StateManager/StateTypes) (at Assets/Scripts/Game/StateManager.cs:153)
DaggerfallWorkshop.Game.StateManager:ChangeState (DaggerfallWorkshop.Game.StateManager/StateTypes) (at Assets/Scripts/Game/StateManager.cs:91)
DaggerfallWorkshop.Game.StateManager:.ctor (DaggerfallWorkshop.Game.StateManager/StateTypes) (at Assets/Scripts/Game/StateManager.cs:57)
DaggerfallWorkshop.Game.GameManager:get_StateManager () (at Assets/Scripts/Game/GameManager.cs:118)
DaggerfallWorkshop.Game.Entity.PlayerEntity:Update (DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour) (at Assets/Scripts/Game/Entities/PlayerEntity.cs:373)
DaggerfallWorkshop.Game.Entity.DaggerfallEntityBehaviour:Update () (at Assets/Scripts/Game/Entities/DaggerfallEntityBehaviour.cs:81)
I don't understand what the issue is exactly but I managed to pinpoint it being related to the constructor and specifically the WindowModes enum.

Code: Select all

public UTradeWindow(IUserInterfaceManager uiManager, DaggerfallBaseWindow previous = null, WindowModes windowMode = WindowModes.Sell, IGuild guild = null) : base(uiManager, previous)

Anyone have any idea of what the issue might be?

User avatar
Posts: 2873
Joined: Sat Aug 26, 2017 2:46 pm

Re: Can't override trade window

Post by Hazelnut »

Hi UV. Yeah the mcs runtime complier can't do enums so you will have to use the pre-compile option when building the dfmod.

I assume it all works when running as a virtual mod?

EDIT: just saw the date you posted this query. Sorry I've not been keeping up as much recently. :oops:
See my mod code for examples of how to change various aspects of DFU:

Post Reply