Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-04-2007, 07:34 AM
Twizt3d Twizt3d is offline
Registered User
Join Date: Jul 2003
Posts: 15
Twizt3d is on a distinguished road
addControl(obj)

This command doesnt seem to be working... =\ heres an example that doesnt work for me. It's Briefed up a bit

PHP Code:
new GuiWindowCtrl("QMenu") {
    for (
temp.0temp.thiso.bags.size(); temp.i++){
      new 
GuiBitmapCtrl("Bag_"@thiso.bags[temp.i]){
        new 
GuiBitmapCtrl("BagIcon_"@thiso.bags[temp.i]) {
    
    
        }
      }
    }

    
    new 
GuiScrollCtrl("ItemsListScroll") {
    }
  }
  
GraalControl.addcontrol(QMenu);
}

//Seperate function
 
with (ItemsListScroll){
    for (
temp.0temp.makevar("thiso."@type).size(); temp.i++){
      new 
GuiBitmapCtrl("Q_Slot_"@temp.i) {
    
        new 
GuiShowImgCtrl("Q_Slot_Icon_"@temp.i) {
         
          
thiso.catchevent(name,"onMouseDown","onInvenDown")
            
          
        }
      }
    }
  }
}

//This is where the problem comes in:

function onInvenDown(obj){
   
GraalControl.addcontrol(obj);
}

//I have tried every different kind of combination. It still stays in the the parent it is in. I even tried: 
//with (QMenu) GraalControl.addControl(ItemsListScroll);
//It wont add it to GraalControl. It is like stuck in there =( 
Reply With Quote
  #2  
Old 02-04-2007, 09:25 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Uhh...your code is horribly styled and you seem to be missing something. If you are going to cut stuff out, at least leave the begining of functions and stuff so we know what is going on.

From what I see there, it looks like you are trying to do addcontrol for a GUI that is automatically added to GraalControl anyways?
__________________
Do it with a DON!
Reply With Quote
  #3  
Old 02-04-2007, 10:20 AM
Twizt3d Twizt3d is offline
Registered User
Join Date: Jul 2003
Posts: 15
Twizt3d is on a distinguished road
Well the styling is messed up because I took out a bunch of code. Also, I am trying to get one of the Q_Slot_Icon_ controls from its parent to GraalControl so I can move it around the entire screen rather then just inside its parent
Reply With Quote
  #4  
Old 02-04-2007, 11:04 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
When you make a Gui Control using new GuiControlName() {} rather than varname = new GuiControlName(); then addcontrol() is automatically called.

If you want to move something around the screen then why not make it a separate image?
__________________
Reply With Quote
  #5  
Old 02-04-2007, 11:28 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Oh I see what you are doing...
First make sure the catchevent is actaully being caught with an echo or something else.
Second, I suggest you just make a "floater" icon that floats in the GraalControl and you just make it invisable until you start to "drag" the icon. Once you drag the icon, just transfer all the data to that floater
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 02-04-2007, 11:16 PM
Twizt3d Twizt3d is offline
Registered User
Join Date: Jul 2003
Posts: 15
Twizt3d is on a distinguished road
I would just make a "floating" icon, but you can drag the entire windows so I would have to update all the icons. There are quite a few. The catchevent works. I know it does, I tested with echos like you said. The only thing I can think of is when u click on it, it creates a new ctrl in graalcontrol.
Reply With Quote
  #7  
Old 02-05-2007, 12:06 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Twizt3d View Post
I would just make a "floating" icon, but you can drag the entire windows so I would have to update all the icons. There are quite a few. The catchevent works. I know it does, I tested with echos like you said. The only thing I can think of is when u click on it, it creates a new ctrl in graalcontrol.

No no no...
The icons stay in the window and never actaully move. When you go to "drag" them, the floating icon (which was invisiable) becomes visable and retains all the data from the icon you are dragging. The actaul icons stay in the window and don't move on their own o_o
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 02-05-2007, 02:00 AM
Twizt3d Twizt3d is offline
Registered User
Join Date: Jul 2003
Posts: 15
Twizt3d is on a distinguished road
so just make one icon thats not visible in graalcontrol, lets say x = y = 0; then when u click on an icon the floater becomes visible and x = mousescreenx, blah blah, and all the data is set to it. hmm sounds like it will work. It would also make it easier to implement into my action bar. Thanks for Idea zero =)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:57 PM.


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