| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <string> |
| 4 |
#include <memory> |
| 5 |
|
| 6 |
class wxWindow; |
| 7 |
|
| 8 |
namespace ui |
| 9 |
{ |
| 10 |
|
| 11 |
/** |
| 12 |
* A Resource Chooser is a dialog for picking mod resources like |
| 13 |
* shaders, animations, sound shaders, particles, etc. |
| 14 |
* |
| 15 |
* The actual implementation varies a lot, but all resource pickers |
| 16 |
* share the ability to return the VFS path or name of the picked object |
| 17 |
* and to pre-select an item immediately after its shown. |
| 18 |
*/ |
| 19 |
class IResourceChooser |
| 20 |
{ |
| 21 |
public: |
| 22 |
virtual ~IResourceChooser() {} |
| 23 |
|
| 24 |
// Run the dialog and return the selected shader. The dialog will enter a |
| 25 |
// new event loop and block the UI until it's closed again. |
| 26 |
// The returned string will be empty if the user clicks cancel. |
| 27 |
virtual std::string chooseResource(const std::string& preselected = std::string()) = 0; |
| 28 |
|
| 29 |
// Destroys the window. Don't rely on the destructor, it won't call Destroy() for you. |
| 30 |
virtual void destroyDialog() = 0; |
| 31 |
}; |
| 32 |
|
| 33 |
} |