You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The onFirstInit event is run on every reload if an mts entry is not provided, this creates a problem when onFirstInit is handled exclusively by javascript. Here is some tests I ran that supports my theory.
Test 1
I wanted to test the onInit and onFirstInit with javascript files. I was more familiar what I can do with that and I needed it for some plans. And as you can see from the results it was always doing onfirstInit and onInit. Both events calling when it should have only been onInit when readding the addon, or closing and reopening the campaign. events.json
First Add Output ->
onFirstInit.js
onInit.js
<- End
Second Add Output ->
onFirstInit.js
onInit.js
<- End
Reopening Output ->
onFirstInit.js
onInit.js
<- End
Test 2
In this test I included the mts files wondering if it would give the same results and well. It caused a bit of a unforseen reaction. events.json
First Add Output ->
onFirstInit.js
onFirstInit.mts
onInit.js
onInit.mts
<- End
Second Add Output ->
onInit.js
onInit.mts
<- End
Reopening Output ->
onInit.js
onInit.mts
<- End
mts ones work... and now the javascript ones as well...?
Test 3
This one was like the first test but instead mts was the one being tested alone, unlike the first, this one gave me the expected results. test results
First Add Output ->
onFirstInit.mts
onInit.mts
<- End
Second Add Output ->
onInit.mts
<- End
Reopening Output ->
onInit.mts
<- End
Test 4
At this point I was starting to draw a line towards the mts files, I had narrowed it down to it involving requiring an mts file... or did it?
In this test instead of supplying two corresponding mts files, I gave two arbitrary names that don't have any files associated with them. events.json
First Add Output ->
onFirstInit.js
onInit.js
<- End
Second Add Output ->
onInit.js
<- End
Reopening Output ->
onInit.js
<- End
This test reveals that an mts file is not needed, but more that there must be an mts entry at all for the events to work reguardless if it is a valid entry or not. Of course this does throw up a window telling me that those files can't be found... but the javascript files gave the expected output.
To Reproduce
Create a library with events only handled in javascript like so.
Create the javascripts files and test the initialization events for importing the library for the first time, reimporting it, and closing and opening the campaign it is saved to. Every time it will run both events. If an mts property is included this doesn't happen.
Expected Behaviour
I expected this
First Add Output ->
onFirstInit.js
onInit.js
<- End
Second Add Output ->
onInit.js
<- End
Reopening Output ->
onInit.js
<- End
Screenshots
But instead I got this
First Add Output ->
onFirstInit.js
onInit.js
<- End
Second Add Output ->
onFirstInit.js
onInit.js
<- End
Reopening Output ->
onFirstInit.js
onInit.js
<- End
MapTool Info
1.15
Desktop
Windows
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Describe the Bug
The onFirstInit event is run on every reload if an mts entry is not provided, this creates a problem when onFirstInit is handled exclusively by javascript. Here is some tests I ran that supports my theory.
Test 1
I wanted to test the onInit and onFirstInit with javascript files. I was more familiar what I can do with that and I needed it for some plans. And as you can see from the results it was always doing onfirstInit and onInit. Both events calling when it should have only been onInit when readding the addon, or closing and reopening the campaign.
events.json
test results
Test 2
In this test I included the mts files wondering if it would give the same results and well. It caused a bit of a unforseen reaction.
events.json
test results
mts ones work... and now the javascript ones as well...?
Test 3
This one was like the first test but instead mts was the one being tested alone, unlike the first, this one gave me the expected results.
test results
Test 4
At this point I was starting to draw a line towards the mts files, I had narrowed it down to it involving requiring an mts file... or did it?
In this test instead of supplying two corresponding mts files, I gave two arbitrary names that don't have any files associated with them.
events.json
test results
This test reveals that an mts file is not needed, but more that there must be an mts entry at all for the events to work reguardless if it is a valid entry or not. Of course this does throw up a window telling me that those files can't be found... but the javascript files gave the expected output.
To Reproduce
Create a library with events only handled in javascript like so.
Create the javascripts files and test the initialization events for importing the library for the first time, reimporting it, and closing and opening the campaign it is saved to. Every time it will run both events. If an mts property is included this doesn't happen.
Expected Behaviour
I expected this
Screenshots
But instead I got this
MapTool Info
1.15
Desktop
Windows
Additional Context
No response
The text was updated successfully, but these errors were encountered: