Skip to content

Commit

Permalink
Merge pull request #532 from vercas/master
Browse files Browse the repository at this point in the history
Fixed text changing in text entry, fixed bug with ToyTown
  • Loading branch information
UnderscoreKilburn committed Feb 4, 2014
2 parents 22f559f + 340b62f commit d108c16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion garrysmod/lua/postprocess/toytown.lua
Expand Up @@ -20,7 +20,7 @@ function DrawToyTown( NumPasses, H )
render.UpdateScreenEffectTexture()
surface.DrawTexturedRect( 0, 0, ScrW(), H )
surface.DrawTexturedRectRotated( ScrW() * 0.5, ScrH() - H * 0.5 + 1, ScrW(), H, 180 )
surface.DrawTexturedRectUV(0, ScrH() - H, ScrW(), H, 0, 1, 1, 0)
end
Expand Down
8 changes: 6 additions & 2 deletions garrysmod/lua/vgui/dtextentry.lua
Expand Up @@ -149,6 +149,8 @@ function PANEL:UpdateFromHistory()
self:SetText( text )
self:SetCaretPos( text:len() )
self:OnTextChanged()
self.HistoryPos = pos
Expand Down Expand Up @@ -176,6 +178,8 @@ function PANEL:UpdateFromMenu()
self:SetText( txt )
self:SetCaretPos( txt:len() )
self:OnTextChanged(true)
self.HistoryPos = pos
Expand All @@ -184,7 +188,7 @@ end
--[[---------------------------------------------------------
OnTextChanged
-----------------------------------------------------------]]
function PANEL:OnTextChanged()
function PANEL:OnTextChanged(noMenuRemoval)
self.HistoryPos = 0
Expand All @@ -193,7 +197,7 @@ function PANEL:OnTextChanged()
self:OnValueChange( self:GetText() )
end
if ( IsValid( self.Menu ) ) then
if ( IsValid( self.Menu ) and not noMenuRemoval ) then
self.Menu:Remove()
end
Expand Down

0 comments on commit d108c16

Please sign in to comment.