Comments (2)
Before 0.13 when you accessed a certain technology using force.technologies the entire technology table got indexed, which had a huge impact on performance when the check ran on tick events, so some sort of "cache" was needed and also using research events.
This is not really "required" anymore, but i don't see any reason to remove it, as it's still good to cache the value, also i don't think it's related to this issue.
If it's an save from 0.12 that already had the mod installed and tech researched, globla.hasSystem "which uses the force name as a key, not the player index" would be already set, the issue here is the change of style names, it apparently doesn't update the icon gui element to the new style if it already exists, which is why i added a way to force the change in initGui method.
anyway, i think this update 3ff8c16 should fix the issue, and also makes sure the globals are loaded for new installs as well.
Please check and let me know.
from advanced-logistics-system.
On the caching of hasSystem
, I noticed that the system can be activated using a remote call, bypassing the research so that makes it required anyway.
Concerning the issue with global.hasSystem[force]
not being set, this is partly my fault (I used ALS 0.2.9 naively thinking it was the latest release before 0.3.0) but this particular version really did not set global.hasSystem[force]
Looking at on_configuration_changed
I can't help but notice that it's mostly incorrect though.
Doing version checks on newVersion
(newVersion == "0.2.10"
, newVersion == "0.2.12"
) is basically useless because of course the new version will be >=0.3.0 now.
Seeing that so much code is duplicated, I think you'd be better going with a generic on_configuration_changed
, the if oldVersion <= "0.3.0"
block seems to be a good starting point that should cover all updates scenarios from any older version. Also note that doing string comparisons on version strings is incorrect, because "0.2" > "0.19"
is true
for instance.
Another issue I noticed is that loading from a 0.2.9 save with the GUI opened will cause the old GUI to appear completely messed up when loading it in 0.3.0, I think upgrading should destroy any old GUI and create a clean one from scratch. Fortunately the old GUI was closeable so it's not a big deal but if a future release renames the buttons, the user could potentially be left with uncloseable GUI
Anyway, I'm going to send you another pull request addressing those issues soon, so stay tuned!
from advanced-logistics-system.
Related Issues (20)
- Module crashes with "attempt to index field '?'" error HOT 1
- Error on_init HOT 1
- ALS is not working with Factorissimo mod
- Factorio 0.14? HOT 1
- bind close to e HOT 2
- Error selecting normal items HOT 1
- Mod causes high load times in 0.14.9
- Locate feature may not return to player HOT 7
- Effects not showing HOT 2
- Item count possible underflow
- bug when searching for '['
- Please update to work with Factorio 0.15.x
- GUI won't open
- search causes game crash on some characters HOT 1
- on_gui_click (ID 1) __advanced-logistics-system__/gui/network.lua:51: attempt to compare two nil values HOT 1
- Crash of module when using "All button" HOT 2
- Question on usage with alert
- Update to .16? HOT 13
- Mod crashes when a roboport is being deconstructed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advanced-logistics-system.