Skip to content

Commit

Permalink
print -> MsgN
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed Jan 24, 2024
1 parent 760c9ec commit a6d467e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lua/autorun/client/vgui-tools.yue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:find, :format = string
:Add = concommand
print = print
MsgN = MsgN

PANEL = FindMetaTable( "Panel" )
:Remove, :GetName, :__tostring = PANEL
Expand Down Expand Up @@ -44,7 +44,7 @@ do
name = GetName( panel )
for pattern in *patterns
if find( name, pattern, 1, false ) ~= nil
print( "[" .. cmd .. "] " .. __tostring( panel ) .. " has been removed." )
MsgN( "[" .. cmd .. "] " .. __tostring( panel ) .. " has been removed." )
Remove( panel )
break

Expand Down Expand Up @@ -75,8 +75,8 @@ do
children = @GetChildren!
count = #children

print( space .. "║" )
print( space .. ( isLast and "╚" or "╠" ) .. "══ " .. __tostring( @ ) )
MsgN( space .. "║" )
MsgN( space .. ( isLast and "╚" or "╠" ) .. "══ " .. __tostring( @ ) )

if count == 0
return
Expand All @@ -99,7 +99,7 @@ Add "vgui_list", ( _, cmd, args ) ->
else
endPos = startPos

print( "[" .. cmd .. "] Panels: " )
MsgN( "[" .. cmd .. "] Panels: " )
counter = 0

for panel in *getPanels( true )
Expand All @@ -112,7 +112,7 @@ Add "vgui_list", ( _, cmd, args ) ->
if counter > endPos
break

print( counter .. ". " .. __tostring( panel ) )
MsgN( __tostring( panel ) )

unless hasArgs
continue
Expand All @@ -125,7 +125,7 @@ Add "vgui_list", ( _, cmd, args ) ->
for i = 1, count
printTree( children[ i ], 1, i == count )

print!
MsgN!

Add "vgui_find", ( _, cmd, args ) ->
founded, length = {}, 0
Expand All @@ -138,8 +138,9 @@ Add "vgui_find", ( _, cmd, args ) ->
founded[ length ] = __tostring( panel )

if length == 0
print( "[" .. cmd .. "] Panels not found." )
MsgN( "[" .. cmd .. "] Panels not found." )
return

MsgN( "[" .. cmd .. "] Found " .. length .. " panels: " )
for index = 1, length
print( index .. ". ", founded[ index ] )
MsgN( founded[ index ] )

0 comments on commit a6d467e

Please sign in to comment.