Popup styling using $style and tabs

By airliner on Sep 26, 2003

see title

;Popup styling using $style and tabs
;You can place a check mark or create a disabled menu item by using the $style(N) identifier, where N = 1 for checked, N = 2 for disabled, and N = 3 for both. The $style(N) identifier must be the first word in the menu definition.
;Using $chr(9) (tab) you can align text on the left or the right of the popup as you will see in the following example:
;$chr(58) = Quolon (:)
;This is a popup menu to control the channel modes, and see what modes are currently active
Channel $+(Modes,$chr(58),$chr(9),$chan(#).mode)
;The following will check if a certain mode is active, if so it will place a checkmark before it
.$iif(c isincs $gettok($chan(#).mode,1,32),$style(1)) No Colors:{ mode # $+($iif(c isincs $gettok($chan(#).mode,1,32),-,+),c) }
.$iif(i isincs $gettok($chan(#).mode,1,32),$style(1)) Invite Only:{ mode # $+($iif(i isincs $gettok($chan(#).mode,1,32),-,+),i) }
.$iif(M isincs $gettok($chan(#).mode,1,32),$style(1)) Only Registered nicks can speak:{ mode # $+($iif(M isincs $gettok($chan(#).mode,1,32),-,+),M) }
.$iif(m isincs $gettok($chan(#).mode,1,32),$style(1)) Moderated:{ mode # $+($iif(m isincs $gettok($chan(#).mode,1,32),-,+),m) }
.$iif(n isincs $gettok($chan(#).mode,1,32),$style(1)) No External Messages:{ mode # $+($iif(n isincs $gettok($chan(#).mode,1,32),-,+),n) }
.$iif(p isincs $gettok($chan(#).mode,1,32),$style(1)) Private:{ mode # $+($iif(p isincs $gettok($chan(#).mode,1,32),-,+),p) }
.$iif(R isincs $gettok($chan(#).mode,1,32),$style(1)) Registered Nicks Only:{ mode # $+($iif(R isincs $gettok($chan(#).mode,1,32),-,+),R) }
.$iif(s isincs $gettok($chan(#).mode,1,32),$style(1)) Secret:{ mode # $+($iif(s isincs $gettok($chan(#).mode,1,32),-,+),s) }
.$iif(t isincs $gettok($chan(#).mode,1,32),$style(1)) Only Ops Set Topic:{ mode # $+($iif(t isincs $gettok($chan(#).mode,1,32),-,+),t) }
;This will show the, if active, the userlimit with right aligned the maximum number of users
.$iif(l isincs $gettok($chan(#).mode,1,32),$style(1) User Limit $+ $chr(58) $chan(#).limit,User Limit):{ if (l isincs $gettok($chan(#).mode,1,32)) { mode # -l } | else { mode # +l $$?"Maximum number of users allowed in $chan $+ :" } }
;Last but not least, this allows you to see the current channel key, when selected allows you to change it.
.$iif(k isincs $gettok($chan(#).mode,1,32),$style(1) Key $+ $chr(58) $chan(#).key,Key):{ if (k isincs $gettok($chan(#).mode,1,32)) { mode # -k $chan(#).key } | else { mode # +k $$?"Enter key for $chan $+ :" } }

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.