G
gameon
Guest
I have several instance arrays, obviously with there own id. With gamepads/keyboard only in mind I wanted to put into "focus" the next id within the list. If the id = noone or last id on the list simply start with the first id on the list, otherwise goto next id. The first part works great without the else statement. So...somewhere within the else statement I am most likely missing something. Each id draws fine above each instance. The list of all id's draw fine so I know this is correct.
I have the following set up:
global.curid = current id in focus;
global.myid = List of all instance id's for the array object;
instance variable: focus (so that only the id with focus can be controlled)
Here's the code:
I have the following set up:
global.curid = current id in focus;
global.myid = List of all instance id's for the array object;
instance variable: focus (so that only the id with focus can be controlled)
Here's the code:
Code:
// Find all gamepads and return/allow all indexes
gp = scr_gp();
// Put focus onto next id.
if (keyboard_check_pressed(vk_right) || gamepad_button_check_pressed(gp, gp_padr))
{
// No id in focus or last id in list in focus
if ( global.curid = noone || global.curid = ds_list_find_value(global.myid, ds_list_size(global.myid) - 1))
{
var get = ds_list_find_value(global.myid, 0)
with(get) {focus = true}; global.curid = get;
}
else
{
// id in focus find next id put that one in focus
var get = ds_list_find_value(global.myid, ds_list_find_index(global.myid, global.curid) + 1)
with(all) {focus = false;}
with(get) {focus = true;}
global.curid = get;
}
}