Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-18-2008, 09:08 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
GUIs and the active attribute

I've noticed that with GuiPopUpMenuCtrl, GuiTextListCtrl, and GuiContextMenuCtrl, the "active" attribute doesn't actually disable the entry. For instance, even if the active attribute is set to false, the action (onAction, onSelect, etc) still occurs. However, on GuiButtonCtrl, for example, the action doesn't occur.

This isn't a huge problem, as I can just write checks to make sure the action is canceled if the control doesn't have active set to true. But, it'd be nice to not have to write those.
Reply With Quote
  #2  
Old 07-19-2008, 06:52 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
active is supposed to make the GUI act "disabled" not just ignore function triggers.
__________________
Do it with a DON!
Reply With Quote
  #3  
Old 07-19-2008, 11:34 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Hmmm if active=false it should look "grayed" and not accept input/clicks, but selecting an entry by script should still trigger an event.
Reply With Quote
  #4  
Old 07-19-2008, 07:47 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Yes, it does look grayed out. However, with those GUI controls I mentioned, the user can still select an entry.

For example, I have a right-click menu (context menu) with 4 entries. I run a check to see if a user's account is in an array. If it's not, 2 of the entries are disabled. However, the user can still select a disabled entry, and the action will still go through. To prevent that, I have to run another check through the array; if the user isn't in there, I simply "return;" the action.
Reply With Quote
  #5  
Old 07-19-2008, 08:10 PM
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 LoneAngelIbesu View Post
Yes, it does look grayed out. However, with those GUI controls I mentioned, the user can still select an entry.

For example, I have a right-click menu (context menu) with 4 entries. I run a check to see if a user's account is in an array. If it's not, 2 of the entries are disabled. However, the user can still select a disabled entry, and the action will still go through. To prevent that, I have to run another check through the array; if the user isn't in there, I simply "return;" the action.
You should be running that check regardless.. Don't rely on gui control variables.
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 07-19-2008, 08:33 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
The point is, I shouldn't have to run two checks. In nearly every other GUI control, the active attribute disables selecting the control entirely. I figured that when implementing the Torque GUI code, some things were left out; either that, or they were left out of Torque entirely. It's odd that it disables selecting for most GUIs, but doesn't do it for the three GUIs mentioned in the original post.
Reply With Quote
  #7  
Old 07-19-2008, 08:43 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I can check the GuiTextListCtrl, but the other two controls are opened/shown by scripts anyway? An 'active' attribute doesn't really make sense for right-click menus that are opened by script.

The Graal controls are a complete rewrite so it's natural that some stuff is different.
Reply With Quote
  #8  
Old 07-19-2008, 09:02 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
I'm not sure what you mean when you say that they're opened by a script.

Here's an example of what I'm talking about with drop-down menus:
PHP Code:
new GuiPopUpMenuCtrl("Example_Popup1") {
  
profile GuiBluePopUpMenuProfile;
  
height 20;
  
maxpopupheight 200;
  
scrollprofile "GuiTextProfile";
  
text "Example Popup";
  
width 120;

  
addrow(0"Example entry one.");
  
addrow(1"Example entry two.");
  
with(addrow(2"Example entry three.")) active false;
  
addrow(3"Example entry four.");

While the user can put their mouse over entry 3, and it won't be highlighted like the other entries, they can still select that entry. The same goes for context menus.
Reply With Quote
  #9  
Old 08-02-2008, 04:47 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
I'm working on a GuiMenuCtrl of my own and I also have this problem. It'd be nice if the active attribute would block the function from occuring in the first place like it does with button controls.
Even if I run checks and return triggers that don't meet the conditions, it still destroys the context menu when you click a selection with active = false; which is a nuisance.
So hopefully this can be worked out.
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 02:00 AM.


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