Developing file operation dialogs.

This commit is contained in:
2025-07-08 21:50:41 -05:00
parent 5d404ea079
commit 932af3e3ce
7 changed files with 127 additions and 68 deletions

View File

@@ -19,6 +19,7 @@
#include <Editor/LayerView.hpp>
#include <Editor/TilesetView.hpp>
#include "JUI/Widgets/FileDialog.hpp"
#include "JUI/Widgets/FpsGraph.hpp"
#define GL_VER_MAJOR 2
@@ -79,6 +80,7 @@ public:
//JUI::Window* tileset_viewer = nullptr;
JUI::Rect* cell_indicator = nullptr;
NewMapDialog* nmd = nullptr;
JUI::FileDialogWindow* file_dialog = nullptr;
LayerView* layer_view = nullptr;
JUI::Window* bg_color_tool_window = nullptr;
JUI::ColorPicker* bg_color_tool = nullptr;
@@ -105,10 +107,8 @@ public:
JUI::Window * CreateAppInfoDialogWindow(JUI::Widget *parent);
Layer* GetLayer(int index)
{
return loaded_level->layers[index];
}
Layer* GetLayer(int index) const;
Layer* GetFocusLayer()
{
return loaded_level->layers[focus_layer_index];
@@ -181,6 +181,8 @@ public:
void BindConsoleCallbacks();
void CreateTopbarWidgets();
/// Create all JUI elements required for this program.
void CreateWidgets();

View File

@@ -8,13 +8,35 @@ public:
Event<> OnSubmit;
NewMapDialog() : JUI::Window() {
using namespace JUI::UDimLiterals;
Name("NewMapDialog");
level_name_field = new JUI::TextInputForm(this->Content());
level_name_field->Size({200_px, 20_px});
description_field = new JUI::TextInputForm(this->Content());
description_field->Size({200_px, 20_px});
description_field->Position({0_px, 20_px});
author_field = new JUI::TextInputForm(this->Content());
author_field->Size({200_px, 20_px});
author_field->Position({0_px, 40_px});
}
explicit NewMapDialog(Widget* parent) : NewMapDialog()
{
this->Parent(parent);
}
void ClearFields() {
}
protected:
JUI::TextInputForm* level_name_field;
JUI::TextInputForm* description_field;
JUI::TextInputForm* author_field;
private:
};

View File

@@ -22,6 +22,10 @@ public:
/// The human-readable name of the level.
/// This is typically displayed in level selection menus or editors.
std::string name;
/// A UTC-timestamp of the last time the level file was modified.
std::string last_edit_timestamp;
/// A brief description of the level's content or purpose.
/// Useful for level browsers or internal documentation.
std::string description;