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 04-12-2010, 05:55 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
A couple question about GuiTreeViewCtrl

1) Can I collapse all nodes? For large trees it's annoying to have them all expanded when the tree is created. I tried:
PHP Code:
with (addnodebypath(i.name,"/")) {
  
image selectedimage 2;
  
expanded false;

But that didn't do anything. I even looped through all the nodes and used 'expanded = false' but still no luck

2) Can I delete a node?

3) How would I go about setting a custom image for a node, instead of the predefined ones?
Reply With Quote
  #2  
Old 04-12-2010, 07:16 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Interestingly enough,

PHP Code:
function Test_Tree.onExpand() {
  
player.chat Test_Tree.expanded;

and

PHP Code:
function Test_Tree.onFold() {
  
player.chat Test_Tree.expanded;

both return true, which doesn't really make sense when folding a node. Also, if you try:

PHP Code:
Test_Tree.expanded false
then the entire tree disappears, which would appear to be a bug unless it isn't intended to be used this way.
Reply With Quote
  #3  
Old 04-12-2010, 07:20 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
1) If that doesn't work to collapse a node, then I don't think there is a way.

2) node_object.destroy() should work.

3) You should be able to do it the same way as with GuiTextListCtrl:
PHP Code:
with (addnodebypath(i.name"/"))
{
  
icon.clearall();
  
icon.drawimage(00"icon_image.png");

node_object.icon is a TDrawingPanel, same as rows in a GuiTextListCtrl.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 04-12-2010, 07:39 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by coreys View Post
1) If that doesn't work to collapse a node, then I don't think there is a way.

2) node_object.destroy() should work.

3) You should be able to do it the same way as with GuiTextListCtrl:
PHP Code:
with (addnodebypath(i.name"/"))
{
  
icon.clearall();
  
icon.drawimage(00"icon_image.png");

node_object.icon is a TDrawingPanel, same as rows in a GuiTextListCtrl.
I'll admit I didn't try destroy(), so I'll test that out.

Also, I did try icon.panelstuff() to no avail. I'll give it another try, though.
Reply With Quote
  #5  
Old 04-12-2010, 08:37 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ya, icon.xxx() doesn't seem to be working

edit: nevermind, I just had to seticonsize() first.

Last edited by DustyPorViva; 04-12-2010 at 09:02 PM..
Reply With Quote
  #6  
Old 04-12-2010, 10:26 PM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
For #1, instead of expanded, try using visible. It collapsed fine with visible.
For #2, use destroy().
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #7  
Old 04-12-2010, 11:13 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
visible worked great, thanks

All problems solved, I think... yey!
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 04:24 PM.


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