733 Commits

Author SHA1 Message Date
raiguard
6db52457f6 Translation module (#9)
* Import from RaiLuaLib, get it working

* Player -> player_index, documentation

- Passing LuaPlayers is not actually necessary because the only thing
that is actually used is the index, so that is changed.
- Translation tables are now deleted after a player leaves or is
removed, instead of just before.
- Add preliminary LDoc documentation for functions and concepts.

* Remove useless events, finish_event -> on_finished

* Remove raises for deleted events

* Add temporary usage instructions.

* Add descriptions of each output table

* Less ambiguous event ID name

* Don't save event ID to custom registry

* Call handler directly instead of raising an event

* Readability improvements

* Add name and tick to "event" table

* Update to work without event module
2020-04-24 20:42:44 -06:00
nexela
2a84fc2c1e Fix Train docs 2020-04-24 21:40:23 -04:00
nexela
d5610371e6 Build File 2020-04-24 21:40:02 -04:00
nexela
8e8997a8a0 Doc Fixes 2020-04-24 20:48:09 -04:00
nexela
db4072dd0b Devcontainer 2020-04-25 00:30:51 +00:00
raiguard
fb0bae0148 Delete event module 2020-04-23 21:29:08 -06:00
raiguard
9d6c529a6b Fix undefined globals 2020-04-23 19:51:36 -06:00
raiguard
f5e61e9e04 Fix documentation syntax 2020-04-23 19:51:21 -06:00
Optera
c20e25b0cf Merge branch 'master' of https://github.com/raiguard/Factorio-Flib 2020-04-22 08:39:42 +02:00
Optera
e58cbefd2e updated get_distance
added get_distance_squared
2020-04-22 08:39:38 +02:00
raiguard
c487e86d96 Make saving custom event IDs to registry optional 2020-04-21 21:44:25 -06:00
raiguard
4c10035e84 Remove old function, slight optimization 2020-04-21 20:38:31 -06:00
raiguard
c5be706fa5 Fix .gitignore 2020-04-21 20:37:58 -06:00
Optera
3be4daa2aa updated ldoc 2020-04-21 21:38:24 +02:00
Optera
03609b5104 replace format_version 2020-04-21 21:37:09 +02:00
Optera
de1d67deba added modules misc and train from OpteraLib 2020-04-21 07:48:01 +02:00
nexela
e96d7a61e8 Add Ldoc 2020-04-21 00:16:58 -04:00
raiguard
f836764747 Event module updates (#6)
* Docs skeleton

* Remove goto, fix registered players logic

While removing the GUI filters I inadvertantly broke the logic for
registered players. It would skip calling the handler if ANY of the
handler's conditional data did not have the player registered. Now
it properly checks all conditional events before deciding not to call
the handler.

* Formatting fixes

* Add support for matcher functions

This function will be run and the return value will determine if the
handler is called. I don't plan on ever using this in actual mod code,
it will only be used for the GUI module later on.

* Remove __version from global

This isn't actually needed since version changes will be kept track
of by the on_configuration_changed event itself.

* Remove needless (and broken) if statement

* Remove html from WIP docs

* Refactor dispatch_event and event.register

Dispatch_event how has a simplified structure to improve performance.
Additionally, the handler will be called for all matching conditional
events, and the conditional event name is passed in the event table.
This will make GUI filter matching possible. The function no longer
modifies the event's name, but instead gets the registry directly.
Also removed the newly added event matchers, since they are no
longer needed.

event.register has been slightly rewritten to improve performance.
The master handler is now registered in under the same conditions
as its registry is made, removing a redundant check.

* Improve handler reregistration, logging

Direclty re-register the handler in on_load by calling event.register,
instead of going through event.enable.
Log a warning if a conditional event's data was not found, to make
it clear that it should be handled by the modder in
on_configuration_changed.

* Remove unused parameter from shortcut functions

Bootstrap functions do not go through dispatch_event, and so do not
support the options table.

* Add usage examples for most functions

* Dynamically generate bootstrap event shortcuts

* Minor logging fix

* Add temporary class documentation

* Minor logging fix

* Documentation syntax fixes

* Minor syntax fixes
2020-04-20 19:50:53 -06:00
raiguard
984b48452d Add Nexela as an author, update URLs, dependency 2020-04-20 17:34:27 -06:00
raiguard
6c9dc10a6d Migration syntax updates and documentation
- Update ambiguous variable names
- Add documentation for remaining functions
- Add "format" parameter to migration.run
- Remove ability to pass parameters to migration functions
2020-04-20 17:25:49 -06:00
Optera
c9bad25868 added format_version, is_new_version 2020-04-15 09:47:34 +02:00
Optera
8e4e0a4e27 Data utilities from OpteraLib (#3)
* added data functions from OpteraLib

* updated headers for ldoc

* make data stage functions available globally

* removed redundant multiply_energy_value function

* moved functions into table
2020-04-14 10:37:28 -06:00
raiguard
14e6192a8c Remove extra blank line 2020-04-12 22:14:24 -06:00
raiguard
e599b30fdf Add event module 2020-04-12 22:14:11 -06:00
raiguard
99ca088ca3 Remove wiki submodule 2020-04-12 21:14:10 -06:00
raiguard
8b0d3c6276 Add migration module 2020-04-12 20:19:20 -06:00
raiguard
f9db0b6e8e Submodule silliness? 2020-04-12 14:32:38 -06:00
raiguard
5a9279c25c Update name in wiki and readme 2020-04-12 14:29:30 -06:00
raiguard
381aef56a6 Add wiki as submodule 2020-04-12 14:03:46 -06:00
raiguard
56d9c2ec89 Update .gitignore 2020-04-12 14:01:06 -06:00
raiguard
86d86357f4 Mod info updates 2020-04-12 14:01:01 -06:00
Optera
5563ad869a initialize mod 2020-04-12 21:47:18 +02:00
raiguard
d44a434ddd Initial commit 2020-04-12 12:33:00 -06:00