Interkarma / daggerfall-unity

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

Removed the "protected internal" keywords from the DaggerfallTravelPopUp.EndPos setter. #2697

Open RedRoryOTheGlen opened 2 months ago

RedRoryOTheGlen commented 2 months ago

Allows mods to change the endPos of DaggerfallTravelPopUp.

Video of proof-of-concept fast travel encounter mod I was working on. If it decides to roll an encounter, it will change the destination of the travel in the DaggerfallTravelPopUp.OnPreFastTravel event. Nothing fancy. This threw me for a loop because it pretty much worked flawlessly as a virtual mod and only caused an error when building the DFMOD.

KABoissonneault commented 2 months ago

For the "works in editor, fails in dfmod" issue, you only need to remove the internal, which I'm fine with removing (I don't think it's a great C# feature when working with Unity). I'd rather not remove the protected unless you had some justification for it.

RedRoryOTheGlen commented 2 months ago

image

I tried it with the EndPos setter as "protected" only and now even the DaggerfallTravelMapWindow set throws an error in the Editor

KABoissonneault commented 2 months ago

Okay I admit the protected internal has me surprised, this seems to work as just internal. Removing both is fine then, if even DFU uses it as if it were public.