diff --git a/data/trackassembly/tools/peaces_manager/emd.bat b/data/trackassembly/tools/peaces_manager/emd.bat index d73ed89b..55ce66e4 100644 --- a/data/trackassembly/tools/peaces_manager/emd.bat +++ b/data/trackassembly/tools/peaces_manager/emd.bat @@ -30,45 +30,67 @@ set emd_chew_dbase=%emd_chew_gmod%\garrysmod\data\trackassembly\exp\trackasmlib_ set emd_chew_skip=%emd_chew_repo%\data\trackassembly\tools\peaces_manager\models_ignored.txt :: How many addons are to be processed -set emd_chew_addcnt=17 +set emd_chew_addcnt=28 :: GMA addons to be processed -set emd_chew_addlst[1]=149759773 -set emd_chew_addlst[2]=147812851 -set emd_chew_addlst[3]=132843280 -set emd_chew_addlst[4]=173482196 -set emd_chew_addlst[5]=290130567 -set emd_chew_addlst[6]=326640186 -set emd_chew_addlst[7]=173717507 -set emd_chew_addlst[8]=331192490 -set emd_chew_addlst[9]=517442747 -set emd_chew_addlst[10]=718239260 -set emd_chew_addlst[11]=728833183 -set emd_chew_addlst[12]=807162936 -set emd_chew_addlst[13]=740453553 -set emd_chew_addlst[14]=1658816805 -set emd_chew_addlst[15]=1888013789 -set emd_chew_addlst[16]=1955876643 -set emd_chew_addlst[17]=3071058065 +set emd_chew_addlst[1]=740453553 +set emd_chew_addlst[2]=2194528273 +set emd_chew_addlst[3]=807162936 +set emd_chew_addlst[4]=489114511 +set emd_chew_addlst[5]=180210973 +set emd_chew_addlst[6]=718239260 +set emd_chew_addlst[7]=XXX +set emd_chew_addlst[8]=1658816805 +set emd_chew_addlst[9]=290130567 +set emd_chew_addlst[10]=1336622735 +set emd_chew_addlst[11]=2340192251 +set emd_chew_addlst[12]=590574800 +set emd_chew_addlst[13]=517442747 +set emd_chew_addlst[14]=1512053748 +set emd_chew_addlst[15]=343061215 +set emd_chew_addlst[16]=634000136 +set emd_chew_addlst[17]=865735701 +set emd_chew_addlst[18]=728833183 +set emd_chew_addlst[19]=173482196 +set emd_chew_addlst[20]=326640186 +set emd_chew_addlst[21]=147812851 +set emd_chew_addlst[22]=149759773 +set emd_chew_addlst[23]=173717507 +set emd_chew_addlst[24]=132843280 +set emd_chew_addlst[25]=147812851 +set emd_chew_addlst[26]=331192490 +set emd_chew_addlst[27]=1888013789 +set emd_chew_addlst[28]=1955876643 :: Folder list for extraction and the directories they will be extracted -set emd_chew_adddir[1]=SligWolf's Minitrains -set emd_chew_adddir[2]=SligWolf's Minihover$SligWolf's White Rails -set emd_chew_adddir[3]=SligWolf's Rerailers -set emd_chew_adddir[4]=SProps -set emd_chew_adddir[5]=Magnum's Rails -set emd_chew_adddir[6]=Shinji85's Rails -set emd_chew_adddir[7]=SligWolf's Railcar -set emd_chew_adddir[8]=StevenTechno's Buildings 1.0 -set emd_chew_adddir[9]=Mr.Train's M-Gauge -set emd_chew_adddir[10]=G Scale Track Pack -set emd_chew_adddir[11]=Ron's Minitrain Props -set emd_chew_adddir[12]=Battleship's abandoned rails -set emd_chew_adddir[13]=AlexCookie's 2ft track pack -set emd_chew_adddir[14]=Joe's track pack -set emd_chew_adddir[15]=StevenTechno's Buildings 2.0 -set emd_chew_adddir[16]=Trackmania United Props -set emd_chew_adddir[17]=Fortification Collection +set emd_chew_adddir[1]=AlexCookie's 2ft track pack +set emd_chew_adddir[2]=Anyone's Horrible Trackpack +set emd_chew_adddir[3]=Battleship's abandoned rails +set emd_chew_adddir[4]=Bobster's two feet rails +set emd_chew_adddir[5]=CAP Walkway +set emd_chew_adddir[6]=G Scale Track Pack +set emd_chew_adddir[7]=Joe's 2ft track pack +set emd_chew_adddir[8]=Joe's track pack +set emd_chew_adddir[9]=Magnum's Rails +set emd_chew_adddir[10]=Modular Canals +set emd_chew_adddir[11]=Modular Sewer +set emd_chew_adddir[12]=Mr.Train's G-Gauge +set emd_chew_adddir[13]=Mr.Train's M-Gauge +set emd_chew_adddir[14]=Plarail +set emd_chew_adddir[15]=Random Bridges +set emd_chew_adddir[16]=Ron's 2ft track pack +set emd_chew_adddir[17]=Ron's G Scale Track pack +set emd_chew_adddir[18]=Ron's Minitrain Props +set emd_chew_adddir[19]=SProps +set emd_chew_adddir[20]=Shinji85's Rails +set emd_chew_adddir[21]=SligWolf's Minihover +set emd_chew_adddir[22]=SligWolf's Minitrains +set emd_chew_adddir[23]=SligWolf's Railcar +set emd_chew_adddir[24]=SligWolf's Rerailers +set emd_chew_adddir[25]=SligWolf's White Rails +set emd_chew_adddir[26]=StevenTechno's Buildings 1.0 +set emd_chew_adddir[27]=StevenTechno's Buildings 2.0 +set emd_chew_adddir[28]=Trackmania United Props :: Show the current folder echo Running in: %emd_chew_pathb% @@ -78,10 +100,17 @@ set emd_chew_modls=models_list set emd_clog_lfile=system_log :: Refresh model report -del %emd_chew_pathb%%emd_chew_modls%.txt -del %emd_chew_pathb%%emd_clog_lfile%.txt +echo Refresh model report! +IF EXIST "%emd_chew_pathb%%emd_chew_modls%.txt" ( call del %emd_chew_pathb%%emd_chew_modls%.txt ) +IF EXIST "%emd_chew_pathb%%emd_clog_lfile%.txt" ( call del %emd_chew_pathb%%emd_clog_lfile%.txt ) + +:: Refresh output files +echo Refresh output files! +IF EXIST "%emd_chew_pathb%addon-db.txt" ( del %emd_chew_pathb%addon-db.txt ) +IF EXIST "%emd_chew_pathb%db-addon.txt" ( del %emd_chew_pathb%db-addon.txt ) :: Extract the GMA addons in the matching folders +echo Extract the GMA addons in the matching folders! for /L %%k in (1,1,%emd_chew_addcnt%) do ( set /A emd_chew_match=0 :: Try the addons folder @@ -89,7 +118,7 @@ for /L %%k in (1,1,%emd_chew_addcnt%) do ( :: Extract addon info set "emd_chew_fdid=!emd_chew_addlst[%%k]!" set "emd_chew_fdnm=!emd_chew_adddir[%%k]!" - :: Create search path + :: Create search path set emd_chew_fgma=!emd_chew_addon!\* set emd_chew_fgma=!emd_chew_fgma!!emd_chew_fdid!* set emd_chew_fgma=!emd_chew_fgma!.!emd_chew_adext! @@ -98,9 +127,9 @@ for /L %%k in (1,1,%emd_chew_addcnt%) do ( set /A emd_chew_match=1 :: Extract the GMA in the current folder cd %emd_chew_pathb% - IF EXIST "!emd_chew_fdnm!\" ( rd /S /Q "!emd_chew_fdnm!" ) + IF EXIST "!emd_chew_fdnm!\" ( call rd /S /Q "!emd_chew_fdnm!" ) call %emd_chew_binloc%\gmad.exe extract -file "%%i" -out "%emd_chew_pathb%!emd_chew_fdnm!" >> %emd_clog_lfile%.txt - echo Addons: [%%k]{!emd_chew_fdnm!} @ %TIME% + echo A: [%%k]{!emd_chew_fdnm!} @ %TIME% ) ) :: Try the workshop content folder @@ -116,26 +145,23 @@ for /L %%k in (1,1,%emd_chew_addcnt%) do ( set /A emd_chew_match=1 :: Extract the GMA in the current folder cd %emd_chew_pathb% - IF EXIST "!emd_chew_fdnm!\" ( rd /S /Q "!emd_chew_fdnm!" ) + IF EXIST "!emd_chew_fdnm!\" ( call rd /S /Q "!emd_chew_fdnm!" ) call %emd_chew_binloc%\gmad.exe extract -file "%%i" -out "%emd_chew_pathb%!emd_chew_fdnm!" >> %emd_clog_lfile%.txt - echo Workshop: [%%k]{!emd_chew_fdnm!} @ %TIME% + echo W: [%%k]{!emd_chew_fdnm!} @ %TIME% ) ) :: Try the workshop content folder IF !emd_chew_match! EQU 0 ( - echo Not-Available: [%%k]{!emd_chew_fdnm!} @ %TIME% + echo X: [%%k]{!emd_chew_fdnm!} @ %TIME% ) ) :: Get all the model files in the current directory -dir /a-d /b /s *.mdl >> %emd_chew_pathb%%emd_chew_modls%.txt - -:: Refresh output files -del %emd_chew_pathb%addon-db.txt -del %emd_chew_pathb%db-addon.txt +echo Read model files in the current directory! +call dir /a-d /b /s *.mdl >> %emd_chew_pathb%%emd_chew_modls%.txt :: Chewing the paths uses base path relative to the executable -echo Rinning pieces manager +echo Chewing the paths uses base path relative to the executable! call %emd_chew_pathb%peaces_manager.exe %emd_chew_pathb% %emd_chew_dbase% %emd_chew_skip% %emd_clog_lfile% timeout 300 diff --git a/data/trackassembly/tools/peaces_manager/main.cpp b/data/trackassembly/tools/peaces_manager/main.cpp index 80128c09..4bf37f11 100644 --- a/data/trackassembly/tools/peaces_manager/main.cpp +++ b/data/trackassembly/tools/peaces_manager/main.cpp @@ -31,12 +31,19 @@ int main(int argc, char **argv) { /* Only for test ! */ /* + argc: <5> + argv[0]= + argv[1]= + argv[2]= + argv[3]= + argv[4]= + int argc = 5; char argv[5][500]; - strcpy(argv[0], "O:\\Documents\\CodeBlocks-Projs\\peaces_manager\\bin\\peaces_manager.exe"); - strcpy(argv[1], "O:\\Documents\\CodeBlocks-Projs\\peaces_manager\\bin\\"); - strcpy(argv[2], "F:\\Games\\Steam\\steamapps\\common\\GarrysMod\\garrysmod\\data\\trackassembly\\trackasmlib_db.txt"); - strcpy(argv[3], "F:\\Games\\Steam\\steamapps\\common\\GarrysMod\\garrysmod\\addons\\TrackAssemblyTool_GIT\\data\\peaces_manager\\models_ignored.txt"); + strcpy(argv[0], "G:\\Documents\\CodeBlocks-Projs\\peaces_manager\\bin\\peaces_manager.exe"); + strcpy(argv[1], "G:\\Documents\\CodeBlocks-Projs\\peaces_manager\\bin\\"); + strcpy(argv[2], "D:\\Games\\Steam\\steamapps\\common\\GarrysMod\\garrysmod\\data\\trackassembly\\exp\\trackasmlib_db.txt"); + strcpy(argv[3], "D:\\Games\\Steam\\steamapps\\common\\GarrysMod\\garrysmod\\addons\\TrackAssemblyTool_GIT\\data\\trackassembly\\tools\\peaces_manager\\models_ignored.txt"); strcpy(argv[4], "system_log"); */ stentry::cEntryStack Ignored; diff --git a/data/trackassembly/tools/peaces_manager/peaces_manager.cbp b/data/trackassembly/tools/peaces_manager/peaces_manager.cbp index 63a68889..6876e29a 100644 --- a/data/trackassembly/tools/peaces_manager/peaces_manager.cbp +++ b/data/trackassembly/tools/peaces_manager/peaces_manager.cbp @@ -21,17 +21,11 @@ - - - - - - - + diff --git a/data/trackassembly/tools/peaces_manager/string_stack.h b/data/trackassembly/tools/peaces_manager/string_stack.h index 635e5c1e..20db800e 100644 --- a/data/trackassembly/tools/peaces_manager/string_stack.h +++ b/data/trackassembly/tools/peaces_manager/string_stack.h @@ -2,7 +2,7 @@ #define __STRING_STACK_H_ #define SSTACK_STRLN 500 - #define SSTACK_DEPTH 10000 + #define SSTACK_DEPTH 50000 #define SSTACK_SUCCESS 0 #define SSTACK_INVALID_ID -1 #define SSTACK_MALLOC_FAIL -2 @@ -116,7 +116,7 @@ strOther = Other->getString(oItem); if(NULL != strOther) { - // fprintf(File,"Try: #%d <%s> # <%s>\n",AdID,AdName,strOther->Data); + // fprintf(File,"Try: #%d <%s> --> <%s>\n",AdID,AdName,strOther->Data); iStatus = findStringID(0,strOther->Data); if(SSTACK_NOT_FOUND == iStatus) { diff --git a/data/trackassembly/tools/peaces_manager/struct_entry.h b/data/trackassembly/tools/peaces_manager/struct_entry.h index a6501fe0..007e9011 100644 --- a/data/trackassembly/tools/peaces_manager/struct_entry.h +++ b/data/trackassembly/tools/peaces_manager/struct_entry.h @@ -1,11 +1,9 @@ #ifndef __STRING_STACK_H_ #define __STRING_STACK_H_ // The maximum string length for a item - #define SSTACK_STRLN 300 - // String creator name length - #define SSTACK_STRLN 300 + #define SSTACK_STRLN 500 // How deep is the stack - #define SSTACK_DEPTH 5000 + #define SSTACK_DEPTH 50000 // Type used for storing booleans // 0 -> Ignored by cross-add from the same creator #define SSTACK_TYPE_FLAGS unsigned char @@ -165,7 +163,7 @@ enOther = Other->getEntry(oItem); if(SSTACK_INV_POINTER != enOther) { - common::logSystem(fLog,"printMismatch: Found #%d <%s> # <%s>",AdID,AdName,enOther->Data); + common::logSystem(fLog,"printMismatch: Found #%d <%s> --> <%s>",AdID,AdName,enOther->Data); stErr = findEntryID(0,enOther->Data,&gItem); if(SSTACK_NOT_FOUND == stErr) { diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index ba6792ea..bdc45dce 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -85,7 +85,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present ------------ CONFIGURE ASMLIB ------------ asmlib.InitBase("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","8.733") +asmlib.SetOpVar("TOOL_VERSION","8.734") asmlib.SetIndexes("V" ,1,2,3) asmlib.SetIndexes("A" ,1,2,3) asmlib.SetIndexes("WV",1,2,3) diff --git a/lua/trackassembly/trackasmlib.lua b/lua/trackassembly/trackasmlib.lua index 59fa7068..28c65f74 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -3128,19 +3128,24 @@ end ]] local function ExportPanelDB(stPanel, bExp, makTab, sFunc) if(bExp) then + local sMiss = GetOpVar("MISS_NOAV") local sExpo = GetOpVar("DIRPATH_EXP") local sMoDB = GetOpVar("MODE_DATABASE") - local symSep = GetOpVar("OPSYM_SEPARATOR") + local symSep, cT = GetOpVar("OPSYM_SEPARATOR") local iCnt, sBase = 1, GetOpVar("DIRPATH_BAS") if(not fileExists(sBase, "DATA")) then fileCreateDir(sBase) end local fName = (sBase..sExpo..GetOpVar("NAME_LIBRARY").."_db.txt") - local F = fileOpen(fName, "wb" ,"DATA"); if(not F) then + local F = fileOpen(fName, "wb" ,"DATA"), sMiss; if(not F) then LogInstance("Open fail "..GetReport1(fName)); return stPanel end F:Write("# "..sFunc..":("..tostring(bExp)..") "..GetDateTime().." [ "..sMoDB.." ]\n") while(stPanel[iCnt]) do local vPanel = stPanel[iCnt] local sM = vPanel[makTab:GetColumnName(1)] local sT = vPanel[makTab:GetColumnName(2)] local sN = vPanel[makTab:GetColumnName(3)] + if(not cT or cT ~= sT) then -- Category has been changed + F:Write("# Categorize [ "..sMoDB.." ]("..sT.."): "..tostring(WorkshopID(sT) or sMiss)) + F:Write("\n"); cT = sT -- Cashe category name + end -- Otherwise just wite down the piece active point F:Write("\""..sM.."\""..symSep.."\""..sT.."\""..symSep.."\""..sN.."\"") F:Write("\n"); iCnt = iCnt + 1 end; F:Flush(); F:Close()