diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 92e94b29..c1e2eea8 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.738") +asmlib.SetOpVar("TOOL_VERSION","8.739") 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 28c65f74..38044db7 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -1885,6 +1885,18 @@ function SetButtonSlider(cPanel, sVar, nMin, nMax, nDec, tBtn) sTip = tostring(vBtn.T):Trim() end end + if(sTxt:sub(1,1) = syRev and tonumber(sTxt:sub(2,-1))) then + local nAmt = tonumber(sTxt:sub(2,-1)) + if(not vBtn.L) then + vBtn.L=function(pB, pS, nS) + pS:SetValue(GetSign((nS < 0) and nS or (nS+1))*nAmt) end + end + if(not vBtn.R) then + vBtn.R=function(pB, pS, nS) + pS:SetValue(-GetSign((nS < 0) and nS or (nS+1))*nAmt) end + end + sTip = languageGetPhrase("tool."..sTool..".buttonas"..syRev).." "..nAmt + end pPanel:SetButton(sTxt, sTip) pPanel:SetAction(vBtn.L, vBtn.R) end diff --git a/lua/vgui/dasminsliderbutton.lua b/lua/vgui/dasminsliderbutton.lua index 2b7f98a2..23c7a852 100644 --- a/lua/vgui/dasminsliderbutton.lua +++ b/lua/vgui/dasminsliderbutton.lua @@ -167,9 +167,15 @@ function PANEL:SetAction(fLef, fRgh, vIdx) local iIdx = self:GetButtonID(vIdx) if(iIdx == 0) then return self end local pBut, pSer = self.Array[iIdx], self.Slider - pBut.DoClick = function() - local pS, sE = pcall(fLef, pBut, pSer, pSer:GetValue()) - if(not pS) then error("["..pBut:GetText().."]: "..sE) end + if(fLef) then + pBut.DoClick = function() + local pS, sE = pcall(fLef, pBut, pSer, pSer:GetValue()) + if(not pS) then error("["..pBut:GetText().."]: "..sE) end + end + else + if(not pBut.DoClick) then + pBut.DoClick = function() SetClipboardText(pBut:GetText()) end + end end if(fRgh) then pBut.DoRightClick = function() @@ -177,7 +183,9 @@ function PANEL:SetAction(fLef, fRgh, vIdx) if(not pS) then error("["..pBut:GetText().."]: "..sE) end end else - pBut.DoRightClick = function() SetClipboardText(pBut:GetText()) end + if(not pBut.DoRightClick) then + pBut.DoRightClick = function() SetClipboardText(pBut:GetText()) end + end end; return self end diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index d993dd71..ae087b87 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -2466,20 +2466,22 @@ function TOOL.BuildCPanel(CPanel) L=function(pB, pS, nS) pS:SetValue(asmlib.GetSnap(nS,-asmlib.GetAsmConvar("incsnpang","FLT"))) end, R=function(pB, pS, nS) pS:SetValue(asmlib.GetSnap(nS, asmlib.GetAsmConvar("incsnpang","FLT"))) end}, {N="+/-" , T = "#", L=function(pB, pS, nS) pS:SetValue(-nS) end}, - {N="@M" , T = "#", L=function(pB, pS, nS) SetClipboardText(nS) end}, - {N="@D" , T = "#", L=function(pB, pS, nS) pS:SetValue(pS:GetDefaultValue()) end}, - {N="@45" , T = "#", L=function(pB, pS, nS) pS:SetValue(asmlib.GetSign((nS < 0) and nS or (nS+1))* 45) end}, - {N="@90" , T = "#", L=function(pB, pS, nS) pS:SetValue(asmlib.GetSign((nS < 0) and nS or (nS+1))* 90) end}, - {N="@135", T = "#", L=function(pB, pS, nS) pS:SetValue(asmlib.GetSign((nS < 0) and nS or (nS+1))*135) end}, - {N="@180", T = "#", L=function(pB, pS, nS) pS:SetValue(asmlib.GetSign((nS < 0) and nS or (nS+1))*180) end} - } + {N="@M" , T = "#", L=function(pB, pS, nS) SetClipboardText(nS) end, + R=function(pB, pS, nS) pS:SetValue(GetClipboardText(nS) end}, + {N="@D" , T = "#", L=function(pB, pS, nS) pS:SetValue(pS:GetDefaultValue()) end + R=function(pB, pS, nS) SetClipboardText(pS:GetDefaultValue()) end}, + {N="@45" , T = "#"}, {N="@90" , T = "#"}, {N="@135", T = "#"}, {N="@180", T = "#"} + } -- Use the same initialization table for multiple BIS local tBpos = { -- Button interactive slider ( position offsets ) - {N="<>" , T = "#", -- Left click to decrease, right to increase + {N="<>" , T = "#", -- Left click to decrease, right to increase L=function(pB, pS, nS) pS:SetValue(asmlib.GetSnap(nS,-asmlib.GetAsmConvar("incsnplin","FLT"))) end, R=function(pB, pS, nS) pS:SetValue(asmlib.GetSnap(nS, asmlib.GetAsmConvar("incsnplin","FLT"))) end}, - {N="+/-", T = "#", L=function(pB, pS, nS) pS:SetValue(-nS) end}, - {N="@M" , T = "#", L=function(pB, pS, nS) SetClipboardText(nS) end}, - {N="@D" , T = "#", L=function(pB, pS, nS) pS:SetValue(pS:GetDefaultValue()) end} + {N="+/-" , T = "#", L=function(pB, pS, nS) pS:SetValue(-nS) end}, + {N="@M" , T = "#", L=function(pB, pS, nS) SetClipboardText(nS) end, + R=function(pB, pS, nS) pS:SetValue(GetClipboardText(nS) end}, + {N="@D" , T = "#", L=function(pB, pS, nS) pS:SetValue(pS:GetDefaultValue()) end + R=function(pB, pS, nS) SetClipboardText(pS:GetDefaultValue()) end}, + {N="@25" , T = "#"}, {N="@50" , T = "#"}, {N="@75", T = "#"}, {N="@100", T = "#"} } -- Use the same initialization table for multiple BIS asmlib.SetButtonSlider(CPanel, "nextpic", -gnMaxRot, gnMaxRot, iMaxDec, tBAng) asmlib.SetButtonSlider(CPanel, "nextyaw", -gnMaxRot, gnMaxRot, iMaxDec, tBAng) diff --git a/resource/localization/bg/trackassembly.properties b/resource/localization/bg/trackassembly.properties index cc2f9466..34cb188f 100644 --- a/resource/localization/bg/trackassembly.properties +++ b/resource/localization/bg/trackassembly.properties @@ -257,10 +257,7 @@ tool.trackassembly.buttonas<>=Намали/Увеличи tool.trackassembly.buttonas+/-=Обърни знака tool.trackassembly.buttonas@M=Запомни стойност tool.trackassembly.buttonas@D=Дефолтна стойност -tool.trackassembly.buttonas@45=Обнови 45 -tool.trackassembly.buttonas@90=Обнови 90 -tool.trackassembly.buttonas@135=Обнови 135 -tool.trackassembly.buttonas@180=Обнови 180 +tool.trackassembly.buttonas@=Обнови стойност\: sbox_maxasmtracks=Променете тук за да настроите нещата които са създадени от инструмента на сървъра sbox_maxasmtracks_con=Общо сегменти\: Cleanup_asmtracks=Сглобени парчета трасе diff --git a/resource/localization/en/trackassembly.properties b/resource/localization/en/trackassembly.properties index 28d977d5..7d46bd12 100644 --- a/resource/localization/en/trackassembly.properties +++ b/resource/localization/en/trackassembly.properties @@ -257,10 +257,7 @@ tool.trackassembly.buttonas<>=Decrement/Increment tool.trackassembly.buttonas+/-=Negate value tool.trackassembly.buttonas@M=Memorize value tool.trackassembly.buttonas@D=Default value -tool.trackassembly.buttonas@45=Update 45 -tool.trackassembly.buttonas@90=Update 90 -tool.trackassembly.buttonas@135=Update 135 -tool.trackassembly.buttonas@180=Update 180 +tool.trackassembly.buttonas@=Apply value\: sbox_maxasmtracks=Change this to adjust the things spawned via track assembly tool on the server sbox_maxasmtracks_con=Total segments\: Cleanup_asmtracks=Assembled track pieces diff --git a/resource/localization/ru/trackassembly.properties b/resource/localization/ru/trackassembly.properties index d6e9d8d8..4a5e1739 100644 --- a/resource/localization/ru/trackassembly.properties +++ b/resource/localization/ru/trackassembly.properties @@ -119,10 +119,7 @@ tool.trackassembly.buttonas<>=Уменьшить/Увеличить tool.trackassembly.buttonas+/-=Начение по умолчаниюз tool.trackassembly.buttonas@M=Запомнить стоимость tool.trackassembly.buttonas@D=Значение по умолчанию -tool.trackassembly.buttonas@45=Обновить 45 -tool.trackassembly.buttonas@90=Обновить 90 -tool.trackassembly.buttonas@135=Обновить 135 -tool.trackassembly.buttonas@180=Обновить 180 +tool.trackassembly.buttonas@=Обновить стоимость\: Cleanup_asmtracks=Собранные куски дороги Cleaned_asmtracks=Все куски дороги очищены SBoxLimit_asmtracks=Вы достигли предела созданных кусков дороги!