Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
155 stars 50 forks source link

Docs reference findClass, which is deprecated #296

Closed FeepingCreature closed 2 days ago

FeepingCreature commented 6 months ago

On development, the docs for PCIDevices use findClass("NetworkCard"). But when you try that, you get a deprecation warning to "use 'classes' global library instead". The 'classes' API does not seem to be documented.

EpocDotFr commented 5 months ago

I have read the source code of that classes global API, maybe they are now indexed by their name like classes['NetworkCard'], but I'm not sure. I'll try this tonight.

EpocDotFr commented 5 months ago

It works:

image

RozeDoyanawa commented 5 months ago

classes is a list of all available classes. you can use it as a lua table by accessing with [] or by dot, if the name is c++ name compliant, that is, no special characters or dashes. Eg. classes.NetworkCard works too. We can not publish a complete list of what classes contains, as it depends on what mods you have installed.

RozeDoyanawa commented 1 week ago

I'll drop a link to the docs op mentioned, as pana is, afaik, the only one who can update the docs: https://docs.ficsit.app/ficsit-networks/latest/lua/examples/PCIDevices.html

Panakotta00 commented 2 days ago

Will be updated with next mod release.