Change how moveLayer works slightly, so it is easier to use in a GUI implementation

* "newPosition" is now considered to be the item's new position (index) in the list
* also update the documentation a little
This commit is contained in:
Emma Broman
2022-01-12 09:39:12 +01:00
parent 2222d3d9e0
commit 7c3d6b4c4d
4 changed files with 10 additions and 15 deletions

View File

@@ -376,12 +376,14 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const {
"moveLayer",
&globebrowsing::luascriptfunctions::moveLayer,
"string, string, number, number",
"Rearranges the order of a single layer in a scene graph node. The first "
"parameter specifies the scene graph node, the second parameter specifies "
"Rearranges the order of a single layer on a globe. The first parameter"
"is the identifier of the globe, the second parameter specifies "
"the name of the layer group, the third parameter is the original position "
"of the layer that should be moved and the last parameter is the new "
"position. The new position may be -1 to place the layer at the top or any "
"large number bigger than the number of layers to place it at the bottom."
"position in the list. The first position in the list has index 0, and the "
"last position is given by the number of layers minus one. The new position "
"may be -1 to place the layer at the top or any number bigger than the "
"number of layers to place it at the bottom."
},
{
"goToChunk",