230
274
if (script->totscript) {
231
275
strcpy(str, "FrameChanged%x 1|");
232
276
strcat(str, "Redraw%x 4|");
277
strcat(str, "Render%x 16|");
234
strcat(str, "OnLoad%x 2");
279
strcat(str, "OnLoad%x 2|");
280
strcat(str, "OnSave%x 8");
237
uiDefButS(block, MENU, 1, str, (short)sx, (short)sy, 140, 19, &script->flag[script->actscript-1], 0, 0, 0, 0, "Script links for the Frame changed event");
283
uiDefButS(block, MENU, 1, str, (short)sx, (short)sy, 140, 19, &script->flag[script->actscript-1], 0, 0, 0, 0, "Script links for this event");
239
285
uiDefIDPoinBut(block, test_scriptpoin_but, 1, "", (short)(sx+140),(short)sy, 140, 19, &script->scripts[script->actscript-1], "Name of Script to link");
270
316
ScriptLink *script=NULL;
274
320
block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win);
275
321
if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return;
280
uiDefIconButS(block, ROW, B_REDR, ICON_OBJECT, xco,180,25,20, &G.buts->scriptblock, 2.0, (float)ID_OB, 0, 0, "Displays Object script links");
282
if(ob && give_current_material(ob, ob->actcol))
283
uiDefIconButS(block, ROW, B_REDR, ICON_MATERIAL, xco+=25,180,25,20, &G.buts->scriptblock, 2.0, (float)ID_MA, 0, 0, "Displays Material script links ");
286
uiDefIconButS(block, ROW, B_REDR, ICON_WORLD, xco+=25,180,25,20, &G.buts->scriptblock, 2.0, (float)ID_WO, 0, 0, "Displays World script links");
288
if(ob && ob->type==OB_CAMERA)
289
uiDefIconButS(block, ROW, B_REDR, ICON_CAMERA, xco+=25,180,25,20, &G.buts->scriptblock, 2.0, (float)ID_CA, 0, 0, "Displays Camera script links");
291
if(ob && ob->type==OB_LAMP)
292
uiDefIconButS(block, ROW, B_REDR, ICON_LAMP, xco+=25,180,25,20, &G.buts->scriptblock, 2.0, (float)ID_LA, 0, 0, "Displays Lamp script links");
295
if (ob && G.buts->scriptblock==ID_OB) {
296
script= &ob->scriptlink;
298
} else if (ob && G.buts->scriptblock==ID_MA) {
299
ma= give_current_material(ob, ob->actcol);
300
if (ma) script= &ma->scriptlink;
302
} else if (ob && G.buts->scriptblock==ID_CA) {
303
if (ob->type==OB_CAMERA)
304
script= &((Camera *)ob->data)->scriptlink;
323
uiDefButI(block, TOG|BIT|13, REDRAWBUTSSCRIPT,
324
"Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0,
325
"Enable execution of all assigned Script links");
326
/* for proper alignment: */
327
uiDefBut(block, LABEL, 0, "", 160, 200,150,20, NULL, 0.0, 0.0, 0, 0, "");
329
if (G.f & G_DOSCRIPTLINKS) {
332
uiDefIconButS(block, ROW, B_REDR, ICON_OBJECT, xco,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_OB, 0, 0, "Displays Object script links");
334
if(ob && give_current_material(ob, ob->actcol))
335
uiDefIconButS(block, ROW, B_REDR, ICON_MATERIAL, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_MA, 0, 0, "Displays Material script links ");
338
uiDefIconButS(block, ROW, B_REDR, ICON_WORLD, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_WO, 0, 0, "Displays World script links");
340
if(ob && ob->type==OB_CAMERA)
341
uiDefIconButS(block, ROW, B_REDR, ICON_CAMERA, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_CA, 0, 0, "Displays Camera script links");
343
if(ob && ob->type==OB_LAMP)
344
uiDefIconButS(block, ROW, B_REDR, ICON_LAMP, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_LA, 0, 0, "Displays Lamp script links");
347
if (ob && G.buts->scriptblock==ID_OB) {
348
script= &ob->scriptlink;
350
} else if (ob && G.buts->scriptblock==ID_MA) {
351
ma= give_current_material(ob, ob->actcol);
352
if (ma) script= &ma->scriptlink;
354
} else if (ob && G.buts->scriptblock==ID_CA) {
355
if (ob->type==OB_CAMERA)
356
script= &((Camera *)ob->data)->scriptlink;
306
} else if (ob && G.buts->scriptblock==ID_LA) {
307
if (ob->type==OB_LAMP)
308
script= &((Lamp *)ob->data)->scriptlink;
310
} else if (G.buts->scriptblock==ID_WO) {
312
script= &(G.scene->world->scriptlink);
358
} else if (ob && G.buts->scriptblock==ID_LA) {
359
if (ob->type==OB_LAMP)
360
script= &((Lamp *)ob->data)->scriptlink;
362
} else if (G.buts->scriptblock==ID_WO) {
364
script= &(G.scene->world->scriptlink);
367
if (script) draw_scriptlink(block, script, 10, 140, 0);
369
draw_scriptlink(block, &G.scene->scriptlink, 10, 80, 1);
315
if (script) draw_scriptlink(block, script, 10, 140, 0);
317
draw_scriptlink(block, &G.scene->scriptlink, 10, 80, 1);