void __fastcall TfrmImageLib::ebOkClick(TObject*) { if (bFormLocked) return; UpdateLib (); HideLib (); }
void __fastcall TfrmSoundLib::ebOkClick(TObject *Sender) { if (bFormLocked) return; m_Snd.destroy (); UpdateLib (); HideLib (); }
void __fastcall TfrmImageLib::ebRebuildAssociationClick(TObject *) { if (ELog.DlgMsg(mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,"Are you sure to export association?")==mrNo) return; if (!modif_map.empty()){ int res = ELog.DlgMsg(mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo<<mbCancel,"Save modified properties?"); switch (res){ case mrYes: UpdateLib(); break; case mrNo: break; case mrCancel: return; } } string_path nm; FS.update_path (nm,_game_textures_,"textures.ltx"); CInifile* ini = xr_new<CInifile>(nm, FALSE, FALSE, TRUE); LockForm (); FS_FileSetIt it = texture_map.begin(); FS_FileSetIt _E = texture_map.end(); SPBItem* pb = UI->ProgressStart(texture_map.size(),"Export association"); bool bRes=true; for (;it!=_E; it++){ ETextureThumbnail* m_Thm = xr_new<ETextureThumbnail>(it->name.c_str()); pb->Inc (it->name.c_str()); AnsiString base_name= ChangeFileExt(it->name.c_str(),""); ImageLib.WriteAssociation (ini,base_name.c_str(),m_Thm->_Format()); xr_delete (m_Thm); if (UI->NeedAbort()){ bRes=false; break; } } UI->ProgressEnd(pb); UnlockForm(); if (!bRes) ini->bSaveAtEnd = false; xr_delete(ini); }