![]() |
Shkyera Engine
Easy to use, game engine for Python
|
A user interface widget for interacting with the filesystem. More...
#include <FilesystemWidget.hpp>
Public Member Functions | |
FilesystemWidget (std::string name, std::shared_ptr< Registry > registry) | |
virtual void | draw () override |
Implementation of the abstract draw method to render the filesystem widget. | |
![]() | |
Widget (std::string name) | |
Constructor to create a widget with a specified name. | |
virtual | ~Widget ()=default |
Default virtual destructor. | |
Private Member Functions | |
void | drawDirectoryTree (AssetHandle directoryHandle) |
Draw the directory tree, starting from the specified directory. | |
void | drawDirectoryContents () |
Draw the contents of the specified directory. | |
void | drawDirectory (AssetHandle directoryHandle) |
Draw a directory icon and name. | |
template<typename AssetType > | |
void | drawAsset (AssetHandle handle) |
Draw an asset icon and name. | |
template<typename AssetType > | |
void | drawAssetIcon (AssetHandle handle) |
void | drawIconName (const std::string &name) const |
Draw an icon and name within the UI. | |
void | handleRightMouseClick () |
template<> | |
void | drawAssetIcon (AssetHandle handle) |
template<> | |
void | drawAssetIcon (AssetHandle handle) |
template<> | |
void | drawAssetIcon (AssetHandle handle) |
template<> | |
void | drawAssetIcon (AssetHandle handle) |
template<> | |
void | drawAssetIcon (AssetHandle handle) |
Private Attributes | |
std::shared_ptr< Registry > | _registry |
AssetHandle | _rootDirectoryHandle |
AssetHandle | _currentDirectoryHandle |
AssetRef< Texture > | _folderIcon |
AssetRef< Texture > | _pythonIcon |
AssetRef< Texture > | _imageIcon |
AssetRef< Texture > | _textIcon |
AssetRef< Texture > | _audioIcon |
bool | _hoveredIcon |
Static Private Attributes | |
static constexpr float | CONTENTS_ICON_SIZE = 64 |
The size of icons representing directory contents. | |
Additional Inherited Members | |
![]() | |
std::string | _name |
The name of the widget. | |
A user interface widget for interacting with the filesystem.
The FilesystemWidget
class provides a graphical user interface for navigating and interacting with the filesystem, displaying directories, files, and enabling file-related actions.
shkyera::FilesystemWidget::FilesystemWidget | ( | std::string | name, |
std::shared_ptr< Registry > | registry | ||
) |
|
overridevirtual |
Implementation of the abstract draw
method to render the filesystem widget.
Apologies to the reader for this hack
Implements shkyera::Widget.
|
inlineprivate |
Draw an asset icon and name.
assetHandle | Handle of the asset to draw. |
icon | Icon of the asset |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Draws the icon of an asset and allows for its drag-and-drop behavior.
Type | of the asset |
hande | Asset Handle of the drawn asset |
|
private |
Draw a directory icon and name.
directoryHandle | Handle of the directory to draw. |
|
private |
Draw the contents of the specified directory.
directory | The directory whose contents to draw. |
|
private |
Draw the directory tree, starting from the specified directory.
directory | The root directory to draw. |
Draw an icon and name within the UI.
name | The name to display. |
|
private |
|
private |
|
private |
|
private |
|
private |
The size of icons representing directory contents.