View Single Post
  #4  
Old 08-09-2011, 12:52 AM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Thumbs up

Ah I see, will try this later on when I get the GUI to be more flexible Sorry for asking so many dumb questions, but I'm kind of stuck both on the DB NPC and on the GUI part!

Why doesn't this work:

PHP Code:
  this.listofitems = {{"Fireball""split_fireball""split_fireball.png""split_fireball_selected.png"30}, 
                      {
"Sword""split_sword""split_sword.png""split_sword_selected.png"20},
                      {
"Bow""split_bow""split_bow.png""split_bow_selected.png"10}
                     }; 
  new 
GuiShowImgCtrl(this.listofitems[0][0]) 
  {
    
20;
    
20;
    
width 32;
    
height 32;
    
    
this.imageselected this.listofitems[0][3];
    
this.imagenotselected this.listofitems[0][2];
    
this.image this.imageselected;
    
thiso.catchevent(this.name"onMouseDown""onItemSelected");
  }
  
Shop_Window.addControl(this.listofitems[0][0]);
  
Shop_Window.show(); 
when this works just fine:

PHP Code:
  this.listofitems = {{"Fireball""split_fireball""split_fireball.png""split_fireball_selected.png"30}, 
                      {
"Sword""split_sword""split_sword.png""split_sword_selected.png"20},
                      {
"Bow""split_bow""split_bow.png""split_bow_selected.png"10}
                     };

  new 
GuiShowImgCtrl(this.listofitems[0][0]) 
  {
    
20;
    
20;
    
width 32;
    
height 32;
    
    
this.imageselected "split_fireball_selected.png";
    
this.imagenotselected "split_fireball.png";
    
this.image this.imageselected;
    
thiso.catchevent(this.name"onMouseDown""onItemSelected");
  }
  
Shop_Window.addControl(this.listofitems[0][0]);
  
Shop_Window.show(); 
The only difference is that in the first code sample, I read the string from the array listofitems and in the second code sample I write the string directly.

Hmm...

Thank you
Reply With Quote