Skip to content

Commit

Permalink
Added: Shortcut for closing the frequent pieces panel
Browse files Browse the repository at this point in the history
Added: More meaningful range for the piece connect sound
  • Loading branch information
dvdvideo1234 committed Apr 16, 2018
1 parent a3a000f commit b7c8e73
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
11 changes: 5 additions & 6 deletions lua/autorun/gearassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local asmlib = gearasmlib

------ CONFIGURE ASMLIB ------
asmlib.InitBase("gear","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.213")
asmlib.SetOpVar("TOOL_VERSION","5.214")
asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
Expand Down Expand Up @@ -278,12 +278,11 @@ if(CLIENT) then
while(iNdex <= iSize) do -- All panels are valid
asmlib.LogInstance("OPEN_FRAME: Frame.OnClose: Delete #"..iNdex)
pnElements:Select(iNdex).Panel:Remove()
pnElements:Delete(iNdex)
iNdex = iNdex + 1
end
pnFrame:Remove(); collectgarbage()
pnElements:Delete(iNdex); iNdex = iNdex + 1
end; pnFrame:Remove()
asmlib.SetOpVar("PANEL_FREQUENT_MODELS",nil); collectgarbage()
asmlib.LogInstance("OPEN_FRAME: Frame.OnClose: Form removed")
end
end; asmlib.SetOpVar("PANEL_FREQUENT_MODELS",pnFrame)
------------ Button --------------
xyPos.x = xyZero.x + xyDelta.x
xyPos.y = xyZero.y + xyDelta.y
Expand Down
2 changes: 1 addition & 1 deletion lua/gearassembly/gearasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ end
function UndoFinishPly(pPly,anyMessage)
if(not IsPlayer(pPly)) then
return StatusLog(false,"UndoFinishPly: Player <"..tostring(pPly)"> invalid") end
pPly:EmitSound("physics/metal/metal_canister_impact_hard"..mathFloor(mathRandom(3))..".wav")
pPly:EmitSound("physics/metal/metal_canister_impact_hard"..mathRandom(1, 3)..".wav")
undoSetCustomUndoText(GetOpVar("LABEL_UNDO")..tostring(anyMessage or ""))
undoSetPlayer(pPly)
undoFinish()
Expand Down
13 changes: 7 additions & 6 deletions lua/weapons/gmod_tool/stools/gearassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -627,17 +627,18 @@ end

function TOOL:Think()
local model = self:GetModel()
if(utilIsValidModel(model)) then
if(utilIsValidModel(model)) then -- Check model validation
local ply = self:GetOwner()
local gho = self.GhostEntity
if(self:GetGhostHolder()) then
if (not (gho and gho:IsValid() and gho:GetModel() == model)) then
self:MakeGhostEntity(model,VEC_ZERO,ANG_ZERO)
end; self:UpdateGhost(gho, ply)
else
self:ReleaseGhostEntity()
if(gho and gho:IsValid()) then gho:Remove() end
end
end; self:UpdateGhost(self.GhostEntity, ply) -- In client single player the ghost is skipped
else self:ReleaseGhostEntity() end -- Delete the ghost entity when ghosting is disabled
if(CLIENT and inputIsKeyDown(KEY_LALT) and inputIsKeyDown(KEY_E)) then
local pnFrame = asmlib.GetOpVar("PANEL_FREQUENT_MODELS")
if(pnFrame and IsValid(pnFrame)) then pnFrame.OnClose() end -- That was a /close call/ :D
end -- Shortcut for closing the routine pieces
end
end

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

0 comments on commit b7c8e73

Please sign in to comment.