z_mirror/flib

git clone https://git.raiguard.me/z_mirror/flib

compilatronMove to version 0.17.388a5e3b

trunk
25.5 KiB482 linesraw
1---------------------------------------------------------------------------------------------------
2Version: 0.17.3
3Date: ????
4  Changes:
5---------------------------------------------------------------------------------------------------
6Version: 0.17.2
7Date: 2026-06-25
8  Bugfixes:
9    - Fixed missing localisation for the `flib_dictionary` module.
10---------------------------------------------------------------------------------------------------
11Version: 0.17.1
12Date: 2026-06-23
13  Bugfixes:
14    - Fixed crashes in the `flib_dictionary` module related to the array/table library split.
15---------------------------------------------------------------------------------------------------
16Version: 0.17.0
17Date: 2026-06-23
18  Features:
19    - Added `flib_array` module for working with arrays.
20    - Added `flib_table.all_of`.
21  Changes:
22    - Split `flib_table` module into separate `flib_array` and `flib_table` modules.
23    - Removed deprecated functions: `flib_direction.to_vector`, `flib_direction.to_vector_2d`, `flib_table.for_n_of`, `flib_table.filter`, `flib_table.partial_sort`, and `flib_table.size`.
24    - Removed deprecated modules: `flib_migration`.
25    - Removed upstream Lua library functions from the `flib_math` and `flib_table` modules; please use those functions directly.
26    - Renamed `flib_table.array_copy` to `flib_array.shallow_copy`.
27    - Renamed `flib_table.array_merge` to `flib_array.flatten`.
28    - Renamed `flib_table.binary_search` to `flib_array.binary_search`.
29    - Renamed `flib_table.for_each` to `flib_table.any_of`.
30    - Renamed `flib_table.invert` to `flib_table.inverted`.
31    - Renamed `flib_table.map` to `flib_table.mapped` and added a new `flib_table.map` which maps in-place.
32    - Renamed `flib_table.slice` to `flib_array.slice`.
33    - Renamed `flib_table.splice` to `flib_array.splice`.
34  Bugfixes:
35    - Removed require guards, which are no longer needed as of Factorio 2.0.
36---------------------------------------------------------------------------------------------------
37Version: 0.16.5
38Date: 2025-11-05
39  Bugfixes:
40    - Fixed that `flib_table.binary_search` would fail to find the last element in the list. (#81)
41---------------------------------------------------------------------------------------------------
42Version: 0.16.4
43Date: 2025-10-31
44  Features:
45    - Added `flib_position.from_direction` and `flib_position.from_orientation`.
46    - Added `flib_math.radian` constant.
47  Changes:
48    - Deprecated `flib_direction.to_vector` and `flib_direction.to_vector_2d` because they do not function correctly.
49    - Deprecated `flib_migration` module in favor of `helpers.compare_versions` and Lua migration files.
50  Bugfixes:
51    - Fixed that `flib_dictionary.handle_events` would not handle on_player_locale_changed.
52    - Fixed LuaLS warnings when passing flib_dictionary or flib_gui as an event_handler module.
53---------------------------------------------------------------------------------------------------
54Version: 0.16.3
55Date: 2025-06-05
56  Features:
57    - Added `flib_prototypes.get_base_type` method.
58  Changes:
59    - Improved error messaging of flib_prototypes functions.
60  Bugfixes:
61    - Fixed that `flib_locale.of` would give an incorrect result in some cases. (#80)
62---------------------------------------------------------------------------------------------------
63Version: 0.16.2
64Date: 2025-01-24
65  Bugfixes:
66    - Fixed that `flib_locale.of_item` would not accept all item subtypes.
67    - Fixed that `flib_locale.of_recipe` would incorrectly return the main product name in some cases.
68---------------------------------------------------------------------------------------------------
69Version: 0.16.1
70Date: 2025-01-20
71  Optimizations:
72    - Improved performance of `flib_prototypes.all()`.
73  Bugfixes:
74    - Fixed a crash when using `flib_gui_templates.technology_slot()`.
75---------------------------------------------------------------------------------------------------
76Version: 0.16.0
77Date: 2024-12-16
78  Features:
79    - Added `flib_locale` module with various utilities for deducing the localised names of prototypes in the prototype stage.
80    - Added `flib_prototypes` module with various utilities for getting prototypes from data.raw.
81    - Added `flib_position.abs()`.
82  Bugfixes:
83    - Removed icon mipmaps properties from `data-util`; icon mipmaps are now automatically deduced by the game engine.
84    - Fixed a crash when attempting to use the `gui-templates` module due to an outdated require path. (#72)
85    - Fixed that `flib_direction.from_positions` did not work correctly. (#74)
86    - Fixed that `flib_migration.on_config_changed` would run migrations unnecessarily. (#71, #73)
87---------------------------------------------------------------------------------------------------
88Version: 0.15.0
89Date: 2024-10-14
90  Features:
91    - Added support for ronna and quetta SI prefixes to `flib_format.number`.
92  Changes:
93    - Updated to Factorio 2.0.
94    - Removed `flib_direction.north` etc. constants. Use `defines.direction` instead.
95    - Renamed `gui-lite` to `gui`, and `dictionary-lite` to `dictionary`.
96    - Removed deprecated modules.
97---------------------------------------------------------------------------------------------------
98Version: 0.14.2
99Date: 2024-07-28
100  Bugfixes:
101    - [dictionary-lite] Fixed that the first translation in a re-requested batch would be skipped.
102    - [math] Fixed that the `sum` function was ignoring the first element. (#69)
103    - Fixed that the `flib_tool_button_light_green` GUI style had a built-in tooltip. (#68)
104---------------------------------------------------------------------------------------------------
105Version: 0.14.1
106Date: 2024-05-10
107  Changes:
108    - Adjusted technology slot GUI template to work with Ultimate Research Queue.
109  Bugfixes:
110    - Fixed that the technology slot GUI styles did not have selected styles.
111---------------------------------------------------------------------------------------------------
112Version: 0.14.0
113Date: 2024-03-29
114  Features:
115    - Added `gui-lite.format_handlers` function.
116    - Added `gui-templates` module for building various common and/or annoying GUI components. Currently just makes technology slots.
117    - Added `table.binary_search` function.
118    - Added `technology` module with various runtime technology-related utilities.
119    - Added technology slot styles.
120    - Added require guards to allow requiring flib modules with any syntax without breaking upvalues.
121  Changes:
122    - `data_util.create_icons` no longer defines default icon size or scale. (#64)
123  Bugfixes:
124    - Fixed `data_util.get_energy_value` not accepting capital `K` as a unit suffix. (#59)
125    - Fixed that dictionary-lite translation batches would not always be re-requested in their entirety due to undefined Lua next() behavior.
126---------------------------------------------------------------------------------------------------
127Version: 0.13.0
128Date: 2023-10-14
129  Features:
130    - [position] Added `position.ge`, `position.gt`, and `position.lerp` functions.
131  Bugfixes:
132    - [bounding-box] Fixed `bounding_box.recenter_on()` not properly preserving box dimensions.
133---------------------------------------------------------------------------------------------------
134Version: 0.12.9
135Date: 2023-06-01
136  Bugfixes:
137    - Fixed Chinese translation making the mod unloadable (#53)
138---------------------------------------------------------------------------------------------------
139Version: 0.12.8
140Date: 2023-05-29
141  Bugfixes:
142    - [dictionary-lite] Fixed that the total strings count did not include "initial_contents" strings
143---------------------------------------------------------------------------------------------------
144Version: 0.12.7
145Date: 2023-04-30
146  Features:
147    - Added `flib_nav_(backward|forward)_(black|white|disabled)` sprites
148    - Added `flib_titlebar_separator_line` and `flib_titlebar_search_textfield` styles
149  Changes:
150    - Updated base dependency to 1.1.80
151---------------------------------------------------------------------------------------------------
152Version: 0.12.6
153Date: 2023-03-20
154  Bugfixes:
155    - [gui-lite] Fixed that drag_target was not restored to GUI elem definitions after being used in gui.add
156---------------------------------------------------------------------------------------------------
157Version: 0.12.5
158Date: 2023-03-09
159  Features:
160    - `dictionary-lite` and `gui-lite` modules are now compatible with the core `event_handler`
161  Bugfixes:
162    - [bounding-box] Fixed `bounding_box.from_dimensions()` returning a 0x0 area at left_top (#49)
163    - Fixed `selected` button styles having an extra vertical offset when clicked
164---------------------------------------------------------------------------------------------------
165Version: 0.12.4
166Date: 2022-12-30
167  Changes:
168    - flib_selected_frame_action_button and flib_selected_tool_button styles now have a vertical offset
169    - Improved slot style coloring to be more consistent
170    - Updated table module to use more generics for callback return values
171  Bugfixes:
172    - Fixed missing clicked graphical sets on slot styles
173    - Fixed missing return types in table module callback functions
174    - Fixed that long mod names would cut off in the dictionary-lite progress window
175---------------------------------------------------------------------------------------------------
176Version: 0.12.3
177Date: 2022-12-14
178  Bugfixes:
179    - Fixed a crash when calling `bounding_box.rotate()`
180    - The base mod dependency is no longer optional - it was causing the game to download flib versions that it could not run
181---------------------------------------------------------------------------------------------------
182Version: 0.12.2
183Date: 2022-12-06
184  Changes:
185    - [queue] If the queue is empty, returns nil instead of throwing an error
186    - [queue] Renamed functions to be much more clear, updated types to use generics
187    - Updated types to work with recent FMTK releases
188  Bugfixes:
189    - [dictionary-lite] Fixed an occasional crash related to Lua memory management internals
190---------------------------------------------------------------------------------------------------
191Version: 0.12.1
192Date: 2022-12-06
193  Bugfixes:
194    - [dictionary-lite] Fixed a crash when re-requesting a missed translation batch
195---------------------------------------------------------------------------------------------------
196Version: 0.12.0
197Date: 2022-12-06
198  Features:
199    - Added 'bounding-box' module
200      - A cleaned up version of the 'area' module that treats bounding boxes as immutable and does not use metatables
201      - Since the cleanup was a breaking change, a new module was created
202    - Added 'dictionary-lite' module
203      - Takes advantage of new Factorio API features to drastically simplify the process
204      - Increases translation speed in singleplayer by a factor of 10
205    - Added 'format' module with various string formatting functions
206    - Added 'gui-lite' module
207      - Removes redundant features, simplifies the building process, and enhances type-checking and autocomplete
208    - Added 'migration.handle_on_configuration_changed()'
209    - Added 'position' module with various position manipulation functions
210  Changes:
211    - Changed preferred require syntax to '/' instead of '.'
212    - Deprecated 'area' module in favor of the 'bounding-box' module
213    - Deprecated 'dictionary' module in favor of the 'dictionary-lite' module
214    - Deprecated 'event' module - type checking did not work and it didn't provide much over using 'script' directly
215    - Deprecated 'gui' module in favor of the 'gui-lite' module
216    - Deprecated 'misc' module in favor of the 'format' and 'position' modules
217    - Removed 'queue.load()' and queue metatables
218    - Updated type definitions to use generics where possible
219  Bugfixes:
220    - [dictionary] Fixed translations getting stuck on Factorio 1.1.73+
221---------------------------------------------------------------------------------------------------
222Version: 0.11.2
223Date: 2022-09-18
224  Bugfixes:
225    - [dictionary] Fixed a crash when a player left the game under certain circumstances
226---------------------------------------------------------------------------------------------------
227Version: 0.11.1
228Date: 2022-09-12
229  Changes:
230    - [dictionary] Added tooltip to GUI header explaining what it is
231  Bugfixes:
232    - [dictionary] Fixed that translations would stop being requested under certain circumstances
233---------------------------------------------------------------------------------------------------
234Version: 0.11.0
235Date: 2022-09-04
236  Features:
237    - [area] Added `area.square()` to turn the area into a square
238    - [area] Added `starting_offset` argument to `area.iterate()`
239    - [dictionary] Added a GUI that shows translation progress
240    - [math] Added `floored` and `ceiled` for flooring and ceiling to N decimal places.
241    - [math] Added `sign` to return the signedness of a number as a multiplier
242    - [math] Added `sum`, `maximum`, `minimum`, `midrange`, `range` for sets of numbers
243  Changes:
244    - [math] Deprecated `round_to`, `ceil_to`, `floor_to`
245    - [math] `clamp` defaults to clamping between 0, 1 when min or max are not set
246    - [dictionary] Removed string nesting to significantly reduce network traffic
247      - This makes translation take significantly longer
248  Bugfixes:
249    - Fixed missing annotations in math and table libraries
250    - [dictionary] Fixed that an empty translation would cause the translation after it to be skipped
251    - [migration] Fixed a crash when loading the tutorial scenario
252---------------------------------------------------------------------------------------------------
253Version: 0.10.1
254Date: 2022-02-24
255  Bugfixes:
256    - [event] Fixed a crash when passing `nil` to `event.on_nth_tick`
257---------------------------------------------------------------------------------------------------
258Version: 0.10.0
259Date: 2022-02-24
260  Features:
261    - [direction] Added `direction.from_positions()`
262    - [table] Added `table.get_or_insert()`
263  Changes:
264    - Converted from LDoc to EmmyLua annotations, enabling language server intellisense, but removing the docs website
265      - A new website or other solution for online docs will be added someday. For now, in-line documentation was decided to be more beneficial.
266    - [area] All constructor functions will automatically call `area.load()` to add the metatable
267    - [area] All functions will ensure that any passed areas have `left_top` and `right_bottom` keys, and will automatically convert ones that do not
268    - [migration] `migration.on_config_changed()` version migrations table is now optional
269---------------------------------------------------------------------------------------------------
270Version: 0.9.2
271Date: 2021-11-18
272  Bugfixes:
273    - Fixed the dictionary module not separating dictionaries from separate mods properly
274---------------------------------------------------------------------------------------------------
275Version: 0.9.1
276Date: 2021-11-16
277  Bugfixes:
278    - Fixed a crash when calling dictionary.load() before dictionary.init() has been able to fire
279    - Fixed table.slice() and table.splice() stop-n-from-end being one position off
280---------------------------------------------------------------------------------------------------
281Version: 0.9.0
282Date: 2021-11-11
283  Features:
284    - Added `queue` module
285    - Added `table.array_merge()` and `table.retrieve()`
286    - Added `flib_pin` and `flib_settings` sprites in black, white, and disabled variants
287      - These are for use with frame action buttons
288    - Added `gui.flib-keep-open` and `gui.flib-settings` locales for use with the aforementioned sprites
289---------------------------------------------------------------------------------------------------
290Version: 0.8.4
291Date: 2021-09-19
292  Features:
293    - Added `flib-dictionary-levels-per-batch` setting
294  Changes:
295    - Children may now be defined in `gui.add()`
296      - If you need to return refs to children, use `gui.build()` instead
297    - `flib-translations-per-tick` setting is now hidden
298---------------------------------------------------------------------------------------------------
299Version: 0.8.3
300Date: 2021-08-20
301  Bugfixes:
302    - Fixed that math.round() was incorrect for some negative numbers
303    - Fixed that the on-tick-n module was not documented and not mentioned in the v0.8.0 changelog
304---------------------------------------------------------------------------------------------------
305Version: 0.8.2
306Date: 2021-08-10
307  Bugfixes:
308    - Fixed the dictionary module not handling if the language detection string was lost across save/load
309---------------------------------------------------------------------------------------------------
310Version: 0.8.1
311Date: 2021-08-09
312  Changes:
313    - The dictionary module no longer provides an event to hook, instead returning the finished dictionaries directly from `process_translation`
314      - This is to allow a single-source-of-truth for the language's dictionaries, which was the original intention, but returning them in an event broke that intention
315---------------------------------------------------------------------------------------------------
316Version: 0.8.0
317Date: 2021-08-08
318  Features:
319    - Added `area.from_shorthand` and `area.to_shorthand`
320    - Added `dictionary` module, which is a fast and easy-to-use dictionary system for localised string translations
321    - Added `flib_widthless_textfield` style
322    - Added `gui.add`, `gui.set_action`, and `gui.get_action`
323    - Added `on-tick-n` module, which allows you to schedule tasks to be executed on a specific tick
324    - Added support for tags and actions in `gui.update`
325    - Children in a `GuiBuildStructure` or `GuiUpdateStructure` can now be defined in the array portion, instead of in a `children` or `tabs` table
326      - The subtables are still accepted for situations where they are appropriate (i.e. dynamically generated children)
327    - `misc.delineate_number()` now supports decimal numbers
328  Changes:
329    - `area.load` will now automatically convert from a shorthanded area to a proper area if needed
330    - Deprecated the old `gui` module and replaced it with the contents of `gui-beta`
331      - Mods can still require `gui-beta`, but it will simply redirect to `gui` instead
332      - Mods that depended on the old GUI module will need to update to the new one or download a copy of it to their mod - it is no longer supported whatsoever
333    - Deprecated the `translation` module, replaced by the new `dictionary` module
334      - The `translation` module still exists and can be used, but is no longer documented and its use is recommended against
335  Bugfixes:
336    - Fixed a crash when calling `gui.read_action()` when the element was invalid
337    - Fixed `area.from_position` not actually creating a 1x1 area
338---------------------------------------------------------------------------------------------------
339Version: 0.7.0
340Date: 2021-02-12
341  Features:
342    - Added `area` module
343    - Added `flib_titlebar_flow` style
344    - Added `divisor` argument to `math.round()`, allowing rounding to the nearest multiple of N
345    - Added `math.max_double` and `math.min_double`
346    - Added argument to `misc.ticks_to_timestring` to preserve leading zeroes
347  Optimizations:
348    - Significant performance improvements to `gui-beta.build()`
349  Bugfixes:
350    - Fixed `math.max_uint` being one number too large
351    - Fixed `data-util.create_icons()` not using all of the icon specifications
352---------------------------------------------------------------------------------------------------
353Version: 0.6.1
354Date: 2021-01-02
355  Features:
356    - Added proper documentation for the `gui-beta` module
357---------------------------------------------------------------------------------------------------
358Version: 0.6.0
359Date: 2020-11-23
360  Features:
361    - Added WIP `gui-beta` module
362      - This module is experimental, but is currently relatively stable. Use at your own risk. See the source code for documentation.
363    - Additional arguments may be passed to `migration.on_config_changed()` to be available in the migration functions
364    - Added `data-util.dark_red_button_tileset`
365    - Added `flib_tool_button_dark_red` button style
366  Changes:
367    - Updated to Factorio 1.1
368    - Modified `flib_selected_frame_action_button` style to better match the vanilla buttons
369    - Made `new_layers` argument to `data-util.create_icons()` optional
370    - Removed deprecated require paths for `data-util` and `reverse-defines` modules
371---------------------------------------------------------------------------------------------------
372Version: 0.5.0
373Date: 2020-10-22
374  Features:
375    - Added indicator sprites
376    - Added `flib_indicator` image style
377  Changes:
378    - Updated thumbnail
379    - Changed `table.reduce()` to work with non-arrays
380    - Changed `misc.ticks_to_timestring()` to use `game.ticks_played` by default, instead of `game.tick`
381  Bugfixes:
382    - Fixed a crash with serialise_localised_string (credit to dbeckwith)
383---------------------------------------------------------------------------------------------------
384Version: 0.4.1
385Date: 2020-09-22
386  Features:
387    - Added a third return value to `table.for_n_of` signifying whether or not the end of the table was reached
388    - Added a third return value to the callback of `table.for_n_of`, which is a flag requesting an immediate iteration abort
389    - Added `flib_tool_button_light_green` button style
390  Changes:
391    - `table.for_n_of` now checks against the first (key) return of `next()` rather than the second (value) return
392      - This changes how custom `next()` functions will behave, and brings it into consistency with the rest of Lua
393---------------------------------------------------------------------------------------------------
394Version: 0.4.0
395Date: 2020-09-13
396  Features:
397    - Added `direction.to_vector_2d`
398    - Additional arguments passed to `migration.run` will be passed on to the version functions within the migrations table
399    - Added `math` module
400  Bugfixes:
401    - Fixed that using `gui.init()` to reset all filters did not update lookup tables
402---------------------------------------------------------------------------------------------------
403Version: 0.3.3
404Date: 2020-08-31
405  Features:
406    - Added a map setting to adjust translation speed (avoid multiplayer drops for those with slow internet speeds)
407---------------------------------------------------------------------------------------------------
408Version: 0.3.2
409Date: 2020-08-30
410  Features:
411    - Added `table.array_copy()`
412    - Added `table.partial_sort()` for sorting an array over multiple ticks
413  Changes:
414    - Passing a custom `next` function to `table.for_n_of()` will bypass the key existence check
415---------------------------------------------------------------------------------------------------
416Version: 0.3.1
417Date: 2020-08-24
418  Features:
419    - Added event.register_on_entity_destroyed()
420    - Added flib_naked_scroll_pane_no_padding GUI style
421  Changes:
422    - Updated to Factorio 1.0
423    - Renamed data_util to data-util and reverse_defines to reverse-defines
424      - The old paths will still work until v0.4.0, but will print deprecation warnings
425    - Removed vertically_stretchable from the flib_naked_scroll_pane GUI style to fix zero-height issue in non-fixed-height containers
426---------------------------------------------------------------------------------------------------
427Version: 0.3.0
428Date: 2020-08-11
429  Features:
430    - Added "grey" and "orange" colored slot button styles
431    - Added two new scroll-pane GUI styles
432    - Added "table" module for working with tables
433  Changes:
434    - translation.init() is now required to be run during on_configuration_changed, in addition to on_init
435      - This is to prevent the module translating and returning strings for things that may not exist anymore
436---------------------------------------------------------------------------------------------------
437Version: 0.2.0
438Date: 2020-07-26
439  Features:
440    - Added gui.check_filter_validity(), which is a new REQUIRED setup function for the GUI module
441    - Added translation.is_translating(), which checks whether the given player is actively translating
442    - Added translation.translating_players_count(), which returns the number of players that are actively translating
443    - Added several button and empty-widget styles, see "styles.md" topic in docs
444  Changes:
445    - The base mod is now marked as optional, to allow compatibility with total overhaul mods
446  Bugfixes:
447    - Fixed a crash with the GUI module when a handler was removed between mod versions while being registered in global
448    - Fixed that gui.remove_player_filters() would not update lookup tables
449---------------------------------------------------------------------------------------------------
450Version: 0.1.5
451Date: 2020-06-30
452  Changes:
453    - Moved styles into prototypes/styles
454  Bugfixes:
455    - Fixed nonexistent sound file error by inheriting from parent #13
456---------------------------------------------------------------------------------------------------
457Version: 0.1.4
458Date: 2020-06-18
459  Bugfixes:
460    - Fixed a crash with the translation module related to old code having incorrect variable names
461---------------------------------------------------------------------------------------------------
462Version: 0.1.3
463Date: 2020-06-18
464  Features:
465    - Added a myriad of colored slot styles; see "slot-styles.md" topic in docs
466---------------------------------------------------------------------------------------------------
467Version: 0.1.2
468Date: 2020-06-10
469  Bugfixes:
470    - get_energy_value didn't parse energy strings with no SI prefix or deka
471---------------------------------------------------------------------------------------------------
472Version: 0.1.1
473Date: 2020-06-10
474  Features:
475    - get_energy_value supports exponents from 10^-24 to 10^24
476  Bugfixes:
477    - get_energy_value returned string, string instead of nil when unable to parse exponent
478---------------------------------------------------------------------------------------------------
479Version: 0.1.0
480Date: 2020-05-24
481  Features:
482    - Initial release