Daggerfall Unity API Documentation

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
TheLacus
Posts: 1010
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Daggerfall Unity API Documentation

Post by TheLacus » Mon Dec 02, 2019 2:16 pm

As the community of Daggerfall Unity grows, there are more people that wish to start making mods. I noticed that even with my efforts at maintaining a documentation on workshop website, there is some confusion on where to find informations beside the basic tutorials. Something that I think is being overlooked is that, in addition to website and forums, we also have a code documentation, composed of all xml summaries; so I decided to try and give it proper spotlight by making actual API docs out of it using Docfx. Many open source projects show it on the web pages offered by github.

Anyway, this is how it looks. There are many public members without a description but is mostly because they are used for internal interaction (where internal modifier might as well have been used). Methods and properties with a proper xml documentation are shown like in these screenshots:

dfunity_docfx.png
dfunity_docfx.png (102.71 KiB) Viewed 249 times
dfunity_docfx_weather.png
dfunity_docfx_weather.png (56.16 KiB) Viewed 249 times

You can try it as a static website to be opened locally with any browser.
download

Instructions:
  • Extract zip package.
  • Open index.html in a browser.
  • Click button API Documentation.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
TheLacus
Posts: 1010
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Daggerfall Unity API Documentation

Post by TheLacus » Tue Dec 03, 2019 9:35 pm

I went ahead and uploaded it on github. This is the repository and this is Pages. Interkarma, what do you think about this?
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Interkarma
Posts: 5037
Joined: Sun Mar 22, 2015 1:51 am

Re: Daggerfall Unity API Documentation

Post by Interkarma » Tue Dec 03, 2019 10:27 pm

This is excellent work! To start with, I'll add a link to your docs from the links sidebar on dfworkshop.net. :)

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

Re: Daggerfall Unity API Documentation

Post by Hazelnut » Wed Dec 04, 2019 9:47 am

Nice. Wonder if there's a way to get the side nav panel to be wider... it's truncating most of the packages and theres loads of space on most peoples' screens just unused.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
TheLacus
Posts: 1010
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Daggerfall Unity API Documentation

Post by TheLacus » Wed Dec 04, 2019 7:43 pm

Interkarma wrote:
Tue Dec 03, 2019 10:27 pm
This is excellent work! To start with, I'll add a link to your docs from the links sidebar on dfworkshop.net. :)
Thanks, that's awesome!
Hazelnut wrote:
Wed Dec 04, 2019 9:47 am
Nice. Wonder if there's a way to get the side nav panel to be wider... it's truncating most of the packages and theres loads of space on most peoples' screens just unused.
I was using a template with static toc which is suitable for local preview, but it seems not to be updated. I switched back to default theme with better handling of long namespaces, and this also reduced repository size. The toc being inserted in html files was increasing it much more than i expected :shock:
Anyway, lines now breaks at dots inside long names so the full text is visible:

du_docs.png
du_docs.png (121.65 KiB) Viewed 148 times
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
Rand
Posts: 68
Joined: Sat Nov 23, 2019 5:10 am
Location: Canada

Re: Daggerfall Unity API Documentation

Post by Rand » Sun Dec 08, 2019 8:10 pm

That's more readable, but I'm still annoyed that (like most things online, including DFworkshop) it still only uses the middle 60% of my screen.

BadLuckBurt
Posts: 168
Joined: Sun Nov 05, 2017 8:30 pm

Re: Daggerfall Unity API Documentation

Post by BadLuckBurt » Sun Dec 08, 2019 8:28 pm

Rand wrote:
Sun Dec 08, 2019 8:10 pm
That's more readable, but I'm still annoyed that (like most things online, including DFworkshop) it still only uses the middle 60% of my screen.
It doesn't help much but Ctrl + Scrollwheel to zoom in the page will make it use more than 60%. Alternatively, the stylesheet needs to be adjusted to make it stretch more to a full window width. I'll have a look later this week.

User avatar
TheLacus
Posts: 1010
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Daggerfall Unity API Documentation

Post by TheLacus » Sun Dec 08, 2019 9:59 pm

I've added support for external links to Unity API. It was already working for C# namespaces, now is also working for UnityEngine (and all namespaces with the same first dotted name). This means that if you click on Int32 you are redirected to .NET docs, if you click on Matrix4x4 you go on Unity website and so on.

xrefmap_screen.png
xrefmap_screen.png (24.27 KiB) Viewed 42 times
If someome is interested, this is how i exported type data from unity assemblies. Unity docs follows a peculiar pattern where the url is based on the fullname without the first part. This means that UnityEngine.Matrix4x4 is found at ScriptReference/Matrix4x4.html but also that UnityEngine.ParticleSystem.CollisionModule is at ScriptReference/ParticleSystem.CollisionModule.html and of course UnityEditor.AI.NavMeshEditorHelpers is also at ScriptReference/AI.NavMeshEditorHelpers.html. Hopefully this is always consistent and there are no broken links. Something that bothers me is that i couldn't associate UnityEngine.Object. I wanted to edit it manually to include namespace and not confuse it with System.Object, but it just doesn't work at all.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

User avatar
TheLacus
Posts: 1010
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Daggerfall Unity API Documentation

Post by TheLacus » Sun Dec 08, 2019 10:02 pm

Rand wrote:
Sun Dec 08, 2019 8:10 pm
That's more readable, but I'm still annoyed that (like most things online, including DFworkshop) it still only uses the middle 60% of my screen.
I think the main column looks fine but the index on the left should be wider. Like .NET docs for example.
Mod System documentation - Learn how to create mods for Daggerfall Unity.
Modder Discussion - General help and discussion for the mod system.
Github Issues - Submit a bug report for the game, including the mod system.

Post Reply