From: Willem J. P. <wjp...@us...> - 2006-12-28 14:26:22
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14923/plugins/GUIScript Modified Files: GUIScript.cpp Log Message: fix button picturelists not being cleared when button is changed Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.433 retrieving revision 1.434 diff -C2 -d -r1.433 -r1.434 *** GUIScript.cpp 28 Dec 2006 14:13:17 -0000 1.433 --- GUIScript.cpp 28 Dec 2006 14:26:17 -0000 1.434 *************** *** 4427,4430 **** --- 4427,4431 ---- btn->SetFlags( IE_GUI_BUTTON_PICTURE, BM_OR ); Sprite2D* Picture; + bool setpicture = true; int i; switch (Which) { *************** *** 4439,4448 **** btn->StackPicture(Picture); } Picture = NULL; break; case 4: case 5: - btn->ClearPictureList(); Picture = GetUsedWeaponIcon(item, Which-4); if (Item2ResRef) { Item* item2 = core->GetItem(Item2ResRef); if (item2) { --- 4440,4450 ---- btn->StackPicture(Picture); } + setpicture = false; Picture = NULL; break; case 4: case 5: Picture = GetUsedWeaponIcon(item, Which-4); if (Item2ResRef) { + btn->ClearPictureList(); Item* item2 = core->GetItem(Item2ResRef); if (item2) { *************** *** 4453,4457 **** } if (Picture) btn->StackPicture(Picture); ! Picture = NULL; } break; --- 4455,4459 ---- } if (Picture) btn->StackPicture(Picture); ! setpicture = false; } break; *************** *** 4460,4464 **** } ! btn->SetPicture( Picture ); if (tooltip) { //later getitemname could also return tooltip stuff --- 4462,4467 ---- } ! if (setpicture) ! btn->SetPicture( Picture ); if (tooltip) { //later getitemname could also return tooltip stuff |