void plAgeDescInterface::IUpdateCurAge( void ) { // Get the current age selection plAgeFile *currAge = IGetCurrentAge(); if (currAge == nil) { ISetControlDefaults(); IEnableControls( false ); return; } IEnableControls( true ); #ifdef MAXASS_AVAILABLE if( currAge->fType == plAgeFile::kAssetFile ) { // Gotta get the latest version from assetMan before loading char localFilename[ MAX_PATH ]; if( !(*fAssetManIface)->GetLatestVersionFile( currAge->fAssetID, localFilename, sizeof( localFilename ) ) ) { hsMessageBox( "Unable to get latest version of age asset from AssetMan. Things are about to get very funky...", "ERROR", hsMessageBoxNormal ); } else { ILoadAge( localFilename ); } } else #endif // Load the local age, also check its sequence #s ILoadAge( currAge->fPath, true ); }
void plAgeDescInterface::ICheckOutCurrentAge( void ) { #ifdef MAXASS_AVAILABLE hsAssert( !fCurrAgeCheckedOut, "Trying to re-check out an age!" ); plAgeFile *currAge = IGetCurrentAge(); if( currAge == nil ) { hsAssert( false, "How are you checking out an age if none is selected?" ); return; } if( currAge->fType != plAgeFile::kAssetFile ) return; // Check it out from AssetMan bool checkOutSuccess = (*fAssetManIface)->CheckOutAsset( currAge->fAssetID, fCheckedOutPath, sizeof( fCheckedOutPath ) ); if( !checkOutSuccess ) { hsMessageBox( "Unable to check out age file from AssetMan. Most likely somebody already has it checked out.", "Error", hsMessageBoxNormal ); return; } #endif fCurrAgeCheckedOut = true; // Make sure we loaded the latest version ILoadAge( fCheckedOutPath, true ); IInvalidateCheckOutIndicator(); IEnableControls( true ); }
bool plAgeDescInterface::IMakeSureCheckedIn( void ) { #ifdef MAXASS_AVAILABLE int result; plAgeFile* currAge = IGetCurrentAge(); if (!currAge) return true; if ( currAge->fType == plAgeFile::kAssetFile && fCurrAgeCheckedOut ) { // We're switching away from an age we have checked out--ask what they want to do result = DialogBox( hInstance, MAKEINTRESOURCE( IDD_AGE_CHECKIN ), GetCOREInterface()->GetMAXHWnd(), DumbDialogProc ); if( result == IDCANCEL ) { // Got cancelled return false; } else if( result == IDYES ) { ICheckInCurrentAge(); } else { IUndoCheckOutCurrentAge(); } } else if( currAge->fType == plAgeFile::kLocalFile && fDirty ) { // Ask if we want to save changes result = DialogBox( hInstance, MAKEINTRESOURCE( IDD_AGE_SAVEYESNO ), GetCOREInterface()->GetMAXHWnd(), DumbDialogProc ); if( result == IDCANCEL ) { // Got cancelled return false; } else if( result == IDYES ) { ISaveCurAge( currAge->fPath.c_str() ); } else { // Reload the non-saved version ILoadAge( currAge->fPath.c_str() ); } IEnableControls( true ); } #endif return true; }
void plAgeDescInterface::IUndoCheckOutCurrentAge( void ) { #ifdef MAXASS_AVAILABLE hsAssert( fCurrAgeCheckedOut, "Trying to undo check out an age when none is checked out!" ); plAgeFile *currAge = IGetCurrentAge(); if( currAge == nil ) { hsAssert( false, "How are you undoing a checkout if no age is selected?" ); return; } // Check the age file back in to AssetMan (*fAssetManIface)->UndoCheckOutAsset(currAge->fAssetID); fCurrAgeCheckedOut = false; // Reload the non-saved version ILoadAge( fCheckedOutPath ); #endif IInvalidateCheckOutIndicator(); IEnableControls( true ); }
// // read in the age desc file and page in/out the rooms belonging to the specified age. // return false on error // //============================================================================ bool plAgeLoader::LoadAge(const plString& ageName) { return ILoadAge(ageName); }
// // read in the age desc file and page in/out the rooms belonging to the specified age. // return false on error // //============================================================================ bool plAgeLoader::LoadAge(const char ageName[]) { return ILoadAge(ageName); }