|
Help!
by VoroneTZ. 10/14/25 05:04
|
|
|
|
|
|
|
|
|
PANEL SHOW Flag makes Engine crash ._.?
#398710
04/05/12 13:58
04/05/12 13:58
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
hi there.. i´ve written this codes:
PANEL* pan_objectlist =
{
pos_y = 61;
pos_x = 0;
layer = 90;
bmap = bm_listbutt_0;
size_y = 1920;
flags = SHOW;
}
void create_listbuttons(var typus)
{
var izahl, igoalzahl;
igoalzahl = 1001;
if(typus == 1)
{
for(izahl=0; izahl<igoalzahl; izahl++)
{
pan_setdigits(pan_objectlist, 0, -400, izahl*bmap_height(bm_listbutt_on), "%s", arialing, 1, "leer");
pan_setbutton(pan_objectlist, 0, 0, -400, izahl*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
wait(1);
}
}
else
{
for(izahl=0; izahl<igoalzahl; izahl++)
{
pan_setdigits(pan_objectlist, izahl, -400, izahl*bmap_height(bm_listbutt_on), "%s", arialing, 1, "leer");
pan_setbutton(pan_objectlist, izahl, 0, -400, izahl*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
wait(1);
}
}
}
void addto_objectlist(var objektnummer)
{
pan_setdigits(pan_objectlist, objektnummer, 0, objektnummer*bmap_height(bm_listbutt_on), "%s", arialing, 1, (objektnamen.pstring)[objektnummer]);
pan_setbutton(pan_objectlist, objektnummer, 0, 0, objektnummer*bmap_height(bm_listbutt_on), bm_listbutt_on, bm_listbutt_off, bm_listbutt_over, bm_listbutt_off, NULL, NULL, NULL);
wait(1);
}
the panel bitmap has a height of 20, and a width of 200. So it should be repeated with a y size of 1920. The first function creates the buttons or resets them (see variable switch). The second fucntion makes a panel visible and enables mouseclick for the user, by pushing its pos_x to 0. What i do is: on startup (after 2 frames waiting after level_load):
create_listbuttons(1); //initialize the buttons and digits
on object_loading (reaout folder and make a list):
//reset buttons to X = -400, to hide them all.
create_listbuttons(0);
wait_for(create_listbuttons);
The object_loader is called just once, when changing the category. and for when an object is listed:
addto_objectlist(entitycounter);
if you need the object loader too:
void load_files()
{
//reset buttons to X = -400, to hide them all.
create_listbuttons(0);
wait_for(create_listbuttons);
var ilt, objectcount, fhandle, entitycounter;
entitycounter = 0;
for(ilt=0; ilt<4000; ilt++)
{
str_cpy((ordnerinhalt.pstring)[ilt], "");
str_cpy((objekteigenschaften.pstring)[ilt], "");
str_cpy((objektnamen.pstring)[ilt], "");
}
txt_for_dir(ordnerinhalt, "Models\\Map\\*.mdl");
for(ilt=0; ilt<4000; ilt++)
{
if((ordnerinhalt.pstring)[ilt] != NULL)
{
if(str_stri((ordnerinhalt.pstring)[ilt], ".mdl") && str_stri((ordnerinhalt.pstring)[ilt], themenname))
{
objectlist[entitycounter] = ent_create(NULL, vector(-9000,-9000,-9000), NULL);
objectlist[entitycounter].string1 = str_create((ordnerinhalt.pstring)[ilt]);
str_cpy((objektnamen.pstring)[entitycounter], objectlist[entitycounter].string1);
str_trunc((ordnerinhalt.pstring)[ilt], 3);
str_cat((ordnerinhalt.pstring)[ilt], "nymph");
if(file_exists((ordnerinhalt.pstring)[ilt]))
{
objectlist[entitycounter].string2 = str_create((ordnerinhalt.pstring)[ilt]);
fhandle = file_open_read((ordnerinhalt.pstring)[ilt]);
file_close(fhandle);
}
else
{
objectlist[entitycounter].string2 = str_create("NoSetup");
}
//Add object to the button list
addto_objectlist(entitycounter);
wait(1);
entitycounter += 1;
auswahlobjekte = ilt+1;
}
}
}
}
My problem now: When i use:
PANEL* pan_objectlist =
{
pos_y = 61;
pos_x = 0;
layer = 90;
bmap = bm_listbutt_0;
size_y = 1920;
flags = SHOW;
}
Engine crashes with "Acknex is not working" windows message When i hide the "flags = SHOW;" in a comment like "//flags = SHOW;", it works ._. Wheres the problem? Did i make something wrong in the Panel definition?
Last edited by Espér; 04/05/12 13:59.
|
|
|
|