Part 5 - switchable panels.
CUI & PSS Tutorial Part 5
This tutorial would take too many screenshots so I decided it would be simpler to speed things up here. When you get to the step in image #6 use this code. Once you finish with the following steps (image examples) return here to see how to change the numbers.
// Light backbround so we can see the menu text
$drawrect(0,0,%_width%,21,175-175-175,,)
// Panel names
$set_ps_global(P0,Green)
$set_ps_global(P1,Red)
// Variables for size and colors here
$set_ps_global(BTW,$sub(%LM%,10))
$set_ps_global(BTH,40)
$set_ps_global(PY,130)
$set_ps_global(PH,$sub(%_height%,%PY%,%BM%))
$set_ps_global(PW1,$sub(%_width%,%LM%))
$set_ps_global(PW2,$sub(%PW1%,%RM%))
$set_ps_global(BM,500)
$set_ps_global(LM,155)
$set_ps_global(RM,455)
$set_ps_global(TXTC,250-250-250)
$set_ps_global(TXTC_h,0-0-0)
$set_ps_global(TXTC_s,255-200-50)
$set_ps_global(BC,30-30-30-175)
$set_ps_global(BC_h,125-125-125-200)
$set_ps_global(BC_s,0-130-250-150)
// Button configuration here
$textbutton(5,%PY%,%BTW%,%BTH%,%P0%,%P0%,
SETGLOBAL:PANEL:0;REFRESH,fontcolor:$ifequal(%PANEL%,0,%TXTC_s%,%TXTC%) brushcolor:$ifequal(%PANEL%,0,%BC_s%,%BC%),fontcolor:%TXTC_h% brushcolor:%BC_h%),
$textbutton(5,$add(%BTH%,%PY%,2),%BTW%,%BTH%,%P1%,%P1%,
SETGLOBAL:PANEL:1;REFRESH,fontcolor:$ifequal(%PANEL%,1,%TXTC_s%,%TXTC%) brushcolor:$ifequal(%PANEL%,1,%BC_s%,%BC%),fontcolor:%TXTC_h% brushcolor:%BC_h%)
// PSS switching
$showpanel(0,$ifequal(%PANEL%,0,1,0))
$showpanel(1,$ifequal(%PANEL%,1,1,0))
$movepanel(%panel%,$sub(%_width%,%PW1%),%PY%,%PW2%,%PH%)
Thanks goes to marc2003 for explaining these steps in the PSS thread.