RaZgRiZ

swlmappick WIP

Feb 27th, 2013
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.64 KB | None | 0 0
  1. // Functions that serves as a conditional button that responds to a specific case, changing color, action, and even
  2. // icon, usage: /guicondbutton (case) "text 1" "text 0" "default text" [action 1] [action 0] (icon 1) (icon 0)
  3. // You may use 1 for either action 0 or icon 0 if you do not want to provide a different command set.
  4. guicondbutton = [
  5.     guibutton (concatword (? $arg1 $arg2 $arg3) $arg4) (
  6.         ? $arg1 $arg5 (? (= $arg6 1) $arg5 $arg6)
  7.     ) (? $arg1 $arg7 (? (= $arg8 1) $arg7 $arg8))
  8. ]
  9.  
  10. _swl_vetomaps = ["neondevastation douze neondevastation" "complex arbana mbt12" "capture_night secondevermap authentic" "firstevermap twinforts eternal_valley"]
  11. _swl_pickmaps = []
  12. _swl_teams    = [good evil spam haxx]
  13. _swl_cur      = 1
  14.  
  15. newgui "swlmappick" [
  16.     guistayopen [
  17.         guilist [
  18.             loop l (listlen $_swl_teams) [
  19.                 guispring
  20.                 guilist [
  21.                     guistrut 4 1
  22.                     guititle (format "^f7%2%1" (at $_swl_teams $l) (? (= $l $_swl_cur) "^f2"))
  23.                 ]
  24.                 guispring
  25.                 if (< $l (- (listlen $_swl_teams) 1)) guibar
  26.             ]
  27.         ]
  28.         guibar
  29.         guistrut 0.5
  30.         looplist i $_swl_vetomaps [
  31.             guilist [
  32.                 guistrut 0.5
  33.                 loop p (listlen $i) [
  34.                     guilist [
  35.                         guistrut 12.8 1 // minimum for monospace font
  36.                         push p (at $i $p) [
  37.                             guicondbutton (> (indexof $_swl_pickmaps $p) -1) "^f4" "" $p [] [
  38.                                 //SWL_SENDINFO "vetomap" @p
  39.                                 append _swl_pickmaps @p // placeholder until the above is implemented
  40.                             ] 0 0
  41.                         ]
  42.                     ]
  43.                     if (< $p 2) guibar [ guistrut 0.5 ]
  44.                 ]
  45.             ]
  46.         ]
  47.     ]
  48. ] 0 // another arg after here will specify stuff to execute whenever the GUI is opened (does not work when reopened while already open)
Advertisement
Add Comment
Please, Sign In to add comment