Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed text changing in text entry #532

Merged
merged 2 commits into from
Feb 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion garrysmod/lua/postprocess/toytown.lua
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ function PANEL:UpdateFromHistory()

self:SetText( text )
self:SetCaretPos( text:len() )

self:OnTextChanged()

self.HistoryPos = pos

Expand Down Expand Up @@ -175,6 +177,8 @@ function PANEL:UpdateFromMenu()

self:SetText( txt )
self:SetCaretPos( txt:len() )

self:OnTextChanged(true)

self.HistoryPos = pos

Expand All @@ -183,7 +187,7 @@ end
--[[---------------------------------------------------------
OnTextChanged
-----------------------------------------------------------]]
function PANEL:OnTextChanged()
function PANEL:OnTextChanged(noMenuRemoval)

self.HistoryPos = 0

Expand All @@ -192,7 +196,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