mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 18:56:43 +00:00 
			
		
		
		
	Add missing confirmation dialog for deleting map notes
This commit is contained in:
		
							parent
							
								
									6e2673daf3
								
							
						
					
					
						commit
						271c921cf8
					
				
					 4 changed files with 16 additions and 2 deletions
				
			
		|  | @ -13,12 +13,15 @@ namespace MWGui | |||
|         mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ConfirmationDialog::onOkButtonClicked); | ||||
|     } | ||||
| 
 | ||||
|     void ConfirmationDialog::open(const std::string& message) | ||||
|     void ConfirmationDialog::open(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage) | ||||
|     { | ||||
|         setVisible(true); | ||||
| 
 | ||||
|         mMessage->setCaptionWithReplacing(message); | ||||
| 
 | ||||
|         mCancelButton->setCaptionWithReplacing(cancelMessage); | ||||
|         mOkButton->setCaptionWithReplacing(confirmMessage); | ||||
| 
 | ||||
|         int height = mMessage->getTextSize().height + 72; | ||||
| 
 | ||||
|         mMainWidget->setSize(mMainWidget->getWidth(), height); | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ namespace MWGui | |||
|     { | ||||
|         public: | ||||
|             ConfirmationDialog(); | ||||
|             void open(const std::string& message); | ||||
|             void open(const std::string& message, const std::string& confirmMessage="#{sOk}", const std::string& cancelMessage="#{sCancel}"); | ||||
|             virtual void exit(); | ||||
| 
 | ||||
|             typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void; | ||||
|  |  | |||
|  | @ -17,6 +17,7 @@ | |||
| #include "../components/esm/globalmap.hpp" | ||||
| 
 | ||||
| #include "widgets.hpp" | ||||
| #include "confirmationdialog.hpp" | ||||
| 
 | ||||
| namespace | ||||
| { | ||||
|  | @ -567,6 +568,15 @@ namespace MWGui | |||
|     } | ||||
| 
 | ||||
|     void MapWindow::onNoteEditDelete() | ||||
|     { | ||||
|         ConfirmationDialog* confirmation = MWBase::Environment::get().getWindowManager()->getConfirmationDialog(); | ||||
|         confirmation->open("#{sDeleteNote}", "#{sYes}", "#{sNo}"); | ||||
|         confirmation->eventCancelClicked.clear(); | ||||
|         confirmation->eventOkClicked.clear(); | ||||
|         confirmation->eventOkClicked += MyGUI::newDelegate(this, &MapWindow::onNoteEditDeleteConfirm); | ||||
|     } | ||||
| 
 | ||||
|     void MapWindow::onNoteEditDeleteConfirm() | ||||
|     { | ||||
|         mCustomMarkers.deleteMarker(mEditingMarker); | ||||
| 
 | ||||
|  |  | |||
|  | @ -198,6 +198,7 @@ namespace MWGui | |||
|         void onMapDoubleClicked(MyGUI::Widget* sender); | ||||
|         void onNoteEditOk(); | ||||
|         void onNoteEditDelete(); | ||||
|         void onNoteEditDeleteConfirm(); | ||||
|         void onNoteDoubleClicked(MyGUI::Widget* sender); | ||||
|         void globalMapUpdatePlayer(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue