Page 3 of 4

Re: New API Docs website

Posted: Mon Dec 13, 2021 2:29 pm
by Muppet9010
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.
Bilka:
Every single thing you access on a LuaObject is given to you upon request, nothing comes with the original object
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.

Re: New API Docs website

Posted: Sat Dec 18, 2021 8:28 am
by DaveMcW
On LuaTransportLine and probably other pages, the index() and length() operators are not defined properly.
operator length :: uint [R] Get the number of items on this transport line.
operator index :: LuaItemStack [R] The indexing operator.
Compare to the old API:
operator # :: uint [R] Get the number of items on this transport line.
operator [] :: LuaItemStack [R] The indexing operator.

Re: New API Docs website

Posted: Sat Dec 18, 2021 6:08 pm
by Hornwitser
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.

Re: New API Docs website

Posted: Thu Jan 13, 2022 8:08 pm
by curiosity
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

Posted: Fri Jan 14, 2022 12:41 am
by DaveMcW
curiosity wrote:
Thu Jan 13, 2022 8:08 pm
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.
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

Posted: Fri Jan 14, 2022 3:33 pm
by curiosity
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.
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.

Re: New API Docs website

Posted: Fri Jan 14, 2022 6:00 pm
by Klonan
curiosity wrote:
Thu Jan 13, 2022 8:08 pm
Nothing prevents having both.
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

Posted: Fri Jan 14, 2022 6:14 pm
by ptx0
Klonan wrote:
Fri Jan 14, 2022 6:00 pm
curiosity wrote:
Thu Jan 13, 2022 8:08 pm
Nothing prevents having both.
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
so put a little clipboard icon and copy it when you click THAT.

Re: New API Docs website

Posted: Fri Jan 14, 2022 10:38 pm
by curiosity
Klonan wrote:
Fri Jan 14, 2022 6:00 pm
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
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.

Re: New API Docs website

Posted: Sat Jan 15, 2022 7:40 am
by coderpatsy
Klonan wrote:
Fri Jan 14, 2022 6:00 pm
curiosity wrote:
Thu Jan 13, 2022 8:08 pm
Nothing prevents having both.
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
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

Posted: Sat Jan 15, 2022 8:34 am
by Pi-C
coderpatsy wrote:
Sat Jan 15, 2022 7:40 am
I find browser extensions like Copy Link or Copy Link Text to be invaluable.
Thanks for the hint, I've just installed Copy Link Text! :-)

Re: New API Docs website

Posted: Sat Jan 15, 2022 6:18 pm
by Klonan
coderpatsy wrote:
Sat Jan 15, 2022 7:40 am
hout following links (or sending JS events for that click at all I think).
Invaluable tip! Thank you! Actually I have this problem quite frequently and this will optimize my time
(They say perfection is just doing a lot of little things right)

Re: New API Docs website

Posted: Fri Jan 21, 2022 3:07 pm
by curiosity
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).
Good to know. Would have been good for this if it also didn't download the link.

Re: New API Docs website

Posted: Fri Jan 21, 2022 4:28 pm
by coderpatsy
curiosity wrote:
Fri Jan 21, 2022 3:07 pm
Good to know. Would have been good for this if it also didn't download the link.
Ah, it doesn't download if you click and drag. Just a click does the download.

Re: New API Docs website

Posted: Fri Jan 21, 2022 5:22 pm
by curiosity
coderpatsy wrote:
Fri Jan 21, 2022 4:28 pm
Ah, it doesn't download if you click and drag.
Does for me.

Re: New API Docs website

Posted: Sun Jan 23, 2022 10:57 pm
by Katharsas
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:

Code: Select all

* {
    box-shadow: none !important;
}

Re: New API Docs website

Posted: Fri Jan 28, 2022 3:28 pm
by Hornwitser
Katharsas wrote:
Sun Jan 23, 2022 10:57 pm
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.
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/

Re: New API Docs website

Posted: Wed Feb 09, 2022 8:26 pm
by Muppet9010
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
Capture.PNG (63.97 KiB) Viewed 4156 times
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

Posted: Tue Mar 29, 2022 6:13 pm
by Xorimuth
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):
Screen Recording 2022-03-29 at 18.59.57.mp4
(79.58 KiB) Downloaded 54 times

Re: New API Docs website

Posted: Wed May 04, 2022 10:01 am
by Therenas
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
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.