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 07-27-2006, 08:37 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Tree Views + Loadarray

In a textfile, I have this:

PHP Code:
Leader=Leader
Leader.1
=KuJi
Leader
.Generals=Generals
Leader
.Generals.1=General1
Leader
.Generals.1.1=Test1
Leader
.Generals.2=General2
Leader
.Generals.2.1=Test1
Leader
.Generals.2.2=Test2
Leader
.Generals.3=General3
Leader
.Generals.3.1=Test1
Leader
.Generals.3.2=Test2
Leader
.Generals.3.3=Test3 
On serverside, I load the text file to an object, then save it as an array and trigger it to the clientside.

PHP Code:
this.gang_ranks = new TStaticVar(); 
this.gang_ranks.clear();
this.gang_ranks.loadvars("/gangs/" params[1] @ "_ranks.txt");  
temp.rankholder this.gang_ranks.savevarstoarray(true); 
Then I load it in a tree. Only thing is temp.rankholder doesn't keep the same sort order as the text file and it mixes up the order of the ranks which in the tree view mess it up. So I couldn't find out why, so I tried to find a way to get the treenodes to sort and I can't get that to work either. If you know how to make the vars not sort, or you know how to sort treenodes please help :o
Reply With Quote
  #2  
Old 07-27-2006, 11:57 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
For the tree view you set attributes like this:

sortmode = "value";
sortorder = "descending";
groupsortorder = "ascending";

For the nodes then:

sortvalue = 1;
sortgroup = 2;

That would sort the nodes after the value you have assigned to them. When you set sortmode="name" then it will be sorted alphabetically. The sort group can be used to let some types of nodes always appear at the top, e.g. in a folder view you would want to display the folders at the top.
Reply With Quote
  #3  
Old 07-28-2006, 12:11 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Stefan
For the tree view you set attributes like this:

sortmode = "value";
sortorder = "descending";
groupsortorder = "ascending";

For the nodes then:

sortvalue = 1;
sortgroup = 2;

That would sort the nodes after the value you have assigned to them. When you set sortmode="name" then it will be sorted alphabetically. The sort group can be used to let some types of nodes always appear at the top, e.g. in a folder view you would want to display the folders at the top.
It would be easier for me if the objects when loaded to an array didn't mix up though. I don't think ascending/descending will make the object look as it should originally :o
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 12:11 PM.


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