Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Easy way to check radio buttons... (https://forums.graalonline.com/forums/showthread.php?t=134267442)

Vatec 11-22-2012 10:48 AM

Easy way to check radio buttons...
 
Well it appears that because each radio button is it's own little box of code I can't find a way to check which button is selected without a lot of "if" statements, is there a better way to do this?

xXziroXx 11-22-2012 12:09 PM

For example...

PHP Code:

new GuiRadioCtrl("Test_Radio1") {
  
profile GuiBlueRadioProfile;
  
10;
  
10;
  
width 100;
  
height 20;
  
groupnum 1;
  
text "Radio button 1";
  
  
thiso.catchevent(this"onAction""onRadioButtonChanged");  // Take note of this line


Then you can use the following to determine if it has been clicked or not:

PHP Code:

function onRadioButtonChanged(temp.object)
  
player.chat "Radio button '" temp.object.name "' clicked!"



All times are GMT +2. The time now is 06:46 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.