void ObjectivesEditor::_onEditObjConditions() { ObjectiveConditionsDialog _dialog(getRefPtr(), *_curEntity->second); _dialog.show(); refreshObjectivesList(); }
void ObjectivesEditor::_onEditLogic() { MissionLogicDialog _dialog(getRefPtr(), *_curEntity->second); _dialog.show(); refreshObjectivesList(); }
bool Panel_Remaps::Do_RenameRemap() { if( entity == NULL || curr_remap == NULL ) return false; // Ask for the name wxTextEntryDialog _dialog(this, wxT("Rename remap"), wxT("New name for this remap "), wxString(), wxOK | wxCANCEL | wxCENTRE ); int response = _dialog.ShowModal(); if( response == wxID_OK ) { wxString remap_name = _dialog.GetValue().Trim().Trim(false); if( remap_name == wxString() ) return false; wxString _comment = wxT("\t#") + remap_name; curr_remap->SetComment( _comment ); choiceBox_remaps->SetString( choiceBox_remaps->GetSelection(), remap_name.Left( 15 ) ); sizer_remaps_choice->Layout(); entity->SetChanged(); return true; } return false; }
MultiSetupDialog::Result MultiSetupDialog::open(omni::proj::MultiSetup* _multiSetup, Session* _session) { MultiSetupDialog _dialog(_multiSetup,_session); _dialog.exec(); return _dialog.result_; }
void Panel_Remaps::DoCreateBase() { // Make the user sure int res = wxMessageBox( wxT("This will overwrite the current base image.\n" "It will be replaced by a copy image,\n" "at which will be added all the missing colors of the palette" "Sure to do this ?") , wxT("Question"), wxYES_NO | wxICON_INFORMATION, this ); if( res == wxYES ) { if( paletteCtrl->theSourceImg == NULL || !paletteCtrl->theSourceImg->IsOk() ) { wxMessageBox( wxT("Invalide base image for the operation ") , wxT("ProPlem"), wxOK | wxICON_INFORMATION, this ); return; } // Get the base name // Ask for the name wxFileDialog _dialog(this, wxT("Choose a file for the base img for remaps"),dataDirPath.GetFullPath() ); int response = _dialog.ShowModal(); if( response != wxID_OK ) return; wxString fn_base = _dialog.GetPath(); // Check if it's a valid ob project pa wxString str_path = Convert_To_Ob_Path( fn_base ); if( str_path == wxString() ) { wxMessageBox( wxT("Can't use this file.\nIs it really in the project data Directory ?"), wxT("Error"), wxOK | wxICON_INFORMATION, this ); return; } // Draw each palette element on the base image int _y=0; int _x=-1; for( int i = 0; i < paletteCtrl->nb_elts ; i++) { _x++; // Ok if( paletteCtrl->theSourceImg->SetPixel( _x, _y, i ) ) continue; // must go to line _y++; _x=-1; i--; } //Save the base if( ! paletteCtrl->theSourceImg->SaveAs( fn_base ) ) { wxMessageBox( wxT("Cannot save the resulted image ") , wxT("ProPlem"), wxOK | wxICON_INFORMATION, this ); return; } // Set the new base to the textcontrol txtctrl_imgBase->SetValue( str_path ); // Refresh the palette DoChangeImgBase(true); return; } }
bool Panel_Remaps::Do_NewRemap() { if( entity == NULL ) return false; // Ask for the name wxTextEntryDialog _dialog(this, wxT("New remap"), wxT("Name for the new remap "), wxString(), wxOK | wxCANCEL | wxCENTRE ); int response = _dialog.ShowModal(); if( response == wxID_OK ) { wxString remap_name = _dialog.GetValue().Trim().Trim(false); // Get current remaps size_t nb_remaps = 0; ob_object** curr_remaps = NULL; if( !mode8bit ) curr_remaps = entity->GetSubObjectS( wxT("alternatepal"), nb_remaps ); else curr_remaps = entity->GetSubObjectS( wxT("remap"), nb_remaps ); // Give a default name if none is provided if( remap_name == wxString()) { if( mode8bit ) remap_name = wxT("remap ") + IntToStr( nb_remaps ); else remap_name = wxT("alternatepal ") + IntToStr( nb_remaps ); } ob_object * new_remap; // If it's the first remap object if( curr_remaps == NULL ) { // No previous remap => Juste add it as a property wxString _tag = wxT("remap"); if( !mode8bit ) _tag = wxT("alternatepal"); new_remap = new ob_object(); new_remap->SetName( _tag ); entity->AddProperty( new_remap ); } // Insert a new remap object else { if( mode8bit ) { wxString prev_baseImg = curr_remaps[nb_remaps-1]->GetToken( 0); new_remap = new ob_object(); new_remap->SetName( wxT("remap") ); new_remap->SetToken( 0, prev_baseImg ); } else { new_remap = new ob_object(); new_remap->SetName( wxT("alternatepal") ); } curr_remaps[nb_remaps-1]->InsertObject_After( new_remap ); delete[] curr_remaps; } wxString _comment = wxT("#") + remap_name; new_remap->SetComment( _comment ); // Append and select the new remap object in the remap control choices choiceBox_remaps->Append( remap_name.Left(15) ); choiceBox_remaps->SetSelection( nb_remaps ); sizer_remaps_choice->Layout(); entity->SetChanged(); DoRemapSelectionChange( true ); return true; } return false; }