1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

More custom scripts (7 instead of 3)

This commit is contained in:
Bertrand Songis 2014-02-19 16:41:18 +01:00
parent 5a7fda2f81
commit 7c4214d5b9
6 changed files with 8 additions and 8 deletions

View file

@ -856,7 +856,7 @@ class ModuleData {
void clear() { memset(this, 0, sizeof(ModuleData)); }
};
#define C9X_MAX_SCRIPTS 3
#define C9X_MAX_SCRIPTS 7
#define C9X_MAX_SCRIPT_INPUTS 10
class ScriptData {
public:

View file

@ -14,3 +14,4 @@
/SOUNDS
/LOGS
/*.bat
/TEMPLATES

View file

@ -5139,8 +5139,8 @@ void onModelCustomScriptMenu(const char *result)
ScriptData &sd = g_model.scriptsData[s_currIdx];
if (result == STR_UPDATE_LIST) {
if (!listSdFiles(SCRIPTS_PATH, MIXES_EXT, sizeof(sd.file), NULL)) {
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
if (!listSdFiles(SCRIPTS_PATH, SCRIPTS_EXT, sizeof(sd.file), NULL)) {
POPUP_WARNING(STR_NO_SCRIPTS_ON_SD);
s_menu_flags = 0;
}
}
@ -5187,7 +5187,7 @@ void menuModelCustomScriptOne(uint8_t event)
lcd_putsiAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY()) {
s_editMode = 0;
if (listSdFiles(SCRIPTS_PATH, MIXES_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
if (listSdFiles(SCRIPTS_PATH, SCRIPTS_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
menuHandler = onModelCustomScriptMenu;
}
else {

View file

@ -935,10 +935,10 @@ void luaLoadModelScript(uint8_t index)
sid.state = SCRIPT_NOFILE;
if (ZEXIST(sd.file)) {
char filename[sizeof(SCRIPTS_PATH)+sizeof(sd.file)+sizeof(MIXES_EXT)] = SCRIPTS_PATH "/";
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), MIXES_EXT);
strcat(filename+sizeof(SCRIPTS_PATH), SCRIPTS_EXT);
luaLoad(filename, sid);
}
}

View file

@ -75,7 +75,7 @@
#define MAX_EXPOS 64
#define NUM_CSW 32 // number of custom switches
#define NUM_CFN 64 // number of functions assigned to switches
#define MAX_SCRIPTS 3
#define MAX_SCRIPTS 7
#define MAX_INPUTS 32
#elif defined(CPUARM)
#define MAX_MODELS 60

View file

@ -53,7 +53,6 @@
#define SOUNDS_EXT ".wav"
#define BITMAPS_EXT ".bmp"
#define SCRIPTS_EXT ".lua"
#define MIXES_EXT ".mix"
#define TEXT_EXT ".txt"
extern FATFS g_FATFS_Obj;