Foob Posted August 2, 2020 Group: Members Topic Count: 46 Topics Per Day: 0.02 Content Count: 267 Reputation: 40 Joined: 01/19/17 Last Seen: Wednesday at 03:47 AM Share Posted August 2, 2020 I have this problem when select menu has many entry such as 50+ menu. e.g. setarray .@menu_list[0],1,2,3,4,5,6,up-to,100; .@size = getarraysize(.@menu_list); for( .@i = 0; .@i < .@size; .@i++ ) and so on.. In-game it will only appear up-to 50 and other will not show. Is there a way to paginate select lets say for example per page is 30 menu then next is 30? Quote Link to comment Share on other sites More sharing options...
0 Kreustoo Posted August 2, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Share Posted August 2, 2020 Hello, Split in different string .@menu1$, .@menu2$ ect, with a next/previous, so you'll simulate pagination Quote Link to comment Share on other sites More sharing options...
0 PottScilgrim Posted August 3, 2020 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 18 Reputation: 12 Joined: 04/10/20 Last Seen: March 4, 2021 Share Posted August 3, 2020 (edited) It's pretty basic, but I've got a pagination function (based on Chris' found here: Click) that I use for my unlockable warper NPC. You should be able to use it in the same way. This is the syntax for use: @menuoption = callfunc("F_MPages",implode(@MENU_T$,":")); @menuoption will return the array location. @MENU_T$ is the array containing all of the menu items. Change .@pg_max to the number of options you'd like on each page. function script F_MPages { .@debug = 0; .@pg_max = 20; explode(.@pg_array$,getarg(0),":"); // Re-Saving string into Array .@as = getarraysize(.@pg_array$); if(.@debug == 1){debugmes ".@as = "+.@as;} if(getarraysize(.@pg_array$) < .@pg_max){ .@pg_count = 1; if(.@debug == 1){debugmes "Defaulting to 1 page";} } else { .@pg_count = 1; while(.@as > .@pg_max){ .@pg_count = .@pg_count+1; .@as = .@as - .@pg_max; } @pg_count = (.@as/.@pg_max); // Calculating max pages based on .@pg_max if(.@debug == 1){debugmes "Setting "+.@pg_count+" pages";} } set .@cur_pg,1; if(.@debug == 1){ debugmes ".@pg_max = "+.@pg_max; debugmes ".@cur_pg = "+.@cur_pg; debugmes "Array size = "+getarraysize(.@pg_array$); } MAIN: if(.@debug == 1){debugmes "Current Page ["+.@cur_pg+"]";} .@menu$ = ""; for(.@i=.@q; .@i < (.@q+.@pg_max); .@i++){ .@menu$ = .@menu$+.@pg_array$[.@i]+":"; } if(.@cur_pg == .@pg_count){ .@menu$ = .@menu$+"[^FF0000Cancel^000000]"; } else if(.@cur_pg < .@pg_count){ .@menu$ = .@menu$+"[^008722Next Page^000000]"; } .@choice = select(.@menu$); if(.@debug == 1){debugmes ".@choice = "+.@choice;} if(.@choice > .@pg_max){ if(.@cur_pg == .@pg_count) { callfunc "close3"; } else if(.@cur_pg < .@pg_count) { .@cur_pg = .@cur_pg+1; .@q = .@q+.@pg_max; goto MAIN; } } if(.@cur_pg == 1){ .@return = .@choice-1; } else { .@return = (.@choice-1)+((.@cur_pg-1)*.@pg_max); } if(.@debug == 1){debugmes "return = "+.@return;} return .@return; //close; } Edited August 3, 2020 by PottScilgrim Quote Link to comment Share on other sites More sharing options...
0 Patskie Posted August 4, 2020 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted August 4, 2020 You can check out @Skorm post here 1 Quote Link to comment Share on other sites More sharing options...
Question
Foob
I have this problem when select menu has many entry such as 50+ menu.
e.g.
setarray .@menu_list[0],1,2,3,4,5,6,up-to,100; .@size = getarraysize(.@menu_list); for( .@i = 0; .@i < .@size; .@i++ ) and so on..
In-game it will only appear up-to 50 and other will not show.
Is there a way to paginate select lets say for example per page is 30 menu then next is 30?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.