Home - guiled/LRE GitHub Wiki
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.
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.init(function (sheet) {
// your init code
});
initRoll = lre.initRoll(function (result, callback) {
// your initRoll code
});
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 LRELRE.autoNum()
that will convert all numeric value into numbers from components, tables, etc. (say goodbye toparseInt()
). See the doc hereLRE.autoTransl()
that will translate all non numeric string value from components, tables, etc. (say goodbye to_()
as well). See the doc here
LRE features and improvements
- Sheet : enhanced capabilities and few more functions
- Tables : create a table by script, many new functions
- Components : enhanced capabilities, many new functions
- Repeaters : easiest way to handle them
- Choices and Multichoices : new functions
- Containers : a new way to handle them and their children
- Checkbox : few more functions
- Toggles : a new component to handle icon changing on click
- Data providers : a powerful way to handle data dynamically
- LRE global functions: few useful functions
- Component groups : a new component to group other components
- Logs : a clear useful way to send to log and have a clearer error report
- Events : a powerful new way to handle events
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. If you still want to use LRE 6.24, you can download it here
Here are the LRE6 features that won't work anymore.
LRE_AUTONUM = true
is now replaced bylre.autoNum(true)
.lre()
still works but prefer usinglre.init()
instead.component.on()
replaces the previously defined event of the same type. Use the LRE aliased event notation likecomponent.on("update:second", …)
isObject()
is replaced bylre.isObject()
numToAlpha()
andalphaToNum()
are respectively replaced bylre.numToAlpha()
andlre.alphaToNum()
repeater
eventchange
has been renameentrychange
.