mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Lua scripts directories changed. We will now have
/SCRIPTS/WIZARD/ /SCRIPTS/TEMPLATES/ /SCRIPTS/MIXES/ /SCRIPTS/FUNCTIONS/
This commit is contained in:
parent
87c8b4b153
commit
e3df420f8e
4 changed files with 31 additions and 23 deletions
|
@ -1179,10 +1179,10 @@ void luaLoadModelScript(uint8_t index)
|
|||
memset(&sid, 0, sizeof(sid));
|
||||
sid.reference = SCRIPT_MIX_FIRST+index;
|
||||
sid.state = SCRIPT_NOFILE;
|
||||
char filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)+sizeof(SCRIPTS_EXT)] = SCRIPTS_PATH "/";
|
||||
strncpy(filename+sizeof(SCRIPTS_PATH), sd.file, sizeof(sd.file));
|
||||
filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_PATH), SCRIPTS_EXT);
|
||||
char filename[sizeof(SCRIPTS_MIXES_PATH)+sizeof(sd.file)+sizeof(SCRIPTS_EXT)] = SCRIPTS_MIXES_PATH "/";
|
||||
strncpy(filename+sizeof(SCRIPTS_MIXES_PATH), sd.file, sizeof(sd.file));
|
||||
filename[sizeof(SCRIPTS_MIXES_PATH)+sizeof(sd.file)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_MIXES_PATH), SCRIPTS_EXT);
|
||||
luaLoad(filename, sid, sio);
|
||||
}
|
||||
}
|
||||
|
@ -1197,10 +1197,10 @@ bool luaLoadFunctionScript(uint8_t index)
|
|||
memset(&sid, 0, sizeof(sid));
|
||||
sid.reference = SCRIPT_FUNC_FIRST+index;
|
||||
sid.state = SCRIPT_NOFILE;
|
||||
char filename[sizeof(SCRIPTS_PATH)+sizeof(fn.play.name)+sizeof(SCRIPTS_EXT)] = SCRIPTS_PATH "/";
|
||||
strncpy(filename+sizeof(SCRIPTS_PATH), fn.play.name, sizeof(fn.play.name));
|
||||
filename[sizeof(SCRIPTS_PATH)+sizeof(fn.play.name)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_PATH), SCRIPTS_EXT);
|
||||
char filename[sizeof(SCRIPTS_FUNCS_PATH)+sizeof(fn.play.name)+sizeof(SCRIPTS_EXT)] = SCRIPTS_FUNCS_PATH "/";
|
||||
strncpy(filename+sizeof(SCRIPTS_FUNCS_PATH), fn.play.name, sizeof(fn.play.name));
|
||||
filename[sizeof(SCRIPTS_FUNCS_PATH)+sizeof(fn.play.name)] = '\0';
|
||||
strcat(filename+sizeof(SCRIPTS_FUNCS_PATH), SCRIPTS_EXT);
|
||||
luaLoad(filename, sid);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue