diff --git a/doc/COMPILING.txt b/doc/COMPILING.txt index c3d753ac..b401c738 100644 --- a/doc/COMPILING.txt +++ b/doc/COMPILING.txt @@ -10,7 +10,7 @@ Grafx2 compilation and installation * libpng (not on MacOSX) * FreeType library (optional, for truetype fonts) * SDL_ttf library (optional, for truetype fonts) -* Lua library v5.1 (optional, for Lua scripting) +* Lua library v5.1 or v5.2 (optional, for Lua scripting) Extra requirements for Windows: * a POSIX environment: MSYS is fine, maybe Cygwin would work as well. @@ -175,7 +175,7 @@ SDL_ttf: Lua: (optional) - http://www.lua.org/ftp/lua-5.1.4.tar.gz + http://www.lua.org/ftp/lua-5.2.1.tar.gz Uncompress in temporary directory Use sh shell make mingw diff --git a/share/grafx2/gfx2def.ini b/share/grafx2/gfx2def.ini index 85077ebb..0af0e498 100644 --- a/share/grafx2/gfx2def.ini +++ b/share/grafx2/gfx2def.ini @@ -407,4 +407,9 @@ ; Tilemap_count = no; (Default no) + ; Enables the virtual keyboard when the user enters a textbox. + ; + ; 0=Auto (guess), 1=ON, 2=OFF + Use_virtual_keyboard = 0; (Default 0) + ; end of configuration diff --git a/src/factory.c b/src/factory.c index 6f7bbdf9..083a80aa 100644 --- a/src/factory.c +++ b/src/factory.c @@ -143,6 +143,11 @@ do { \ return luaL_error(L, "%s: Expected %d arguments, but found %d.", func_name, (num), nb_args); \ } while(0) +const char * Lua_version(void) +{ + return LUA_VERSION_MAJOR "." LUA_VERSION_MINOR; +} + // Updates the screen colors after a running screen has modified the palette. void Update_colors_during_script(void) { @@ -2142,9 +2147,18 @@ void Button_Brush_Factory(void) } #else // NOLUA + void Button_Brush_Factory(void) { Verbose_message("Error!", "The brush factory is not available in this build of GrafX2."); } +/// +/// Returns a string stating the included Lua engine version, +/// or "Disabled" if Grafx2 is compiled without Lua. +const char * Lua_version(void) +{ + return "Disabled"; +} + #endif diff --git a/src/factory.h b/src/factory.h index 3a1a54f5..ee72f878 100644 --- a/src/factory.h +++ b/src/factory.h @@ -11,3 +11,8 @@ extern char * Bound_script[10]; /// Before: Cursor hidden /// After: Cursor shown void Run_numbered_script(byte index); + +/// +/// Returns a string stating the included Lua engine version, +/// or "Disabled" if Grafx2 is compiled without Lua. +const char * Lua_version(void); \ No newline at end of file diff --git a/src/help.c b/src/help.c index 502b547f..f1889cf9 100644 --- a/src/help.c +++ b/src/help.c @@ -57,6 +57,7 @@ #include "hotkeys.h" #include "errors.h" #include "pages.h" +#include "factory.h" extern char Program_version[]; // generated in pversion.c extern char SVN_revision[]; // generated in pversion.c @@ -690,6 +691,7 @@ void Button_Stats(void) dword color_usage[256]; unsigned long long freeRam; qword mem_size = 0; + int y; Open_window(310,174,"Statistics"); @@ -701,17 +703,20 @@ void Button_Stats(void) Window_set_normal_button(120,153,70,14,"OK",0,1,KEY_ESC); // 1 - // Affichage du numéro de version - Print_in_window(10,19,"Program version:",STATS_TITLE_COLOR,MC_Black); + y=19; // row for first line + Print_in_window(10,y,"Program version:",STATS_TITLE_COLOR,MC_Black); sprintf(buffer,"%s.%s",Program_version, SVN_revision); - Print_in_window(146,19,buffer,STATS_DATA_COLOR,MC_Black); - Print_in_window(10,35,"Build options:",STATS_TITLE_COLOR,MC_Black); - Print_in_window(146,35,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black); - + Print_in_window(146,y,buffer,STATS_DATA_COLOR,MC_Black); + y+=16; + Print_in_window(10,y,"Build options:",STATS_TITLE_COLOR,MC_Black); + Print_in_window(146,y,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black); + y+=8; + Print_in_window(10,y,"Lua version:",STATS_TITLE_COLOR,MC_Black); + Print_in_window_limited(146,y,Lua_version(),10,STATS_DATA_COLOR,MC_Black); + y+=16; + Print_in_window(10,y,"Free memory: ",STATS_TITLE_COLOR,MC_Black); #if defined (__MINT__) // Display free TT/ST RAM - Print_in_window(10,43,"Free memory: ",STATS_TITLE_COLOR,MC_Black); - freeRam=0; char helpBuf[64]; @@ -750,12 +755,10 @@ void Button_Stats(void) sprintf(helpBuf,"(%u b)",(unsigned int)freeRam); strncat(buffer,helpBuf,sizeof(char)*37); - Print_in_window(18,51,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(18,y,buffer,STATS_DATA_COLOR,MC_Black); #else // Display free RAM (generic) - Print_in_window(10,51,"Free memory: ",STATS_TITLE_COLOR,MC_Black); - freeRam = Memory_free(); if(freeRam > (100ULL*1024*1024*1024)) @@ -767,21 +770,22 @@ void Button_Stats(void) else sprintf(buffer,"%u bytes",(unsigned int)freeRam); - Print_in_window(114,51,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(114,y,buffer,STATS_DATA_COLOR,MC_Black); #endif - + y+=8; // Used memory - Print_in_window(10,59,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black); + Print_in_window(10,y,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black); if(Stats_pages_memory > (100LL*1024*1024*1024)) sprintf(buffer,"%ld (%lld Gb)",Stats_pages_number, Stats_pages_memory/(1024*1024*1024)); else if(Stats_pages_memory > (100*1024*1024)) sprintf(buffer,"%ld (%lld Mb)",Stats_pages_number, Stats_pages_memory/(1024*1024)); else sprintf(buffer,"%ld (%lld Kb)",Stats_pages_number, Stats_pages_memory/1024); - Print_in_window(162,59,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(162,y,buffer,STATS_DATA_COLOR,MC_Black); + y+=8; #if defined(__WIN32__) { ULARGE_INTEGER tailleU; @@ -826,7 +830,7 @@ void Button_Stats(void) #else sprintf(buffer,"Free space on %c:",Main_current_directory[0]); #endif - Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black); + Print_in_window(10,y,buffer,STATS_TITLE_COLOR,MC_Black); if(mem_size > (100ULL*1024*1024*1024)) sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024))); @@ -837,36 +841,40 @@ void Button_Stats(void) else sprintf(buffer,"%u bytes",(unsigned int)mem_size); #if defined(__AROS__) - Print_in_window(192,67,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(192,y,buffer,STATS_DATA_COLOR,MC_Black); #else - Print_in_window(146,67,buffer,STATS_DATA_COLOR,MC_Black); + Print_in_window(146,y,buffer,STATS_DATA_COLOR,MC_Black); #endif } else { #ifndef NODISKSPACESUPPORT - Print_in_window(10,67,"Disk full!",STATS_TITLE_COLOR,MC_Black); + Print_in_window(10,y,"Disk full!",STATS_TITLE_COLOR,MC_Black); #endif #undef NODISKSPACESUPPORT } - + + y+=16; // Affichage des informations sur l'image - Print_in_window(10,83,"Picture info.:",STATS_TITLE_COLOR,MC_Black); - + Print_in_window(10,y,"Picture info.:",STATS_TITLE_COLOR,MC_Black); + y+=8; + // Affichage des dimensions de l'image - Print_in_window(18,91,"Dimensions :",STATS_TITLE_COLOR,MC_Black); + Print_in_window(18,y,"Dimensions :",STATS_TITLE_COLOR,MC_Black); sprintf(buffer,"%dx%d",Main_image_width,Main_image_height); - Print_in_window(122,91,buffer,STATS_DATA_COLOR,MC_Black); - + Print_in_window(122,y,buffer,STATS_DATA_COLOR,MC_Black); + y+=8; + // Affichage du nombre de couleur utilisé - Print_in_window(18,99,"Colors used:",STATS_TITLE_COLOR,MC_Black); + Print_in_window(18,y,"Colors used:",STATS_TITLE_COLOR,MC_Black); memset(color_usage,0,sizeof(color_usage)); sprintf(buffer,"%d",Count_used_colors(color_usage)); - Print_in_window(122,99,buffer,STATS_DATA_COLOR,MC_Black); - + Print_in_window(122,y,buffer,STATS_DATA_COLOR,MC_Black); + y+=16; + // Affichage des dimensions de l'écran - Print_in_window(10,115,"Resolution:",STATS_TITLE_COLOR,MC_Black); + Print_in_window(10,y,"Resolution:",STATS_TITLE_COLOR,MC_Black); sprintf(buffer,"%dx%d",Screen_width,Screen_height); - Print_in_window(106,115,buffer,STATS_DATA_COLOR,MC_Black); - + Print_in_window(106,y,buffer,STATS_DATA_COLOR,MC_Black); + Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*310,Menu_factor_Y*174); Display_cursor();