diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index d0d0de577..d8411a729 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -9,14 +9,13 @@ https://tuxpaint.org/ 2023.December.29 (0.9.32) * Improvements to Magic tools: ---------------------------- - * WIP - Support for complexity levels in Magic tools via the - plugin API. + * Support for complexity levels in Magic tools via the plugin API. (Closes https://sourceforge.net/p/tuxpaint/feature-requests/247/) - + WIP - Complexity/expertise level may be set via configuration, + + Complexity/expertise level may be set via configuration, `--complexity`; values may be "advanced" (default), "beginner", or "novice". - + WIP - Plugins' "init()" functions are sent a new - `complexity_level` argument. + + Plugins' "init()" functions are sent a new `complexity_level` + argument. + Note: Bumps `TP_MAGIC_API_VERSION` to 0x00000009. Bill Kendrick @@ -37,7 +36,12 @@ https://tuxpaint.org/ + 3-point Perspective ("3-Point Select" & "3-Point Draw") Choose three vanishing points, and then draw lines that always point towards them, or along the horizon defined by the first two. - + Tools do not operate when in "novice" complexity mode. + + None of these tools are available when in "novice" complexity mode + (see above). + + WIP - "Select" tools (to edit vanishing points) are not offered + when in "beginner" complexity mode. + - WIP - Also, two "3-Point Draw" tools are provided in "beginner" + mode, to offer both 'looking up' and 'looking down' perspectives. + Code: Bill Kendrick + Sounds: - Select: "Gummibandloop_121.wav" diff --git a/src/parse.gperf b/src/parse.gperf index 95f1400d9..62d4ab30a 100644 --- a/src/parse.gperf +++ b/src/parse.gperf @@ -111,6 +111,7 @@ altprintnever, MULTI(alt_print_command_default) autosave, POSBOOL(autosave_on_quit) buttondistinction, NEGBOOL(no_button_distinction) colorfile, MULTI(colorfile) +complexity, MULTI(complexity) complexshapes, NEGBOOL(simple_shapes) copying, IMM(copying) currentlocalefont, NEGBOOL(all_locale_fonts) diff --git a/src/parse.h b/src/parse.h index 96264a7f7..e216767b9 100644 --- a/src/parse.h +++ b/src/parse.h @@ -12,6 +12,7 @@ struct cfginfo const char *altprintcommand; const char *autosave_on_quit; const char *colorfile; + const char *complexity; const char *datadir; const char *disable_label; const char *disable_brushspacing; diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 77e1f91e6..2235ce76b 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -28370,6 +28370,21 @@ static void setup_config(char *argv[]) stamp_size_override = 10; } } + if (tmpcfg.complexity) + { + /* FIXME: Could maybe iterate the array of MAGIC_COMPLEXITY_LEVEL_NAMES[], + but just hard-coding for now -bjk 2023.12.29 */ + if (!strcmp(tmpcfg.complexity, "novice")) { + magic_complexity_level = MAGIC_COMPLEXITY_NOVICE; + } else if (!strcmp(tmpcfg.complexity, "beginner")) { + magic_complexity_level = MAGIC_COMPLEXITY_BEGINNER; + } else if (!strcmp(tmpcfg.complexity, "advanced")) { + magic_complexity_level = MAGIC_COMPLEXITY_ADVANCED; + } else { + fprintf(stderr, "Ignoring unknown 'complexity' value \"%s\"\n", tmpcfg.complexity); + } + } + /* FIXME: make this dynamic (accelerometer or OLPC XO-1 rotation button) */ if (tmpcfg.rotate_orientation) rotate_orientation = !strcmp(tmpcfg.rotate_orientation, "portrait"); /* alternative is "landscape" */