[Twinsen][1.1.0] manipulating logistic requests by script seems not to update the GUI correctly if GUI is open

This subforum contains all the issues which we already resolved.
Post Reply
Daeruun
Inserter
Inserter
Posts: 43
Joined: Thu May 04, 2017 8:37 pm
Contact:

[Twinsen][1.1.0] manipulating logistic requests by script seems not to update the GUI correctly if GUI is open

Post by Daeruun »

Hi there,

first things first:
Thanks for all the love you guys give this game, it's once more an amazing update!


I'm just updating some mod due to changes in logistic-modding.
During testing of my fix I noticed that the player-GUI seems not to get updated correctly if I add a Logistic Request that should lead to extension of the number of slots.
The extension is done once the GUI is closed and updated or a slot in the last existing row is manually configured.

Steps to reproduce:
1. Open the character-logistic-tab (F1)
2. Have no logistic slots set. There should now be 4 rows of 10 (empty) slots.
3. Add a request for 50 wooden chests to the 35th slot using

Code: Select all

/c game.player.character.set_personal_logistic_slot(35,{name="wooden-chest",min=50}) 
4. See something like this:
slot 35 added by script when panel visible and no slots were configured
slot 35 added by script when panel visible and no slots were configured
Screenshot 2020-11-24 232246.jpg (40.3 KiB) Viewed 3319 times

sidenote: adding a (single) request to the first slot of that row does not extend the slots either if no other slot in that row is configured:
slot 30 added manually when no other slot is set
slot 30 added manually when no other slot is set
Screenshot 2020-11-24 232602.jpg (38.59 KiB) Viewed 3319 times

[edit] changed title as this seems not to be limited to set_personal_logistic_slot()
Last edited by Daeruun on Tue Nov 24, 2020 11:01 pm, edited 1 time in total.

Daeruun
Inserter
Inserter
Posts: 43
Joined: Thu May 04, 2017 8:37 pm
Contact:

Re: [1.1.0] adding logistic requests by set_personal_logistic_slot() seems not to update the GUI correctly if GUI is ope

Post by Daeruun »

Oh, just noticed:

if you add a slot further down (by script), it will not be visible until the GUI is closed and re-opened or visible slot is manipulated manually.


Someting similar happens when deleting slots by sript:

Code: Select all

/c local slots = game.player.character.request_slot_count; game.player.print (slots) for i=1, slots do game.player.character.clear_personal_logistic_slot(i) end
that gives me 73 set slots:
73 set slots
73 set slots
Screenshot 2020-11-24 235705.jpg (56.13 KiB) Viewed 3310 times
the result of the rest of the script looks like this:
leftover after execution of the above script
leftover after execution of the above script
Screenshot 2020-11-24 235758.jpg (36.17 KiB) Viewed 3310 times

closing and opening the GUI refreshes everything and no slots are set

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [1.1.0] adding logistic requests by set_personal_logistic_slot() seems not to update the GUI correctly if GUI is ope

Post by Choumiko »

Daeruun wrote:
Tue Nov 24, 2020 10:43 pm
sidenote: adding a (single) request to the first slot of that row does not extend the slots either if no other slot in that row is configured:
That is also the case when you do it manually via the gui. So far i assumed it is intentional (for whatever reason)


Regarding to set_personal_logistic_slot:

-Open the gui, logistic tab

Code: Select all

/c game.player.character.set_personal_logistic_slot(45,{name="wooden-chest",min=50}) 
gui is not updated, close and open, slot is set

Code: Select all

/c game.player.character.clear_personal_logistic_slot(45) 
gui is not updated, close and open, slot is cleared.

Daeruun
Inserter
Inserter
Posts: 43
Joined: Thu May 04, 2017 8:37 pm
Contact:

Re: [1.1.0] adding logistic requests by set_personal_logistic_slot() seems not to update the GUI correctly if GUI is ope

Post by Daeruun »

Choumiko wrote:
Tue Nov 24, 2020 11:02 pm
Daeruun wrote:
Tue Nov 24, 2020 10:43 pm
sidenote: adding a (single) request to the first slot of that row does not extend the slots either if no other slot in that row is configured:
That is also the case when you do it manually via the gui. So far i assumed it is intentional (for whatever reason)
Sorry, I missed to add that this was done manually.
Choumiko wrote:
Tue Nov 24, 2020 11:02 pm

Regarding to set_personal_logistic_slot:

-Open the gui, logistic tab

Code: Select all

/c game.player.character.set_personal_logistic_slot(45,{name="wooden-chest",min=50}) 
gui is not updated, close and open, slot is set

Code: Select all

/c game.player.character.clear_personal_logistic_slot(45) 
gui is not updated, close and open, slot is cleared.
That sums it up quit well. ;-)

Twinsen
Factorio Staff
Factorio Staff
Posts: 1330
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [Twinsen][1.1.0] manipulating logistic requests by script seems not to update the GUI correctly if GUI is open

Post by Twinsen »

Should be fixed in Version: 1.1.2
Thanks for the report.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [Twinsen][1.1.0] manipulating logistic requests by script seems not to update the GUI correctly if GUI is open

Post by Choumiko »

Twinsen wrote:
Wed Nov 25, 2020 12:42 pm
Should be fixed in Version: 1.1.2
I was just messing around with spidertron logistics and on 1.1 it's the same behavior:

get in a spidertron, open the gui, switch to logistics tab

Code: Select all

/c game.player.vehicle.set_vehicle_logistic_slot(45,{name="wooden-chest",min=50})
no gui update, close, open

Code: Select all

/c game.player.vehicle.clear_vehicle_logistic_slot(45)
no gui update, close, open

Wonder if it got fixed with the player fix, although i guess not since it's a different function/gui ?

Twinsen
Factorio Staff
Factorio Staff
Posts: 1330
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [Twinsen][1.1.0] manipulating logistic requests by script seems not to update the GUI correctly if GUI is open

Post by Twinsen »

Choumiko wrote:
Wed Nov 25, 2020 6:30 pm
Twinsen wrote:
Wed Nov 25, 2020 12:42 pm
Should be fixed in Version: 1.1.2
I was just messing around with spidertron logistics and on 1.1 it's the same behavior:
Damn, you confused me.
Version: 1.1.2 has not released yet. I made the fix just as 1.1.1 was released.

Post Reply

Return to “Resolved Problems and Bugs”