
;----------------------------- ALIAS DLL ------------------------------;
alias mdx { var %dll addons\dll\mdx\mdx.dll } | return $dll(%dll,$1,$2-) 
alias dialogx { return addons\dll\mdx\dialog.mdx }
alias mdxbegin { mdx SetMircVersion $version | mdx MarkDialog $dname }
;----------------------------------------------------------------------;

alias gradi { dialog -m gradi gradi }

dialog gradi {
  title "Ringraziamento Gradi    4 Angel Red Script"
  size -1 -1 195 185
  option dbu
  check "owner",1, 5 8 30 10
  edit "",2, 40 8 150 10,autohs
  check "deowner",3, 5 23 30 10
  edit "",4, 40 23 150 10,autohs
  check "protect",5, 5 38 30 10
  edit "",6, 40 38 150 10,autohs
  check "deprotect",7, 5 53 34 10
  edit "",8, 40 53 150 10,autohs
  check "op",9, 5 68 30 10
  edit "",10, 40 68 150 10,autohs
  check "deop",11, 5 83 30 10
  edit "",12, 40 83 150 10,autohs
  check "halfop",13, 5 98 30 10
  edit "",14, 40 98 150 10,autohs
  check "dehalfop",15, 5 113 30 10
  edit "",16, 40 113 150 10,autohs
  check "voice",17, 5 128 30 10
  edit "",18, 40 128 150 10,autohs
  check "devoice",19, 5 143 30 10
  edit "",20, 40 143 150 10,autohs
  button "OK",21,5 162 50 15,ok
  button "Annulla",22,140 162 50 15,cancel


}

on *:dialog:gradi:init:0: {
  ;mdx  
  mdxbegin

  mdx SetFont $dname 1,3,5,7,9,11,13,15,17,19,21,22 14 autohs 
  mdx SetColor $dname 2,4,6,8,10,12,14,16,18,20 
  mdx SetColor $dname 2,4,6,8,10,12,14,16,18,20 
  mdx SetColor $dname 2,4,6,8,10,12,14,16,18,20 
  mdx SetFont $dname 21,22 16 autohs
  mdx SetFont $dname 2,4,6,8,10,12,14,16,18,20 12  autohs 
  ;dialog
  if (%r.owner = on) { did -c gradi 1 }
  if (%r.owner = off) { did -u gradi 1 }
  if (%r.deowner = on) { did -c gradi 3 }
  if (%r.deowner = off) { did -u gradi 3 }
  if (%r.protect = on) { did -c gradi 5 }
  if (%r.protect = off) { did -u gradi 5 }
  if (%r.deprotect = on) { did -c gradi 7 }
  if (%r.deprotect = off) { did -u gradi 7 }
  if (%r.op = on) { did -c gradi 9 }
  if (%r.op = off) { did -u gradi 9 }
  if (%r.deop = on) { did -c gradi 11 }
  if (%r.deop = off) { did -u gradi 11 }
  if (%r.halfop = on) { did -c gradi 13 }
  if (%r.halfop = off) { did -u gradi 13 }
  if (%r.dehalfop = on) { did -c gradi 15 }
  if (%r.dehalfop = off) { did -u gradi 15 }
  if (%r.voice = on) { did -c gradi 17 }
  if (%r.voice = off) { did -u gradi 17 }
  if (%r.devoice = on) { did -c gradi 19 }
  if (%r.devoice = off) { did -u gradi 19 }
  { did -a gradi 2 %r.owner.mess }
  { did -a gradi 4 %r.deowner.mess }
  { did -a gradi 6 %r.protect.mess }
  { did -a gradi 8 %r.deprotect.mess }
  { did -a gradi 10 %r.op.mess }
  { did -a gradi 12 %r.deop.mess }
  { did -a gradi 14 %r.halfop.mess }
  { did -a gradi 16 %r.dehalfop.mess }
  { did -a gradi 18 %r.voice.mess }
  { did -a gradi 20 %r.devoice.mess }

}

on *:dialog:gradi:sclick:1: {
  if ($did(1).state = 1) { set %r.owner on }
  else { set %r.owner off }
}
on *:dialog:gradi:sclick:3: {
  if ($did(3).state = 1) { set %r.deowner on }
  else { set %r.deowner off }
}
on *:dialog:gradi:sclick:5: {
  if ($did(5).state = 1) { set %r.protect on }
  else { set %r.protect off }
}
on *:dialog:gradi:sclick:7: {
  if ($did(7).state = 1) { set %r.deprotect on }
  else { set %r.deprotect off }
}
on *:dialog:gradi:sclick:9: {
  if ($did(9).state = 1) { set %r.op on }
  else { set %r.op off }
}
on *:dialog:gradi:sclick:11: {
  if ($did(11).state = 1) { set %r.deop on }
  else { set %r.deop off }
}
on *:dialog:gradi:sclick:13: {
  if ($did(13).state = 1) { set %r.halfop on }
  else { set %r.halfop off }
}
on *:dialog:gradi:sclick:15: {
  if ($did(15).state = 1) { set %r.dehalfop on }
  else { set %r.dehalfop off }
}
on *:dialog:gradi:sclick:17: {
  if ($did(17).state = 1) { set %r.voice on }
  else { set %r.voice off }
}
on *:dialog:gradi:sclick:19: {
  if ($did(19).state = 1) { set %r.devoice on }
  else { set %r.devoice off }
}

on *:dialog:gradi:edit:2: { set %r.owner.mess $did(gradi,2) }
on *:dialog:gradi:edit:4: { set %r.deowner.mess $did(gradi,4) }
on *:dialog:gradi:edit:6: { set %r.protect.mess $did(gradi,6) }
on *:dialog:gradi:edit:8: { set %r.deprotect.mess $did(gradi,8) }
on *:dialog:gradi:edit:10: { set %r.op.mess $did(gradi,10) }
on *:dialog:gradi:edit:12: { set %r.deop.mess $did(gradi,12) }
on *:dialog:gradi:edit:14: { set %r.halfop.mess $did(gradi,14) }
on *:dialog:gradi:edit:16: { set %r.dehalfop.mess $did(gradi,16) }
on *:dialog:gradi:edit:18: { set %r.voice.mess $did(gradi,18) }
on *:dialog:gradi:edit:20: { set %r.devoice.mess $did(gradi,20) }

;------> EVENTI <------;

ON *:RAWMODE:#: {
  if (%r.owner = on) && (+q isincs $1-) && ($me isin $1-) { /msg $chan 9   $+ $nick %r.owner.mess  4 Angel Red Script  }
  if (%r.protect = on) && (+a isincs $1-) && ($me isin $1-) { /msg $chan 9   $+ $nick %r.protect.mess  4 Angel Red Script  }
  if (%r.op = on) && (+o isincs $1-) && ($me isin $1-) { /msg $chan 9   $+ $nick %r.op.mess  4 Angel Red Script  }
  if (%r.halfop = on) && (+h isincs $1-) && ($me isin $1-) { /msg $chan 9   $+ $nick %r.halfop.mess  4 Angel Red Script  }
  if (%r.voice = on) && (+v isincs $1-) && ($me isin $1-) { /msg $chan 9   $+ $nick %r.voice.mess 4 Angel Red Script  }
}
