this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1684 from joshgoebel/go_pro

suggest pro when trying to open source with standard

authored by

Vadim Grigoruk and committed by
GitHub
558c64dc dc2042ea

+34 -13
-11
src/studio/project.c
··· 131 131 return Languages[0]->projectComment; 132 132 } 133 133 134 - bool tic_project_ext(const char* name) 135 - { 136 - FOR_EACH_LANG(ln) 137 - { 138 - if(tic_tool_has_ext(name, ln->fileExtension)) 139 - return true; 140 - } 141 - FOR_EACH_LANG_END 142 - return false; 143 - } 144 - 145 134 s32 tic_project_save(const char* name, void* data, const tic_cartridge* cart) 146 135 { 147 136 const char* comment = projectComment(name);
-1
src/studio/project.h
··· 26 26 27 27 bool tic_project_load(const char* name, const char* data, s32 size, tic_cartridge* dst); 28 28 s32 tic_project_save(const char* name, void* data, const tic_cartridge* cart); 29 - bool tic_project_ext(const char* name);
+21 -1
src/studio/screens/console.c
··· 22 22 23 23 #include "console.h" 24 24 #include "start.h" 25 + #include "tools.h" 25 26 #include "studio/fs.h" 26 27 #include "studio/net.h" 27 28 #include "studio/config.h" ··· 59 60 #define CONSOLE_BACK_TEXT_COLOR tic_color_grey 60 61 #define CONSOLE_FRONT_TEXT_COLOR tic_color_light_grey 61 62 #define CONSOLE_ERROR_TEXT_COLOR tic_color_red 63 + #define CONSOLE_LINK_TEXT_COLOR tic_color_blue 62 64 #define CONSOLE_CURSOR_BLINK_PERIOD TIC80_FRAMERATE 63 65 #define CONSOLE_CURSOR_DELAY (TIC80_FRAMERATE / 2) 64 66 #define CONSOLE_BUFFER_WIDTH (STUDIO_TEXT_BUFFER_WIDTH) ··· 416 418 static void printFront(Console* console, const char* text) 417 419 { 418 420 consolePrint(console, text, CONSOLE_FRONT_TEXT_COLOR); 421 + } 422 + 423 + static void printLink(Console* console, const char* text) 424 + { 425 + consolePrint(console, text, CONSOLE_LINK_TEXT_COLOR); 419 426 } 420 427 421 428 static void printError(Console* console, const char* text) ··· 926 933 } 927 934 else printError(console, "\nfile not found"); 928 935 #else 929 - printError(console, "\ncart loading error"); 936 + if(tic_project_ext(name)) { 937 + printError(console, "\nproject loading error"); 938 + printFront(console, "\nThis version only supports binary .png or .tic cartridges."); 939 + printLine(console); 940 + printFront(console, "\nTIC-80 "); 941 + consolePrint(console,"PRO",tic_color_light_blue); 942 + printFront(console, " is needed for text files."); 943 + printLine(console); 944 + printFront(console, "\nLearn more:\n"); 945 + printLink(console, "https://tic80.com/pro"); 946 + } else { 947 + printError(console, "\ncart loading error"); 948 + } 949 + 930 950 #endif 931 951 } 932 952 }
+11
src/tools.c
··· 149 149 return pal; 150 150 } 151 151 152 + bool tic_project_ext(const char* name) 153 + { 154 + FOR_EACH_LANG(ln) 155 + { 156 + if(tic_tool_has_ext(name, ln->fileExtension)) 157 + return true; 158 + } 159 + FOR_EACH_LANG_END 160 + return false; 161 + } 162 + 152 163 bool tic_tool_has_ext(const char* name, const char* ext) 153 164 { 154 165 return strcmp(name + strlen(name) - strlen(ext), ext) == 0;
+2
src/tools.h
··· 22 22 23 23 #pragma once 24 24 25 + #include "api.h" 25 26 #include "tic.h" 26 27 #include <stddef.h> 27 28 ··· 82 83 s32 tic_tool_get_pattern_id(const tic_track* track, s32 frame, s32 channel); 83 84 void tic_tool_set_pattern_id(tic_track* track, s32 frame, s32 channel, s32 id); 84 85 u32* tic_tool_palette_blit(const tic_palette* src, tic80_pixel_color_format fmt); 86 + bool tic_project_ext(const char* name); 85 87 bool tic_tool_has_ext(const char* name, const char* ext); 86 88 s32 tic_tool_get_track_row_sfx(const tic_track_row* row); 87 89 void tic_tool_set_track_row_sfx(tic_track_row* row, s32 sfx);