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 05-14-2007, 03:28 AM
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
GuiTextListCtrl

Could anyone explain how the following commands works, preferably with an example?


PHP Code:
sortcolumn integer

sortmode 
string

sortorder 
string 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #2  
Old 05-14-2007, 04:28 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Well, I just use sort() which alphabatizes. I assume those change the way it sorts.
__________________
Reply With Quote
  #3  
Old 05-14-2007, 12:35 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by xXziroXx View Post
Could anyone explain how the following commands works, preferably with an example?


PHP Code:
sortcolumn integer

sortmode 
string

sortorder 
string 
Well, I don't know what sortcolumn does, but:

For sortmode, it can be either 'ascending' or 'descending', e.g

PHP Code:
sortMode "ascending"
This is also probably the same for sortorder


And, per what cbkbud said, you need to call sort() for it to actually sort.
__________________
What signature? I see no signature?
Reply With Quote
  #4  
Old 05-14-2007, 01:14 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
most likely:

sortcolumn = 1; // To sort the second column

sort();
__________________
- Zidane / Zidaya
Reply With Quote
  #5  
Old 09-02-2008, 10:58 AM
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
M-m-m-meeega Buuuump!


Is there a way to sort by value (well I know there's a sortmode = "value";, but keep reading!)? Sorting numbers does fishy sorting like... 12, 34, 260 would be sorted as:

12
260
32

A bit frustrating when making a shop GUI and want to sort it by item costs
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 09-03-2008, 01:52 AM
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
I guess not.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 09-03-2008, 02:20 AM
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
Quote:
Originally Posted by godofwarares View Post
...
Hey! It's me!


Quote:
Originally Posted by xXziroXx View Post
M-m-m-meeega Buuuump!


Is there a way to sort by value (well I know there's a sortmode = "value";, but keep reading!)? Sorting numbers does fishy sorting like... 12, 34, 260 would be sorted as:

12
260
32

A bit frustrating when making a shop GUI and want to sort it by item costs
The problem with the sorting is that it's sorted by the first letter of a string rather than the integer values of said numbers. I suppose you would have to get the elements from the list and parse them yourself, and then re-add them in that specific order, provided the list doesn't auto-sort.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #8  
Old 09-03-2008, 02:32 AM
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 Programmer View Post
The problem with the sorting is that it's sorted by the first letter of a string rather than the integer values of said numbers. I suppose you would have to get the elements from the list and parse them yourself, and then re-add them in that specific order, provided the list doesn't auto-sort.
Yeah, I know, I was hoping I could avoid it though, say if Stefan implemented an actual value sort for numbers or something.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 09-03-2008, 02:48 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
Beside graal.net you can also easily search on the Graal forums for stuff Quoting http://forums.graalonline.com/forums...81&postcount=2 :

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.

---

sortmode can be "value", "name" or "extension"
Reply With Quote
  #10  
Old 09-03-2008, 04:35 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
Right, thanks!

Exactly how does groupsortorder and sortgroup work though?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 09-04-2008, 12:34 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
The text list control is displaying group by group, if groupsortorder is ascending then entries would be displayed like 1,1,1,2,2,2,2 (entry.sortgroup). So basicly 'groupsortmode' is always 'value'.
When the entries have the same group then the entry.sortvalue decides if they are above or below.

In the playerlist buddies have group 1, normal people 2, ignored people 3 (or something like that). The players are sorted either alphabetically (sortmode 'name') or by time of arrival/last pm (sortmode 'value').
Reply With Quote
  #12  
Old 09-04-2008, 01:07 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
Naruhodo! Arigato
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 09-04-2008, 02:52 PM
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
Quote:
Originally Posted by xXziroXx View Post
I see! Thank you
Fixed.
__________________
Reply With Quote
  #14  
Old 09-05-2008, 01:08 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 Inverness View Post
Naruhodo! Arigato
Fixed.

... or should I say kimatte imasu?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #15  
Old 09-05-2008, 03:30 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by xXziroXx View Post
... or should I say kimatte imasu?

English plox?
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #16  
Old 09-05-2008, 04:52 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 Deas_Voice View Post

English plox?
Japanese > English.


Also Stefan, would it be possible for you to implement so you can change textprofiles (well, text manipulating in general) for each individual row?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #17  
Old 09-06-2008, 06:58 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
You can (/scripthelp GuiTextListEntry) :

PHP Code:
with (addrow(0"Test")) {
  
useownprofile true;
  
profile.fontcolor = {255,0,0};

Reply With Quote
  #18  
Old 09-06-2008, 07:14 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 Stefan View Post
You can (/scripthelp GuiTextListEntry) :

PHP Code:
with (addrow(0"Test")) {
  
useownprofile true;
  
profile.fontcolor = {255,0,0};

My stupidity in throughout this thread is more notable then ever.

I was trying:

PHP Code:
addrow(0"Foobar");
rows[0].profile "foobarprofile"
... and that didn't work.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #19  
Old 09-06-2008, 07:25 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by xxziroxx View Post
japanese > english.
No, it doesn't.
__________________
Reply With Quote
  #20  
Old 09-06-2008, 07:34 PM
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
Quote:
Originally Posted by xXziroXx View Post
... and that didn't work.
The first parameter in addrow() is the row's ID not index. Also, profiles are objects, not strings. Your script should work if foobar is the first row.
__________________
Reply With Quote
  #21  
Old 09-07-2008, 02:32 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
Quote:
Originally Posted by Inverness View Post
The first parameter in addrow() is the row's ID not index. Also, profiles are objects, not strings. Your script should work if foobar is the first row.
You still need useownprofile = true (otherwise it's using the GuiTextListCtrl profile or null, not sure)
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 05:26 AM.


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