Skip to content

Commit b7c8e73

Browse files
committed
Added: Shortcut for closing the frequent pieces panel
Added: More meaningful range for the piece connect sound
1 parent a3a000f commit b7c8e73

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

lua/autorun/gearassembly_init.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ local asmlib = gearasmlib
2626

2727
------ CONFIGURE ASMLIB ------
2828
asmlib.InitBase("gear","assembly")
29-
asmlib.SetOpVar("TOOL_VERSION","5.213")
29+
asmlib.SetOpVar("TOOL_VERSION","5.214")
3030
asmlib.SetIndexes("V",1,2,3)
3131
asmlib.SetIndexes("A",1,2,3)
3232
asmlib.SetIndexes("S",4,5,6,7)
@@ -278,12 +278,11 @@ if(CLIENT) then
278278
while(iNdex <= iSize) do -- All panels are valid
279279
asmlib.LogInstance("OPEN_FRAME: Frame.OnClose: Delete #"..iNdex)
280280
pnElements:Select(iNdex).Panel:Remove()
281-
pnElements:Delete(iNdex)
282-
iNdex = iNdex + 1
283-
end
284-
pnFrame:Remove(); collectgarbage()
281+
pnElements:Delete(iNdex); iNdex = iNdex + 1
282+
end; pnFrame:Remove()
283+
asmlib.SetOpVar("PANEL_FREQUENT_MODELS",nil); collectgarbage()
285284
asmlib.LogInstance("OPEN_FRAME: Frame.OnClose: Form removed")
286-
end
285+
end; asmlib.SetOpVar("PANEL_FREQUENT_MODELS",pnFrame)
287286
------------ Button --------------
288287
xyPos.x = xyZero.x + xyDelta.x
289288
xyPos.y = xyZero.y + xyDelta.y

lua/gearassembly/gearasmlib.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ end
14891489
function UndoFinishPly(pPly,anyMessage)
14901490
if(not IsPlayer(pPly)) then
14911491
return StatusLog(false,"UndoFinishPly: Player <"..tostring(pPly)"> invalid") end
1492-
pPly:EmitSound("physics/metal/metal_canister_impact_hard"..mathFloor(mathRandom(3))..".wav")
1492+
pPly:EmitSound("physics/metal/metal_canister_impact_hard"..mathRandom(1, 3)..".wav")
14931493
undoSetCustomUndoText(GetOpVar("LABEL_UNDO")..tostring(anyMessage or ""))
14941494
undoSetPlayer(pPly)
14951495
undoFinish()

lua/weapons/gmod_tool/stools/gearassembly.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,17 +627,18 @@ end
627627

628628
function TOOL:Think()
629629
local model = self:GetModel()
630-
if(utilIsValidModel(model)) then
630+
if(utilIsValidModel(model)) then -- Check model validation
631631
local ply = self:GetOwner()
632632
local gho = self.GhostEntity
633633
if(self:GetGhostHolder()) then
634634
if (not (gho and gho:IsValid() and gho:GetModel() == model)) then
635635
self:MakeGhostEntity(model,VEC_ZERO,ANG_ZERO)
636-
end; self:UpdateGhost(gho, ply)
637-
else
638-
self:ReleaseGhostEntity()
639-
if(gho and gho:IsValid()) then gho:Remove() end
640-
end
636+
end; self:UpdateGhost(self.GhostEntity, ply) -- In client single player the ghost is skipped
637+
else self:ReleaseGhostEntity() end -- Delete the ghost entity when ghosting is disabled
638+
if(CLIENT and inputIsKeyDown(KEY_LALT) and inputIsKeyDown(KEY_E)) then
639+
local pnFrame = asmlib.GetOpVar("PANEL_FREQUENT_MODELS")
640+
if(pnFrame and IsValid(pnFrame)) then pnFrame.OnClose() end -- That was a /close call/ :D
641+
end -- Shortcut for closing the routine pieces
641642
end
642643
end
643644

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ after that extract it in `..\GarrysMod\garrysmod\addons` and you are practically
3737
* Advanced duplicator can be used on the gearbox created
3838
* Custom entity properties ( weld, freeze, no-collide )
3939
* User can disable phys-gun grabbing on a piece
40-
* Ability to list up the most used pieces on the server ( E + Right )
40+
* Ability to list up the most used pieces on the server ( E + MRIGHT ). Close shortcut (ALT + E)
4141
* Ability to search among the most server popular pieces by [Lua patterns](https://www.lua.org/pil/20.2.html)
4242
* Ability to export server and client database as a file
4343
* Tool-tips for every button are available and can be translated easily
@@ -92,7 +92,7 @@ and use the meshing function.
9292
#### How can I stack gears in one particular direction.
9393
Orient the first gear's forward to point in the desired direction. Freeze it.
9494
Adjust stack mode to `Forward direction`, set stack count to two or more
95-
You can also use the used manual offsets like in TA. Now mesh those things !<br><br>
95+
You can also use the manual offsets like in TA. Now mesh those things !<br><br>
9696
_*Beware, that some gears have different forward origin related to the mesh angle.
9797
The bevels for example have mesh angle of 45 degrees and if you stack 3 of them,
9898
this will result in a created differential with 2 planet gears and two suns gears*_

0 commit comments

Comments
 (0)