Skip to content
Guiled edited this page Apr 17, 2025 · 35 revisions

Let's Role Enhanced !

What is LRE ?

LRE (for Let's role enhanced) is a utility to facilitate use of some features of Let's role that are a bit tricky. LRE adds some more features to enhance let's role scripting experience.

LRE 7 ?

LRE 7 is a major improvement of LRE fully written in typescript and fully tested.

Breaking changes from LRE 6

If you were already using LRE 6, you must consider the following breaking changes. The good counterpart is that LRE 7 comes with less breaking changes for vanilla Let's role scripting users.

Here are the LRE6 features that don't work anymore.

  • LRE_AUTONUM = true is now replaced by lre.autoNum(true).
  • lre() still works but prefer using lre.init() instead.
  • component.on() replaces the previously defined event of the same type. Use the LRE aliased event notation like component.on("update:second", …)
  • isObject() is replaced by lre.isObject()
  • numToAlpha() and alphaToNum() are respectively replaced by lre.numToAlpha() and lre.alphaToNum()

Usage

LRE is easy to insert into your project. Copy/paste the content of the latest lre.js release, and change your init by adding lre( … ) around the function.

init = lre(function (sheet) {
};

You now have a richer sheet parameter that will give you rich components. See the Sheet documentation

LRE options

LRE has some optional behaviors that must be manually activated

  • LRE.setLogLevel() in order to use the log feature provided by LRE
  • LRE.autoNum() that will convert all numeric value into numbers from components, tables, etc. (say goodbye to parseInt()). See the doc here
  • LRE.autoTransl() that will translate all non numeric string value from components, tables, etc. (say goodbye to _() as well). See the doc here

LRE features

Clone this wiki locally