From ee1a81c3fe2787570bd4ea81b326989186133c5c Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Thu, 26 May 2016 14:23:37 +0300 Subject: [PATCH] Added: .gitattributes Changed: LF for *lua *cpp *h *txt Changed: if() reordering --- .gitattributes | 6 ++ data/todo.txt | 3 + lua/autorun/trackassembly_init.lua | 6 +- .../core/custom/trackasmlib_wire.lua | 2 +- lua/trackassembly/trackasmlib.lua | 2 +- .../gmod_tool/stools/trackassembly.lua | 5 +- workshop_publish.bat | 76 +++++++++---------- 7 files changed, 54 insertions(+), 46 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..82f9e7e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.h text eol=lf +*.cpp text eol=lf +*.lua text eol=lf +*.json text eol=lf +*.bat text eol=crlf +*.md text eol=lf diff --git a/data/todo.txt b/data/todo.txt index 56086bd..ad10691 100644 --- a/data/todo.txt +++ b/data/todo.txt @@ -3,3 +3,6 @@ X - Fail D - Discontinued N - Not applicable ? - Not yet tested + +Make TA export the database in Unix format +Make the player own the track spawned diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 8787e09..4be65bd 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -26,7 +26,7 @@ local asmlib = trackasmlib ------ CONFIGURE ASMLIB ------ asmlib.InitAssembly("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","5.237") +asmlib.SetOpVar("TOOL_VERSION","5.238") asmlib.SetLogControl(0,"") asmlib.SetIndexes("V",1,2,3) asmlib.SetIndexes("A",1,2,3) @@ -626,7 +626,7 @@ else asmlib.InsertRecord({"models/props_phx/trains/tracks/track_switch.mdl", "#", "Switch Right", 3, "", "-158.311737,338.107941, 11.218994", "0,135,0"}) asmlib.InsertRecord({"models/props_phx/trains/tracks/track_switch2.mdl", "#", "Switch Left [X]", 1, "", " 829.880005, -0.001465, 11.218994", ""}) asmlib.InsertRecord({"models/props_phx/trains/tracks/track_switch2.mdl", "#", "Switch Left [X]", 2, "", "-370.037262, -0.000456, 11.218994", "0,-180,0"}) - asmlib.InsertRecord({"models/props_phx/trains/tracks/track_switch2.mdl", "#", "Switch Left [X]", 3, "", "-158.311356,-338.111572, 11.218994", "0,-135,0"}) + asmlib.InsertRecord({"models/props_phx/trains/tracks/track_switch2.mdl", "#", "Switch Left [X]", 3, "", "-158.311356,-338.111572, 11.218994", "0,-135,0"}) asmlib.DefaultType("SProps") asmlib.SettingsModelToName("SET",nil,{"track_s0","straight_"},{"","x"}) asmlib.InsertRecord({"models/sprops/trans/train/track_s01.mdl", "#", "#", 1, "", " 0,0,7.624", ""}) @@ -1146,7 +1146,7 @@ else asmlib.InsertRecord({"models/props_wasteland/bridge_low_res.mdl", "#", "#", 1, "", "5056, 219.145, 992.765", ""}) asmlib.InsertRecord({"models/props_wasteland/bridge_low_res.mdl", "#", "#", 2, "", "-576, 219.145, 992.765", "0, 180,0"}) asmlib.DefaultType("StephenTechno's Buildings Single") - asmlib.SettingsModelToName("SET",{1,3}) + asmlib.SettingsModelToName("SET",{1,3}) asmlib.InsertRecord({"models/buildingspack/roadswsidewalk/2_1road_dl_sdw_1x1.mdl", "#", "#", 1, "", "0,0,3.03125", ""}) asmlib.InsertRecord({"models/buildingspack/roadswsidewalk/2_1road_dl_sdw_1x1.mdl", "#", "#", 2, "", "-72,0,3.03125", "0,180,0"}) asmlib.InsertRecord({"models/buildingspack/roadswsidewalk/2_2road_dl_sdw_1x2.mdl", "#", "#", 1, "", "0,0,3.03125", ""}) diff --git a/lua/entities/gmod_wire_expression2/core/custom/trackasmlib_wire.lua b/lua/entities/gmod_wire_expression2/core/custom/trackasmlib_wire.lua index 485e5ec..4621fe6 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/trackasmlib_wire.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/trackasmlib_wire.lua @@ -321,4 +321,4 @@ e2function number entity:trackasmlibAttachBodyGroups(string sBgpID) local stRecord = asmlib.CacheQueryPiece(this:GetModel()) if(not stRecord) then return 0 end return asmlib.AttachBodyGroups(this, sBgpID) and anyTrue or anyFalse -end \ No newline at end of file +end diff --git a/lua/trackassembly/trackasmlib.lua b/lua/trackassembly/trackasmlib.lua index 5879f59..1111f6f 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -2554,7 +2554,7 @@ function DeleteExternalDatabase(sTable,sMethod,sPrefix) local fName = GetOpVar("DIRPATH_BAS") if(not GetOpVar("DIRPATH_"..sMethod)) then return StatusLog(false,"DeleteExternalDatabase: Directory index <"..sMethod.."> missing") end - fName = fName..GetOpVar("DIRPATH_"..sMethod) + fName = fName..GetOpVar("DIRPATH_"..sMethod) fName = fName..tostring(sPrefix or GetInstPref())..defTable.Name..".txt" if(not fileExists(fName,"DATA")) then return StatusLog(true,"DeleteExternalDatabase: File <"..fName.."> missing") end diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index 08ceb9a..e8559f5 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -674,7 +674,7 @@ function TOOL:Reload(stTrace) asmlib.StoreExternalDatabase("PIECES","\t","DSV") asmlib.StoreExternalDatabase("ADDITIONS","\t","DSV") asmlib.StoreExternalDatabase("PHYSPROPERTIES","\t","DSV") - end + end return asmlib.StatusLog(true,"TOOL:Reload(World): Success") elseif(trEnt and trEnt:IsValid()) then if(not asmlib.IsPhysTrace(stTrace)) then return false end @@ -1371,8 +1371,7 @@ function TOOL:Think() if(self:GetGhostHolder() ~= 0 and utilIsValidModel(model)) then if (not self.GhostEntity or not self.GhostEntity:IsValid() or - self.GhostEntity:GetModel() ~= model - ) then -- If none ... + self.GhostEntity:GetModel() ~= model) then -- If none ... self:MakeGhostEntity(model) end self:UpdateGhost(self.GhostEntity, self:GetOwner()) diff --git a/workshop_publish.bat b/workshop_publish.bat index 218add2..9ab3e13 100644 --- a/workshop_publish.bat +++ b/workshop_publish.bat @@ -1,38 +1,38 @@ -:: Hard reset the HEAD: git push origin +:master -:: 6af74344a888bdf9fbb35d887c3f77691820a50e -:: git push origin +6af74344a888bdf9fbb35d887c3f77691820a50e:master -:: cd /e -:: cd Documents/Lua-Projs/SVN/TrackAssemblyTool_GIT_master - -@echo off - -set RevPath=%~dp0 -set BinPath=F:\Games\Steam\steamapps\common\GarrysMod\bin -set Name=TrackAssembly -set ID=287012681 -set Dirs=(lua) - -title Addon %Name% updater/publisher - -echo Press Crtl+C to terminate ! -echo Press a key if you do not want to wait ! -echo Rinning in %RevPath%. -echo Npp Find --\h{1,}\r\n-- replace --\r\n-- in dos format before commit ! -echo. - -timeout 3 -rd /S /Q %RevPath%Workshop -md %RevPath%Workshop\%Name% -for %%i in %Dirs% do ( - echo Extracting %%i - timeout 3 - xcopy %RevPath%%%i %RevPath%Workshop\%Name%\%%i /EXCLUDE:%RevPath%data\workshop\key.txt /E /C /I /F /R /Y -) -copy %RevPath%data\workshop\addon.json %RevPath%Workshop\%Name%\addon.json -call %BinPath%\gmad.exe create -folder "%RevPath%Workshop\%Name%" -out "%RevPath%Workshop\%Name%.gma" -call %BinPath%\gmpublish.exe update -addon "%RevPath%Workshop\%Name%.gma" -id "%ID%" -icon "%RevPath%data\pictures\icon.jpg" -changes "Generated by Batch!" -echo. -call echo !!! %%Dir[%x%]%% Published !!! -echo. -timeout 500 -exit +:: Hard reset the HEAD: git push origin +:master +:: 6af74344a888bdf9fbb35d887c3f77691820a50e +:: git push origin +6af74344a888bdf9fbb35d887c3f77691820a50e:master +:: cd /e +:: cd Documents/Lua-Projs/SVN/TrackAssemblyTool_GIT_master + +@echo off + +set RevPath=%~dp0 +set BinPath=F:\Games\Steam\steamapps\common\GarrysMod\bin +set Name=TrackAssembly +set ID=287012681 +set Dirs=(lua) + +title Addon %Name% updater/publisher + +echo Press Crtl+C to terminate ! +echo Press a key if you do not want to wait ! +echo Rinning in %RevPath%. +echo Npp Find --\h{1,}\n-- replace --\n-- in dos format before commit ! +echo. + +timeout 3 +rd /S /Q %RevPath%Workshop +md %RevPath%Workshop\%Name% +for %%i in %Dirs% do ( + echo Extracting %%i + timeout 3 + xcopy %RevPath%%%i %RevPath%Workshop\%Name%\%%i /EXCLUDE:%RevPath%data\workshop\key.txt /E /C /I /F /R /Y +) +copy %RevPath%data\workshop\addon.json %RevPath%Workshop\%Name%\addon.json +call %BinPath%\gmad.exe create -folder "%RevPath%Workshop\%Name%" -out "%RevPath%Workshop\%Name%.gma" +call %BinPath%\gmpublish.exe update -addon "%RevPath%Workshop\%Name%.gma" -id "%ID%" -icon "%RevPath%data\pictures\icon.jpg" -changes "Generated by Batch!" +echo. +call echo !!! %%Dir[%x%]%% Published !!! +echo. +timeout 500 +exit