Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2010, 08:15 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Problem with onMouseEnters and Gui Controls

I'm currently having a problem with Gui Controls not detecting the mouse for the full width and height of the control.

Here's a video, you can see at the bottom when I scroll over it only shows the display name for part of the control. Does anyone have any idea on what could be wrong?
http://www.youtube.com/watch?v=lMUzatAHrKw
Reply With Quote
  #2  
Old 10-21-2010, 08:22 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Well I'd guess showing the script that involves this would help as a start, and MAN THAT GUY CAN HIT FOR 10!
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #3  
Old 10-21-2010, 08:22 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
You're positive that there's no control above it all?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 10-21-2010, 08:23 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by xXziroXx View Post
You're positive that there's no control above it all?
positive, i even put a transparent guibitmapctrl on top of each one to test and it does the same thing.
Reply With Quote
  #5  
Old 10-21-2010, 08:29 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Here's the script
PHP Code:
public function updateInventory(){
  for (
temp.0temp.42temp.i++)
  {
    (@ 
"InventoryGuiBitmapCtrl_item_" temp.i).destroy();
  }
  
temp.itemlist clientr.item.getdynamicvarnames();
  
temp.= -1;
  for (
temp.0temp.temp.itemlist.size(); temp.i++)
  {
    if (
clientr.item.(@temp.itemlist[temp.i])[13] == this.selectedtab)
    {
      if (
temp.4)
      {
        
temp.null;
        
temp.h++;
      }
      else
        
temp.w++;
      
with (InventoryGuiScrollCtrl_Contents){
        new 
GuiShowImgCtrl("InventoryGuiShowImgCtrl_item_" temp.i){
          
this.itemvars = {temp.itemlist[temp.i], clientr.item.(@temp.itemlist[temp.i])[9]};
          
= (temp.w*33);
          
= (temp.h*33);
          
image clientr.item.(@temp.itemlist[temp.i])[12];
          
width height 32;
          
thiso.catchevent(name"onMouseEnter""onUpdateItemNameText");
          
thiso.catchevent(name"onMouseLeave""onClearItemNameText");
          
thiso.catchevent(name"onMouseDown""onTest");
          new 
GuiTextCtrl("InventoryGuiTextCtrl_item_" temp.i){
            
this.itemvars = {temp.itemlist[temp.i], clientr.item.(@temp.itemlist[temp.i])[9]};
            
0;
            
10;
            
width height 32;
            
useownprofile true;
            
profile.align "right";
            
profile.textshadow true;
            
text clientr.item.(@temp.itemlist[temp.i])[0];
            
thiso.catchevent(name"onMouseEnter""onUpdateItemNameText");
            
thiso.catchevent(name"onMouseLeave""onClearItemNameText");
            
thiso.catchevent(name"onMouseDown""onTest");
          }
        }
      }
    }
  }
  
GraalControl.makefirstresponder(true);

Reply With Quote
  #6  
Old 10-21-2010, 08:30 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Cubical View Post
positive, i even put a transparent guibitmapctrl on top of each one to test and it does the same thing.
Not sure then. Only times I've had issues like this is when some control was misplaced above the rest.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 10-21-2010, 08:36 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
First of all, you can replace

PHP Code:
  for (temp.0temp.42temp.i++)
  {
    (@ 
"InventoryGuiBitmapCtrl_item_" temp.i).destroy();
  } 
with

PHP Code:
InventoryGuiScrollCtrl_Contents.clearControls(); 
You also don't have to use temp.w and temp.h to determine the positions of the controls. Instead you could use this:

PHP Code:
33*(temp.i%4);
33*int(temp.y/4); 
I'm also fairly sure that your text controls is what messes it up. Try commenting them out. Why aren't you just setting text = clientr.item.(@temp.itemlist[temp.i])[0]; in the GuiShowImgCtrl though?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 10-21-2010, 09:17 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by xXziroXx View Post
First of all, you can replace

PHP Code:
  for (temp.0temp.42temp.i++)
  {
    (@ 
"InventoryGuiBitmapCtrl_item_" temp.i).destroy();
  } 
with

PHP Code:
InventoryGuiScrollCtrl_Contents.clearControls(); 
You also don't have to use temp.w and temp.h to determine the positions of the controls. Instead you could use this:

PHP Code:
33*(temp.i%4);
33*int(temp.y/4); 
I'm also fairly sure that your text controls is what messes it up. Try commenting them out. Why aren't you just setting text = clientr.item.(@temp.itemlist[temp.i])[0]; in the GuiShowImgCtrl though?
I figured out what the problem was, I forgot I added a control in another WNPC. Anyways, thanks for the pointers especially the clearControls().
Reply With Quote
  #9  
Old 10-21-2010, 10:23 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Just for future reference, you can do .bringToFront() so you know the control is on the top layer even if another GuiControl is covering it.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #10  
Old 10-22-2010, 01:23 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by MrOmega View Post
Just for future reference, you can do .bringToFront() so you know the control is on the top layer even if another GuiControl is covering it.
yeah, I use that for a few gui controls on that wnpc
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:21 PM.


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