Thread: Gui Problems
View Single Post
  #1  
Old 12-12-2009, 07:02 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Gui Problems

Im having issues getting data from a dbnpc and putting it in gui, again. Im not sure why, but in this situation, all the values in the array in the dbnpc are showing up in the main window text on the gui. It should be splitting it up. Worked for a while, until I added some stuff in.

PHP Code:
function onCreated()
{
  
this.db findnpc("NpcChat");
}
function 
onActionServerSide(){
  if (
params[0] == "getText"){
    
triggerClient("weapon"this.name"getText"this.db.info);
  }

}
//#CLIENTSIDE
function onActionClientSide(){
  if (
params[0] == "getText"){
    
temp.setup params[1];
    
NpcChat_Window1.setText(temp.setup[0]);
    
NpcChat_Text1.setText(temp.setup[1]);
    
//temp.list = "";
    //temp.data = {params[1][2], params[1][3], params[1][4], params[1][5]};
    //for (temp.line: temp.data) {
    //  temp.list @= temp.line @ "\n";
    //}
    
NPC_Chat_ItemList.addrow(temp.setup[2]);
    
NPC_Chat_ItemList.addrow(temp.setup[3]);
    
NPC_Chat_ItemList.addrow(temp.setup[4]);
    
NPC_Chat_ItemList.addrow(temp.setup[5]);
    
temp.img temp.setup[6];
    
NpcChat_Image1.image temp.img;
  }

}
public function 
OpenWindowdata ){
  if (
NpcChat_Text1 != NULLNpcChat_Window1.destroy();
  
triggerServer("weapon"this.name"getText");
  new 
GuiWindowCtrl("NpcChat_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "211,231";
    
useOwnProfile true
    
profile.bitmap "guiarm_window.png"
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Loading...";
    
309;
    
88;

    new 
GuiTextCtrl("NpcChat_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "";
      
width 42;
      
76;
    }
    new 
GuiScrollCtrl("NpcChat_MultiLine1_Scroll") {
      
profile GuiBlueScrollProfile;
      
useOwnProfile true
      
profile.bitmap "guiarm_scroll.png"
      
height 75;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 176;
      
19;
      
143;

      new 
GuiMLTextCtrl("NpcChat_MultiLine1") {
        
profile GuiBlueMLTextProfile;
        
height 32;
        
horizsizing "width";
        
text "Loading...";
        
width 151;
      }
      new 
GuiMLTextCtrl("NpcChat_MultiLine2") {
        
profile GuiBlueMLTextProfile;
        
height 66;
        
horizsizing "width";
        
text "Loading...";
        
width 151;
      }
      new 
GuiMLTextCtrl("NpcChat_MultiLine3") {
        
profile GuiBlueMLTextProfile;
        
height 32;
        
horizsizing "width";
        
text "Loading...";
        
width 151;
      }
      new 
GuiMLTextCtrl("NpcChat_MultiLine4") {
        
profile GuiBlueMLTextProfile;
        
height 32;
        
horizsizing "width";
        
text "Loading...";
        
width 151;
      }
    }
    new 
GuiScrollCtrl"Npc_Chat_Scroll" ) {
      
this.width 250;
      
this.height 330;
      
      
this.19;
      
this.143;
      
      
this.hScrollBar "alwaysOff";
      
this.vScrollBar "dynamic";
      
      new 
GuiTextListCtrl"Npc_Chat_ItemList" ) {
        
this.width 250;
        
this.height 330;
      }
    }
    new 
GuiShowImgCtrl("NpcChat_Image1") { 
      
9
      
partx 0;
      
party 60;
      
partw 50;
      
parth 36;
      
width 150
      
height 150
      
image "block.png"
    } 
  }

and in the dbnpc NpcChat as a flag:
PHP Code:
info"Ramerd","You like girls?","YOURE ***!","I'm ***","","NO WAY!""head22.png"
Like i said, the
PHP Code:
NpcChat_Window1.setText(temp.setup[0]); 
is showing up the entire array, and shouldnt be as far as I can see. None of the other texts or lines are getting any values at all.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote