I had assumed that the simple value fields (ints, strings) where coming back with the LuaObject and it was only references to other LuaObjects that were obtained on access.Bilka:
Every single thing you access on a LuaObject is given to you upon request, nothing comes with the original object
New API Docs website
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: New API Docs website
The process that a mod makes a request via the API (either function or to get/set a field) would be helpful. I got the below answer via Discord from Bilka that all LuaObject instances returned to my mod from the API have 0 field data. So for UPS optimised mods we should really be caching every field's value where possible when reused for lowest UPS cost. Especially important when on_tick events are being used.
Re: New API Docs website
On LuaTransportLine and probably other pages, the index() and length() operators are not defined properly.
Compare to the old API:operator length :: uint [R] Get the number of items on this transport line.
operator index :: LuaItemStack [R] The indexing operator.
operator # :: uint [R] Get the number of items on this transport line.
operator [] :: LuaItemStack [R] The indexing operator.
-
- Fast Inserter
- Posts: 214
- Joined: Fri Oct 05, 2018 4:34 pm
- Contact:
Re: New API Docs website
I made a video to demonstrate just how badly the new site design performs on my phone compared to the old one, and with the box shadows removed.
https://youtu.be/xjCwI-8wy2g
This is also how the main site, blog, and mod portal performs on my phone. In my opinion it's not a great look for a game that touts as being highly optimized to have a site design this slugging. And again, you can get these fancy looking borders without performing like a dumpster fire using border images instead of abusing box shadows.
https://youtu.be/xjCwI-8wy2g
This is also how the main site, blog, and mod portal performs on my phone. In my opinion it's not a great look for a game that touts as being highly optimized to have a site design this slugging. And again, you can get these fancy looking borders without performing like a dumpster fire using border images instead of abusing box shadows.
Re: New API Docs website
So, today the way to obtain a link to method/property from its entry has changed from a neat link on the name itself to a pretentiousfancy little chain icon. Can we have the old one back? Nothing prevents having both.
Re: New API Docs website
The name in the method list at the top of the page is still a link and works like it always does. The chain icon at the bottom of the page is just a bonus.
The confusing part is that the name+link at the top of the page is the same color as the name+description at the bottom of the page, but only one of them is clickable.
Re: New API Docs website
But you have to scroll to the top. What I mean is the name "at the bottom of the page", as you put it, was also a link and now isn't.DaveMcW wrote: ↑Fri Jan 14, 2022 12:41 am The name in the method list at the top of the page is still a link and works like it always does. The chain icon at the bottom of the page is just a bonus.
The confusing part is that the name+link at the top of the page is the same color as the name+description at the bottom of the page, but only one of them is clickable.
Re: New API Docs website
I was having a problem with it, often you want to copy-paste exact names of variables and events, and when it was a link it would keep jumping the page around instead of letting me select it and copy
Re: New API Docs website
so put a little clipboard icon and copy it when you click THAT.
Re: New API Docs website
That's a good point, though in my experience links only cause issue when you want to select in the middle of them. Shouldn't matter when selecting the entire link text.
-
- Long Handed Inserter
- Posts: 69
- Joined: Tue Apr 17, 2018 11:45 pm
- Contact:
Re: New API Docs website
I find browser extensions like Copy Link or Copy Link Text to be invaluable. Also, holding alt will allow you to select text without following links (or sending JS events for that click at all I think). I'm not arguing to change the site back, just saying.
Re: New API Docs website
Thanks for the hint, I've just installed Copy Link Text!coderpatsy wrote: ↑Sat Jan 15, 2022 7:40 am I find browser extensions like Copy Link or Copy Link Text to be invaluable.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: New API Docs website
Invaluable tip! Thank you! Actually I have this problem quite frequently and this will optimize my timecoderpatsy wrote: ↑Sat Jan 15, 2022 7:40 amhout following links (or sending JS events for that click at all I think).
(They say perfection is just doing a lot of little things right)
Re: New API Docs website
Good to know. Would have been good for this if it also didn't download the link.coderpatsy wrote: ↑Sat Jan 15, 2022 7:40 am Also, holding alt will allow you to select text without following links (or sending JS events for that click at all I think).
-
- Long Handed Inserter
- Posts: 69
- Joined: Tue Apr 17, 2018 11:45 pm
- Contact:
Re: New API Docs website
Does for me.
Re: New API Docs website
I just disabled box shadows, gives me about 7 more FPS (Firefox) when scrolling (but its still above 150fps average on an i7 7700k and GTX 1060), but more importantly it just feels smoother.
With original page, it sometimes stutters/hitches when you start scrolling. With the shadows disables everything is instant, like playing a game at 0 input lag compared to mediocre input lag.
I used Stylus to edit the CSS:
With original page, it sometimes stutters/hitches when you start scrolling. With the shadows disables everything is instant, like playing a game at 0 input lag compared to mediocre input lag.
I used Stylus to edit the CSS:
Code: Select all
* {
box-shadow: none !important;
}
-
- Fast Inserter
- Posts: 214
- Joined: Fri Oct 05, 2018 4:34 pm
- Contact:
Re: New API Docs website
I already demonstrated this in the video I posted in previous post. But unlike your GTX 1060, my phone dips to 1fps scrolling and can take more than 10 seconds to render the page after scrolling far.
I made a modifying proxy for the lua api site that removes the box shadows for this video, it's still up at http://lua-api.hornwitser.no/latest/
- Muppet9010
- Filter Inserter
- Posts: 279
- Joined: Sat Dec 09, 2017 6:01 pm
- Contact:
Re: New API Docs website
On the main page (https://lua-api.factorio.com/latest/index.html) the Classes header isn't clickable, but the Events header further down the page is.
There is the Classes page that I assume the header should link to: https://lua-api.factorio.com/latest/Classes.html
Re: New API Docs website
Can you add `spellcheck="false"` to the search input please? When I search for words (or parts of words) it suggests different words, and when I click away (on the search result) it automatically 'corrects' the word, which then changes the search results, so I don't get sent to the page I clicked on
See the following video (safari 15.4):
See the following video (safari 15.4):
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: New API Docs website
You are absolutely right. I have some bigger changes for that page in mind, but I don't see why I shouldn't just quickly fix this. Thanks for the report, fixed for the next release.Muppet9010 wrote: ↑Wed Feb 09, 2022 8:26 pm On the main page (https://lua-api.factorio.com/latest/index.html) the Classes header isn't clickable, but the Events header further down the page is.
Capture.PNG
There is the Classes page that I assume the header should link to: https://lua-api.factorio.com/latest/Classes.html