Mlogjs Versions Save

Compile javascript into Mindustry logic code (mlog)

v0.5.2

1 year ago

Deprecated

  • Deprecated the unitControl.pathfind command, as it is not available in the latest game version.

v0.5.1

1 year ago

Changed

  • The fill method of dynamic arrays is no longer inlined.
  • The temporary getter and setter values of dynamic arrays have been renamed to be more readable.

Fixed

  • Fixed the concat function having inconsistent behavior.
  • Fixed the unary plus operator not converting values to numbers.
  • Fixed using the ??= operator on a dynamic array entry computing the value twice.
  • Fixed unecessary temp values being created when writing to dynamic arrays.
  • Fixed empty if statement blocks throwing an error.
  • Fixed handling of truthy values in do while loop conditions.

v0.5.0

1 year ago

Added

  • Added support for custom online editor settings.
  • Added support for a "goto" action for jump instructions in the online editor (ctrl + click).
  • Added support for multi-file editing to the online editor.
  • Added support for concat calls with tagged template literals.
  • Added support for the typescript satisfies keyword.
  • Added support for default destructuring values.
  • Added support for the draw.col command overload.
  • Added support for the unitControl.unbind command overload.
  • Added the Math.asin, Math.acos and Math.atan methods.
  • Added the Math.idiv method to perform integer division.
  • Added the Math.pow method (the ** operator is still available).
  • Added support for compression of the op + jump instructions.
  • Added optimizations to if/else statements that act as guard clauses.
  • Added optimizations to the compiler to only add the end instruction when necessary.
  • Added the setup subcommand to the CLI.
  • Added the DynamicArray macro to support arrays with variable size (and with a fixed size limit).
  • Added the MutableArray macro to support dynamically indexed arrays.

Changed

  • Memory macros can now be created with a dynamic length value.
  • (Breaking) undefined replaced null as the nullish value in the compiler.
  • unitBind now also accepts an unit object as a parameter.
  • Error messages now include information about the type of the variables.
  • unitControl.getBlock now also returns the floor of the tile.
  • (Breaking) control.color now gets RGBA data as an input instead of individual RGB values.
  • Changed the equality of stores. They are now treated as equal if they have the same runtime name.

Fixed

  • Fixed cached operations propagating across the cases of a switch.
  • Fixed the ?? operator using normal inequality instead of strict inequality.
  • Fixed the type of Vars.unit.boosting being number instead of boolean.
  • Fixed the order of operations in destructuring assignments.
  • Fixed typo on Teams.derelict (was Teams.delerict).
  • Fixed the internal implementations of Math.sin, Math.cos and Math.tan.
  • Fixed logical expressions creating unnecessary temp values.
  • Fixed optional chaning not working on null literals (null?.foo).
  • Fixed break statements not working inside do while statements.
  • Fixed functions returning values from previous calls.
  • Fixed doc examples for the fetch command.
  • Fixed the hiding of redundant jump instructions.