From 7c9df277b339e92de97f3837a25c333f25747b67 Mon Sep 17 00:00:00 2001 From: Seppi Date: Fri, 3 Nov 2017 18:11:45 -0500 Subject: [PATCH] Adding the edit command to the console Closes #375 --- src/console.c | 8 ++++++++ src/studio.c | 5 +++++ src/studio.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/console.c b/src/console.c index 9def147..ae4465d 100644 --- a/src/console.c +++ b/src/console.c @@ -852,6 +852,13 @@ static void onConsoleSurfCommand(Console* console, const char* param) commandDone(console); } +static void onConsoleCodeCommand(Console* console, const char* param) +{ + gotoCode(); + commandDone(console); +} + + static void onConsoleKeymapCommand(Console* console, const char* param) { setStudioMode(TIC_KEYMAP_MODE); @@ -1840,6 +1847,7 @@ static const struct {"config", NULL, "edit TIC config", onConsoleConfigCommand}, {"keymap", NULL, "configure keyboard mapping", onConsoleKeymapCommand}, {"version", NULL, "show the current version", onConsoleVersionCommand}, + {"edit", NULL, "open cart editor", onConsoleCodeCommand}, {"surf", NULL, "open carts browser", onConsoleSurfCommand}, }; diff --git a/src/studio.c b/src/studio.c index 3274e93..a4a116a 100644 --- a/src/studio.c +++ b/src/studio.c @@ -720,6 +720,11 @@ void gotoSurf() setStudioMode(TIC_SURF_MODE); } +void gotoCode() +{ + setStudioMode(TIC_CODE_MODE); +} + static void initMenuMode() { initMenu(&studio.menu, studio.tic, studio.fs); diff --git a/src/studio.h b/src/studio.h index f9b4ade..7486f11 100644 --- a/src/studio.h +++ b/src/studio.h @@ -189,6 +189,7 @@ bool studioCartChanged(); void playSystemSfx(s32 id); void runGameFromSurf(); +void gotoCode(); void gotoSurf(); void exitFromGameMenu(); void runProject();